Compare commits

...

2506 Commits

Author SHA1 Message Date
Gregory Hainaut
58ba6789cc Bump version number
It's still time to switch to the new stable release before massive breakage ;)
2016-01-08 19:04:49 +01:00
Gregory Hainaut
3451f7e760 gsdx-ogl: handle invalid gl_lengh in debug message
Mesa intel sets it to -1.

Close #1089
2016-01-07 21:49:17 +01:00
Avi Halachmi (:avih)
165d2860e4 about dialog: add Devina 2016-01-05 06:30:26 +02:00
Avi Halachmi (:avih)
4ff5b9e7ce Games DB: update compatibility: (17 better, 1 worse):
Summary:

Worse:
- Degrading compat from 5 to 4 for SLUS-20573: Sims, The

Better:
- Improving compat from 3 to 5 for SLUS-21632: NHL 2K8
- Improving compat from 2 to 5 for SLUS-21425: NHL 2K7
- Improving compat from 4 to 5 for SLUS-20919: ESPN - NFL 2K5
- Improving compat from 2 to 5 for SLUS-21232: College Hoops 2K6
- Improving compat from 2 to 5 for SLUS-20225: Gadget Racers
- Improving compat from 2 to 5 for SLUS-21914: NHL 2K10
- Improving compat from 3 to 5 for SLUS-20235: Superman - Shadow of Apokolips
- Improving compat from 2 to 5 for SLUS-20842: Sims, The - Bustin' Out
- Improving compat from 4 to 5 for SLUS-21563: Horsez
- Improving compat from 4 to 5 for SLUS-20637: Chessmaster (Online)
- Improving compat from 3 to 5 for SLES-50874: F1 2002
- Improving compat from 2 to 5 for SLES-52298: IndyCar Series 2005
- Improving compat from 0 to 5 for SLUS-21680: Harvey Birdman - Attorney at Law
- Improving compat from 0 to 5 for SCES-51684: World Rally Championship 3
- Improving compat from 0 to 5 for SLUS-21235: MLB 2k6
- Improving compat from 0 to 5 for SLES-50252: Penny Racers
- Improving compat from 0 to 5 for SLES-54151: Let's Make a Soccer Team!
2016-01-04 21:00:22 +02:00
Avi Halachmi (:avih)
12650610aa widescreen patches (cheats_ws.zip): 56 new, 26 updated, overall 1994
Taken from Devina's archive at the forum (updated 2016-01-03), and removed the
three WIP patches: 1771BFE4, C77AF2CA and C77AF2CA.
2016-01-04 15:57:16 +02:00
Avi Halachmi (:avih)
d770a048aa GS window title: remove redundant ${pause} from commit 4626e489 2016-01-04 15:53:53 +02:00
Avi Halachmi (:avih)
4626e48980 GS window title: add <PAUSED> when paused
Mostly relevant if the GS window is set to not hide while paused, but also shows
when the emulation is paused due to plugin config etc.

The string <PAUSED> is configurable via the template at PCSX2_ui.ini (including
making it empty) but currently it always appear at the begining of the title.
2016-01-03 22:14:30 +02:00
Avi Halachmi (:avih)
e8b653ddf3 KB commands: change Sys_Suspend to Sys_SuspendResume (toggle)
It's now possible to press ESC once to pause, and ESC again to resume (or assign
any other key via PCSX2_keys.ini, e.g. to SPACE).

Note that resume only works if the GS window is NOT set to hide on pause (Emu
options -> GS Window), and if the key is pressed while the GS window is focused.

This includes two related changes:
- The command name at PCSX2_keys.ini is now changed to Sys_SuspendResume.
- If the GS window is NOT set to hide on pause, then it stays focused on pause.

--nogui also gains this behavior, so it's now possible to launch without a GUI
and still suspend/resume if the GS window is not set to hide on pause. If it is
set to hide on pause, then the behavior remains as it was: exit PCSX2 on pause,
or prompt to exit/resume if --noguiprompt is provided.
2016-01-03 22:13:14 +02:00
Avi Halachmi (:avih)
6300a47c15 GS window: improve keys/commands handling when paused
Only relevant if the GS window is set to NOT hide when paused. At this case
there were two issues on Windows:
- Commands were invoked twice.
- Non-special-keys (e.g. plain 'q') were not handled at all.

Not terribly important now, but it prepares for the next commit.
Also rename a function to have a more meaningful name.
2016-01-03 22:13:14 +02:00
Gregory Hainaut
73b22cac56 badges takes 3 2016-01-03 14:31:26 +01:00
Gregory Hainaut
6140fde60c badges take 2 2016-01-03 14:19:38 +01:00
Gregory Hainaut
ddc657a073 README.md: try to add some badges 2016-01-03 14:13:41 +01:00
Jonathan Li
f14797e64f Merge pull request #1079 from Kingcom/registerlist
Optimize register list drawing
Fixes a register list GUI issue on Linux.
2016-01-03 00:20:23 +00:00
Jonathan Li
bb37d1c339 gsdx:windows: Don't change renderer when changing adapter
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.
2016-01-02 22:20:30 +00:00
Jonathan Li
12e80c271b gsdx:windows: Widen Hacks dialog slightly
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.
2016-01-02 22:17:30 +00:00
Kingcom
c6b60d5376 Fix mouse position calculation 2016-01-02 22:02:33 +01:00
Kingcom
a3dea9b243 Optimize register list drawing 2016-01-02 22:02:33 +01:00
Gregory Hainaut
fc98fc9781 gsdx: only enable "please fix me" message on debug build 2016-01-02 18:53:15 +01:00
Gregory Hainaut
8b5e22dd7d i10n: update cs_CZ binary 2016-01-01 14:44:06 +01:00
Gregory Hainaut
7aae0ce394 gsdx ogl: minor string update 2016-01-01 14:43:47 +01:00
ramapcsx2
6e34f183ea Merge pull request #1070 from Kingcom/registerlist
Revert to old register list, make it scrollable
2015-12-31 17:13:06 +01:00
Gregory Hainaut
93e26f8117 Merge pull request #1076 from frantisekz/master
Czech translation
2015-12-31 09:59:50 +01:00
František Zatloukal
ec453c32a1 Czech translation 2015-12-31 01:17:58 +01:00
Kingcom
cbd7aed0f3 Make register list scrollable 2015-12-30 20:12:19 +01:00
Kingcom
80db2abe3d Fix debugger crash after using shutdown. Fixes #1074 2015-12-30 19:22:11 +01:00
Kingcom
de1f3d0df7 Remember size of debugger window 2015-12-30 19:22:11 +01:00
Kingcom
be0ad9be2f Scale the font size in debugger controls with DPI 2015-12-30 19:22:11 +01:00
Kingcom
1fe15c16cc Use alternating background colors in the register list 2015-12-30 19:22:10 +01:00
Kingcom
11bcb328f8 Revert to old register list 2015-12-30 19:22:10 +01:00
Gregory Hainaut
902e295089 gsdx: fix onimusha crash in custom resolution
I don't understand why but it seems it needs more than 8MB
2015-12-30 19:14:52 +01:00
Gregory Hainaut
bfa53af50f gsdx linux: fix ShadeBoost option case 2015-12-30 19:14:52 +01:00
ramapcsx2
d84d765aeb whops 2015-12-30 18:53:38 +01:00
ramapcsx2
8e3aec8aaf gsdx dialog: renderer order and naming changed. due to many factors, we can't yet remove any of the software options. naming / order changes are possible though, if a majority votes for it. 2015-12-30 18:06:54 +01:00
ramapcsx2
df0dd10c9f about box changes 2015-12-29 17:47:10 +01:00
Kingcom
191453d89a gsdx: fix windows compilation 2015-12-28 22:05:01 +01:00
Gregory Hainaut
a595a09fbd gsdx: increase buffer to have crash in case of overflow
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.
2015-12-28 21:40:06 +01:00
Gregory Hainaut
c36fccdd8e gsdx: fix crash when preload data frame is enabled
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
2015-12-28 18:00:14 +01:00
ramapcsx2
90ad6e89ad small pdfs update and an nsis fix 2015-12-28 17:44:15 +01:00
ramapcsx2
ef62d753d1 Merge pull request #1056 from ssakash/gsdx_swthreads
GSDX: Some change to software rendering threads
2015-12-28 17:23:32 +01:00
sudonim1
3042648ed4 Merge pull request #1069 from Kingcom/iop
Fix IOP bltzal and bgezal opcodes
2015-12-28 15:25:21 +00:00
Kingcom
4c36c12fb1 Fix IOP bltzal and bgezal opcodes 2015-12-28 10:05:26 +01:00
willkuer
0c4b25bcec gsdx: defaulting extra rendering threads to 2 2015-12-28 01:05:25 +05:30
Gregory Hainaut
ac0d7f74cf gsdx: reorder renderer config code & fix linux gui
Group all DX option into a unique section (avoid tons of ifdef)

Rename Null renderer as "None (Core Benchmark)"
2015-12-27 11:24:05 +01:00
Jonathan Li
20e36f8adf Merge pull request #1063 from achurch/master
Fix build error with wxWidgets 2.8.
2015-12-26 17:26:21 +00:00
Andrew Church
b66cd84b9a Fix build error with wxWidgets 2.8.
Regression introduced in 81891ac1097f28fc97c0bd4226b0b72394c2ef69;
assigning "" to a wxString results in an ambiguity error when building
with wxWidgets 2.8 (this could well be a bug in wxWidgets).  The default
wxString constructor creates an empty string anyway, so these assignments
are unnecessary.
2015-12-26 10:57:48 +09:00
Avi Halachmi (:avih)
df356694c5 spu2-x: stretcher: allow minimum latency of 15ms (was 30ms)
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.
2015-12-25 01:49:53 +02:00
Avi Halachmi (:avih)
22c9d882a8 spu2-x: stretcher: dampen the tempo adjustment to reduce resonance
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.
2015-12-24 23:26:29 +02:00
Gregory Hainaut
3fc9643460 i10n: udpate binary translation files 2015-12-23 18:26:28 +01:00
IlDucci
361e261997 i10n: update es_ES
Greg: merge & conflict
2015-12-23 18:25:06 +01:00
Leucos
062212952d i10n: update it_IT
Greg: merge & conflict stuff
2015-12-23 18:18:15 +01:00
Gregory Hainaut
6edd8834dd Merge branch 'josephgbr-master' 2015-12-23 17:56:38 +01:00
Gregory Hainaut
1ee8130ffa Merge branch 'master' of git://github.com/josephgbr/pcsx2 into josephgbr-master
greg: resolve conflict

Conflicts:
	locales/pt_BR/pcsx2_Iconized.po
	locales/pt_BR/pcsx2_Main.po
2015-12-23 17:56:21 +01:00
Akash
21c6fa5f1b gsdx-gui: Label and Tooltip changes to RT option 2015-12-23 19:51:13 +05:30
ramapcsx2
f4dcb35bc8 Merge pull request #1055 from ssakash/gsdx_dlgelement_changes
GSDX: disable SW mode options on hardware renderer
2015-12-23 10:39:09 +01:00
Akash
acb82389c8 GSDX: disable SW mode options on hardware renderer 2015-12-23 12:30:22 +05:30
Jonathan Li
e5535ccc8f 3rdparty:wxwidgets: Preserve Win32 last error in wxTlsKey::Get()
This is commit e093a3b1b402c067254558d24ef2d7f39f552251 from the wx3.0
stable branch.

The correct error code and message is now output when an error takes
place. Previously it would report an error code of 0 and inform us that
"The operation completed successfully".
2015-12-22 23:33:22 +00:00
ramapcsx2
e34b509b20 nsis changes. removed the web install script as it was progressively harder to maintain.
also bundling only the vc2015(sp1) redist now.
2015-12-22 17:56:59 +01:00
Gregory Hainaut
816dc65262 i10n: refresh all languages 2015-12-22 16:58:07 +01:00
ramapcsx2
05f1dca151 Merge pull request #990 from turtleli/windows-fixes
Windows: Potential fix for XAudio2.7 unload crashes
2015-12-22 16:56:06 +01:00
Gregory Hainaut
81891ac109 pcsx2:cli: support the elf option properly 2015-12-22 16:34:58 +01:00
ramapcsx2
49123cca59 Merge pull request #1051 from ssakash/GSDX_cleanup
GSDX-OCL: remove OCL device combobox from GUI
2015-12-22 15:11:43 +01:00
Rafael Fontenelle
05e45b196b Update Brazilian Portuguese translation 2015-12-22 11:13:08 -02:00
Akash
5e67276b6c GSDX-OCL: remove OCL device combobox from GUI
The following patch hides the combobox from the GUI when ENABLE_OPENCL macro is not defined.
2015-12-22 04:15:56 +05:30
ramapcsx2
3fd0b10762 small fix for WinXP / GSdx renderer cleanup 2015-12-21 19:53:36 +01:00
ramapcsx2
3210740872 Patch by r5 that reorders renderers in GSdx' config dialog. Also removes some redundant options. 2015-12-21 19:30:03 +01:00
ramapcsx2
d008de7b37 Merge pull request #1049 from KrossX/lilypad_default
Lilypad default xinput controls
2015-12-21 12:38:28 +01:00
KrossX
7493570a0d Default config file for xinput 2015-12-21 08:07:12 -03:00
KrossX
ba8f34a594 Merge remote-tracking branch 'refs/remotes/PCSX2/master' 2015-12-21 07:57:11 -03:00
ramapcsx2
3bf86618fc nsis: include vc2015 (sp1) redist 2015-12-21 11:40:38 +01:00
Jonathan Li
000f4984cf spu2-x:windows: Potentially prevent XAudio2.7 unload crashes
The extra LoadLibrary call prevents XAudio2.7 from unloading since
LoadLibrary reference counts. See
http://blogs.msdn.com/b/chuckw/archive/2015/10/09/known-issues-xaudio-2-7.aspx

Should fix random XAudio2 crashes.
2015-12-20 20:08:20 +00:00
Gregory Hainaut
077f06562f gsdx-linux: use standard code for the renderer box
Fix the openCL issue and code is cleaner
2015-12-20 19:33:39 +01:00
ramapcsx2
9092be3a52 GSdx: better default renderer selection. Thanks, Gregory :) 2015-12-20 16:03:58 +01:00
ramapcsx2
16231f599b Merge branch 'master' of https://github.com/PCSX2/pcsx2 2015-12-20 14:47:27 +01:00
ramapcsx2
43b9caf735 GSdx: default renderer to DX11 hw. SPU2-X: default output module to xaudio2 (portaudio has issues selecting the proper hardware device) 2015-12-20 14:46:59 +01:00
Gregory Hainaut
cae0ac2d3f gsdx: change gl reporting color message 2015-12-20 14:15:46 +01:00
ramapcsx2
9170d2902c shuffle some names in about dialog 2015-12-20 13:20:53 +01:00
ramapcsx2
c73f87ac71 Merge pull request #1046 from ssakash/GSDX_mode
PCSX2: Fix up Video mode detection on GS Frame
2015-12-20 13:05:12 +01:00
ramapcsx2
279fc2ac79 round of nsis fixes 2015-12-20 02:55:17 +01:00
ramapcsx2
58aaea6277 Better MTVU thread cancel 2015-12-19 12:22:15 +01:00
ramapcsx2
1111e03901 Finally nailed the MTVU zombie processes bug. Thanks a lot for the tip,
@turtleli! Well, at least we hope it's gone for good now ;)
2015-12-17 23:19:11 +01:00
Akash
0f1fec40cf GSFrame: Fix up video mode detection.
Previously Interlaced (Field) was displayed as Progressive which was wrong since the tested games didn't even support Progressive mode and it misleaded most of the users so let's just display Interlaced during Field mode.
2015-12-17 19:51:33 +05:30
Avi Halachmi (:avih)
3820bf16fd GUI: presets: don't gray-out static text when presets are disabled
The EE/IOP and VUs panels were disabled completely when presets are enabled,
which apparently also means disabling (graying out) the static texts, however,
re-enabling them (when disabling presets) didn't un-gray-out the static text.

This is likely a wxWidgets bug, but we can avoid it by just enabling/disabling
all items explicitly (and keeping the panels themselves always enabled).

For these panels, this means adding explicit enable/disable of the he EE-cache
checkbox and the Restore-Defaults buttons.

The issue doesn't seem to happen on other panels (though some earlier revisions
apparently also had this issue for the static text at the game fixes panel, but
apparently it's not an issue now).
2015-12-17 06:59:33 +02:00
Gregory Hainaut
b1d7f0e3fd gsdx: remove openCL from the ini if it isn't enabled 2015-12-14 10:00:28 +01:00
ramapcsx2
c8a7a709dc bring vsyncinfocalc up to the revision that seems to fix 2 games that
got broken by the last update. debugger output still looks sensible.
2015-12-13 19:20:58 +01:00
refractionpcsx2
d3ec74be2b Merge pull request #980 from AdmiralCurtiss/ff12mcdfix
FolderMemoryCard: Fix issue #976: Corrupted FF12 saves when overwriting data.
2015-12-13 00:08:42 +00:00
refractionpcsx2
b5b5a51897 Merge pull request #947 from ssakash/EE_Control_V2
EE: Rework overclock and underclock function
2015-12-12 15:08:18 +00:00
Jonathan Li
60426a5dec linux: Fix and simplify stdout/stderr redirection
Use close() instead of some dodgy read unblocking and thread cancelling
sequence - it fixes a race condition when closing PCSX2.

Move most of the setup/cleanup into LinuxPipeThread. In addition to
simplifying things, it should also mean that no messages to
stdout/stderr are lost - in the previous code there was a small period
of time where messages would disappear.
2015-12-11 08:52:28 +00:00
refractionpcsx2
0bd7cb1ebe Merge pull request #1023 from ssakash/prafull_patches
GameDB: Add prafull's Gamefix patches
2015-12-07 11:10:40 +00:00
Akash
f67f3a3010 GameDB: Add prafull's Gamefix patches
Patches for 7 games have been added including default settings
modifications for Disney's Treasure Planet to prevent few issues.

Thanks to Prafull for the patches !
2015-12-07 13:21:00 +05:30
ramapcsx2
601d18272b Small fix to the timing revert: need to use gsRegionMode now since scansPerFrame isn't fixed anymore.
(NTSC modes would fail to update the vblank variable)
2015-12-05 02:07:27 +01:00
ramapcsx2
ff2845b2d2 When debugging vSyncInfoCalc(), some serious problems with the math resulted in a nearly saturated u64 and hRender being 0 in all video modes. Team decided to revert to the earlier version, even though it probably breaks "Legendz Gekitou! Saga Battle".
No one knows how any games even started in the broken state and we prefer code being sane('ish) over one game miraculously working. The change is pretty big so it needs some good testing!
2015-12-05 00:25:16 +01:00
Gregory Hainaut
ab962bf5c6 Merge pull request #994 from KrossX/master
Fix for odd DualShock rumble (Untested)
2015-12-04 10:01:19 +01:00
Gregory Hainaut
74c309b4ff i10n: refresh language files 2015-12-03 09:14:06 +01:00
Gregory Hainaut
31e80c1321 Merge pull request #1010 from turtleli/travisci_appveyor
Travis CI and Appveyor continuous integration
2015-12-03 09:08:53 +01:00
Gregory Hainaut
184deec510 Merge branch 'karv-patch-1' 2015-12-03 09:05:29 +01:00
Edgar Carballo Domínguez
e97b65c320 man: Update "Reporting bugs" section in manpage
Greg: squash the commits
2015-12-03 09:04:51 +01:00
rexcaptain501
4b25865108 README: Fix broken DirectX link
Old link leads to a page offering to upgrade/download Windows 10. It has
now been fixed so that it takes you to a working DirectX June 2010
Redist page.
2015-12-02 21:07:53 +00:00
Jonathan Li
2e1ea22532 gsdx: Make TV Shader F7 toggle temporary
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.
2015-12-02 19:45:24 +00:00
Jonathan Li
6e5b8c25dd gsdx:windows: Adjust dialog margin values 2015-12-02 19:07:36 +00:00
Jonathan Li
0f2cb4e2f5 Merge pull request #993 from ssakash/GSDX_dlgchanges
gsdx:windows: Add TV shaders and change GUI design
2015-12-02 18:58:09 +00:00
Gregory Hainaut
e01c1784f3 Merge branch 'master' of github.com:PCSX2/pcsx2 2015-12-02 19:10:06 +01:00
Gregory Hainaut
fb1a19f157 x86emitter: clean unused legacy type
Note: no need to check -1 on register allocation failure (a exception will be fired)
2015-12-02 19:09:43 +01:00
Gregory Hainaut
3684c26cbc ee: drop comma operator
New syntax is script friendly
2015-12-02 19:09:27 +01:00
Gregory Hainaut
9b19dfd562 ee: rename ptr variable
Avoid conflict with ptr[] function operator
2015-12-02 19:09:19 +01:00
Gregory Hainaut
255b592489 svu: rename ptr variable
Avoid conflict with ptr[] function operator
2015-12-02 19:09:12 +01:00
Gregory Hainaut
5dfe7ffc47 core: prepare the conversion to the new emitter naming 2015-12-02 19:09:04 +01:00
Gregory Hainaut
21445fe0d0 x86emitter: Add several architecture dependant wrapper
* A nice object to create the stack frame
* Various xStdCall/xFastCall to emulate standard & fast call
2015-12-02 19:06:52 +01:00
ramapcsx2
4c765a04f7 Change an outdated GSdx comment. It may confuse people nowadays. 2015-12-01 21:36:23 +01:00
Jonathan Li
332995096b ci: Add .travis.yml for trusty
Build with gcc-5 (whatever the ubuntu toolchain ppa uses - currently
gcc-5.2), gcc-4.9 and clang-3.7.

Instead of adding everything into the yml file, I've split off most of
the work into a separate shell script. It's easier to maintain and
extend that way, and Travis CI also recommends to do it this way.
2015-12-01 19:48:23 +00:00
Gregory Hainaut
3cefa54789 linux build: enable mfxsr option
Honestly GCC could have enabled it with sse.

Fix #1012
2015-12-01 18:52:59 +01:00
Gregory Hainaut
1f374e4b92 ee: add a comment on setjmp/longjmp behavior 2015-12-01 18:48:45 +01:00
Akash
e06d45c07d GUI: use green text for slider default values 2015-12-01 20:31:51 +05:30
Akash
1c6a717e93 GSDX: New shader dialog 2015-12-01 15:01:12 +05:30
Gregory Hainaut
5761eba529 Merge pull request #1008 from PCSX2/recompiler-stack-alignment
mvu: keep stack aligned on 16B
2015-11-30 21:54:35 +01:00
Gregory Hainaut
ba4d5b0b95 mvu: keep stack aligned on 16B
Fix a stack fault with address sanitizer (on linux)

v2: protect the code with GNUC (as it is already done in microVU_Execute.inl)
2015-11-30 21:53:41 +01:00
Jonathan Li
d9591b819d ci: Add appveyor.yml
Enforce CRLF line endings so Windows users can actually edit using
notepad.

Build buildbot.xml ReleaseAll target with both VS2013 and VS2015.

Create 7zipped build similar to what the buildbot makes.
2015-11-29 11:59:48 +00:00
Jonathan Li
52be531b8e utilities:windows: Use standard memset for memset_8
aka commit 2194685 for Windows
2015-11-29 11:46:59 +00:00
Jonathan Li
57ad97d212 x86emitter: Remove bool_to_char
It was unused.
2015-11-29 10:58:32 +00:00
Jonathan Li
4d97089990 x86emitter: Fix Windows AVX2 detection
Technically it did work, but it was undefined behaviour. Use __cpuidex,
which allows setting ecx as well.

Also fix the _xgetbv intrinsic - I have no idea how PCSX2 even
compiled on Windows.
2015-11-29 10:57:51 +00:00
Jonathan Li
7055e29670 Merge pull request #969 from toehead2001/about-box
Clean up the About dialog
2015-11-29 09:31:52 +00:00
toehead2001
61067e9c3f Clean up the About dialog
Logo resource doesn't need it's own special line

Layout adjustments
2015-11-29 02:25:32 -07:00
Gregory Hainaut
9aec4229d5 x86emitter: support AVX2 (linux only?)
Nah kidding, it is only the cpu detection for the log

x86 Features Detected:
	SSE2.. SSE3.. SSSE3.. SSE4.1.. SSE4.2.. AVX.. AVX2.. FMA
2015-11-28 23:40:15 +01:00
Gregory Hainaut
02186d5a54 x86emitter: always use fxsave intrinsic/asm 2015-11-28 22:19:42 +01:00
Gregory Hainaut
d5efd6eacb x86emitter: remove the never called SIMD_ExceptionTest function 2015-11-28 22:02:08 +01:00
Gregory Hainaut
a026a1979f gsdx linux: align checkbox text vertically
like Windows :p
2015-11-28 13:24:12 +01:00
Jonathan Li
609442318a debugger:linux: Fix list view sizing
The breakpoints, threads and stack frames list view sizing now works
properly on wx3.0.

It's still completely broken on wx2.8. Oh well.
2015-11-28 08:51:32 +00:00
Gregory Hainaut
cfc8fc4e9b onepad: remove image of the new GUI
Some images aren't GPL compatibles
2015-11-28 09:48:04 +01:00
Jonathan Li
be7806b051 Merge pull request #991 from ssakash/gsdxtc_preloaddataframe
Texture-cache: check userhacks value for preload data frame
2015-11-26 00:07:40 +00:00
Jonathan Li
6a0f185335 padnull: Zero the whole event structure
It fixes an infinite loop when a key is pressed.
2015-11-25 20:03:44 +00:00
Jonathan Li
8a26a6e34c padnull:windows: Switch to unicode build
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.
2015-11-25 20:03:44 +00:00
Jonathan Li
a59a90c734 common:windows: Add unicode compatible functions
It's not great, but it will work.
2015-11-25 20:03:44 +00:00
Jonathan Li
4a73a157e1 padnull: Cleanup unnecessary stuff
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.
2015-11-25 20:03:44 +00:00
Jonathan Li
31d6e05811 padnull:windows: Fix copypasted stuff from fwnull
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.
2015-11-25 20:03:44 +00:00
refractionpcsx2
59dc0e8612 Merge pull request #982 from Sarania/LargeAddressAware
Enable LargeAddressAware by default
2015-11-23 21:24:51 +00:00
KrossX
f7a8ec7ee9 Fix for odd DualShock rumble
Only bit0 matters for the small motor. Fixes RE4 rumble on movies / map.
Was already fixed on xpad.
2015-11-22 19:18:02 -03:00
Akash
8b6ad4ff85 GSDX-TC: check userhacks for preload data frame 2015-11-22 10:49:46 +05:30
Gregory Hainaut
9f2fa79fe3 forget to remove a debug message 2015-11-21 18:34:59 +01:00
Gregory Hainaut
80bdbb5f24 onepad: add an option to workaround DS3 issue with SDL2
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
2015-11-21 18:33:51 +01:00
Gregory Hainaut
a2887d1536 Merge pull request #986 from ssakash/SPU2-X_dlgchanges
SPU2-X: Minor changes to dialog and stuffs
2015-11-21 17:07:11 +01:00
Gregory Hainaut
df87b64ca5 gsdx-linux: left align label 2015-11-20 17:36:03 +01:00
Gregory Hainaut
a41308e8c3 gsdx-linux: add a gui option for the tv shaders 2015-11-20 17:36:03 +01:00
Gregory Hainaut
19c9a0b441 gsdx: remove aggressive threading
http://wiki.pcsx2.net/index.php/PCSX2_Documentation/Threading_Basics
2015-11-20 17:36:03 +01:00
Gregory Hainaut
a46204ef9e cmake: add a USE_LTO option
Note: nothing work so don't use it.
2015-11-20 17:36:03 +01:00
Akash
004ef3d451 SPU2-X: prevent signed/unsigned comparisons 2015-11-20 21:17:05 +05:30
Akash
f90eeb7861 SPU2-X: handling text during restore defautls
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 )
2015-11-20 21:17:04 +05:30
Blyss Sarania
791cd3055b Enable LargeAddressAware in linker configuration
Negates users needing the 4gb patch for some games
2015-11-18 05:38:12 -06:00
refractionpcsx2
1437640bc5 Merge pull request #979 from TheLastRar/master
Dev9ghz: Fix crash on close when ethernet adapter fails to load in winPcap
2015-11-18 09:53:43 +00:00
Admiral H. Curtiss
5865c030cb FolderMemoryCard: Be a bit more paranoid regarding metadata writes and don't allow a flush to assume that a previous flush has already written the metadata of a file. 2015-11-17 22:25:48 +01:00
Admiral H. Curtiss
25064e86b8 FolderMemoryCard: 4cbe9ad5ef happens for the file mod/access metadata time write too, fix that. 2015-11-17 22:25:39 +01:00
Admiral H. Curtiss
4cbe9ad5ef FolderMemoryCard: When metadata in a memory card page changed to point at a different file than what it was on memory card load, the file handle cache that was introduced in 879d0c601f to prevent modification of currently loaded files would get confused and return the wrong file handle. Fixes #976. 2015-11-17 22:17:44 +01:00
TheLastRar
63acc148dc Act like dev9null when fully disabled.
original code for dealing with disabled Ethernet support would cause
some games to freeze when they tried to use the adapter.
2015-11-17 19:22:10 +00:00
TheLastRar
4a24b434ce Disable Ethernet support if loading adapter fails. 2015-11-17 18:30:42 +00:00
Admiral H. Curtiss
186d58af01 FolderMemoryCard: Add some debugging functionality to examine the current memory card structure on load and flush. 2015-11-17 00:27:20 +01:00
Gregory Hainaut
7a69812b17 Merge pull request #927 from PCSX2/preload-rt
gsdx-tc: extend preload frame hack to load target too
2015-11-16 09:36:31 +01:00
Jonathan Li
96c921c776 gsdx: Update DirectX end user runtimes URL
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.
2015-11-15 22:10:00 +00:00
Jonathan Li
e347ad7723 gui: Fix theme directory path
wxDirName doesn't seem to work (and it should probably be called
pxDirName). Use plain old wxFileName instead.
2015-11-15 22:05:41 +00:00
Gregory Hainaut
21857ec12d Merge pull request #967 from PCSX2/remove-lazy-allocation
Reduce lazy allocation
2015-11-15 00:12:07 +01:00
TheLastRar
11e67c9db0 Check if WinPcap initialised correctly
Don't start the RX thread if it hasn't.

Also additional null checks to prevent crashes.
2015-11-14 14:25:34 +00:00
Gregory Hainaut
91b2fd3c4a ee: create a dedicated _DynGen_DispatcherEvent function
for consistency of my doc
2015-11-14 10:29:03 +01:00
Gregory Hainaut
837b62d5e8 cmake: add an option to control PGO 2015-11-14 09:48:53 +01:00
Gregory Hainaut
07ec92175f Merge pull request #966 from PCSX2/game-starting-too-late-i627-v2
pcsx2: apply patch when first block is compiled
2015-11-13 18:50:44 +01:00
Gregory Hainaut
2a0cd77eef spu2x: avoid 64 bits compilation issue
Reported by 3kinox
Solution given by unknownbrackets
2015-11-13 18:48:03 +01:00
Gregory Hainaut
67551f31fd gsdx: use constant expression in offsetof
Well previous expression was a constant already but
compiler failed miserably.
2015-11-13 18:38:48 +01:00
Gregory Hainaut
7eb0f3564b gsdx: AVX is M_SSE == 0x500
0x501 is for AVX2
2015-11-13 18:29:34 +01:00
Gregory Hainaut
967cc0b37b gsdx: align variable 'offsetof' of x64.avx with x86 2015-11-13 18:25:23 +01:00
Gregory Hainaut
3fea5779df gsdx: align sprite test of x64.avx with x86.avx 2015-11-13 18:25:23 +01:00
Akash
c68714fd64 EE: add some nice comments 2015-11-13 15:30:28 +05:30
Gregory Hainaut
736656f7d6 gsdx: properly defined type for xbyak
Compatible 64 bits and avoid local modification
2015-11-13 09:30:48 +01:00
Johannes Obermayr
f4a76c48c2 Use GLsizeiptr on Mesa >= 20150122.
Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com>
2015-11-12 21:21:13 +01:00
Gregory Hainaut
9b2b024721 gsdx-linux: add the preload gs hack option 2015-11-12 21:00:10 +01:00
Gregory Hainaut
ef3aa17025 gsdx-ogl: disable useless Nvidia driver message 2015-11-12 17:04:54 +01:00
Gregory Hainaut
d67ba015c5 Merge pull request #962 from ssakash/GSDX_sizechecks
GSDX: Improve FB size handling
2015-11-12 12:17:31 +01:00
Gregory Hainaut
dfba17c7dc Merge pull request #957 from PCSX2/mvu-custom-search
Mvu custom search
2015-11-12 12:12:11 +01:00
Gregory Hainaut
a658609ae3 Merge pull request #956 from PCSX2/gcc-warning
Gcc warning
2015-11-12 12:11:59 +01:00
Gregory Hainaut
d68d378a48 pcsx2: sign compare 2015-11-12 12:11:44 +01:00
Gregory Hainaut
f2f28d1794 pcsx2: add missing case in switch 2015-11-12 12:11:44 +01:00
Gregory Hainaut
b53be72c6e lilypad: sign compare 2015-11-12 12:11:44 +01:00
Gregory Hainaut
c12958bf10 gsdx: sign-compare
Need review
2015-11-12 12:11:44 +01:00
Gregory Hainaut
abb4cb4810 plugin API: use const char* insead of char*
I hope it doesn't change the ABI

v2: fix GSnull/zzogl/zerogs
v3: duplicated code on windows...
2015-11-12 12:11:42 +01:00
Gregory Hainaut
6180515212 spu2x: sign compare 2015-11-12 12:10:49 +01:00
Gregory Hainaut
4bfb60865c common: ifdef x64 specific code
gcc warning:  set but unused
2015-11-12 12:10:49 +01:00
Gregory Hainaut
50ee00cfe5 ee: always handle manually page that contain thread context
There are 2 pages that contains a register context to handle Syscall/Interrupt.
Write protection is useless here.

The only purpose is to reduce the number of useless SIGSEGV at the start of a game
2015-11-12 10:48:30 +01:00
Gregory Hainaut
2a850cd5ad debian: update create tarball script 2015-11-12 10:37:12 +01:00
Gregory Hainaut
e4f407ae7c ee: use enum for mmap_GetRamPageInfo returned value 2015-11-12 10:35:10 +01:00
Gregory Hainaut
ef063b07b4 ee: move EE memory write protection into a function
recRecompile is already complex enough
2015-11-12 10:35:10 +01:00
Gregory Hainaut
26774a2fe0 recompilers: always allocate the first block
Avoid several annoying SIGSEGV at startup
2015-11-12 10:35:10 +01:00
Gregory Hainaut
a4a0b42f8f recompilers: handle the memory by big block (instead of 4KB)
VIF recompilers: full size
EE/MVU/IOP: 1/4th of the size

Lazy allocation is still enabled but it will less triggered.
Next step is to always commit the first block
2015-11-12 10:35:10 +01:00
Gregory Hainaut
7565bcc789 ee: drop SpatialArrayReserve allocator
Let's the kernel manage the memory either with builtin lazy allocation or
swapped memory.

Avoid to handle SIGSEGV manually (nicer for debug) and removes 250 lines of code.
2015-11-12 10:35:10 +01:00
Gregory Hainaut
330704a5e9 pcsx2: apply patch when first block is compiled
Previous behavior apply the patch when first block is executed (it is
already too late)

V2: First tentative crash some games :(

Fix #627
2015-11-12 10:20:24 +01:00
Gregory Hainaut
71c8adcfb2 Revert "pcsx2: apply patch when first block is compiled"
This reverts commit fa1199ac24.

Got a crash on Gran Turismo 4 (devil may cry 3 too)
2015-11-12 10:05:51 +01:00
Jonathan Li
4eb57cde0e gsdx: Adjust current renderer message
The leading space was really annoying me. Also make the variable local
instead of static.

And fix a bad indentation.
2015-11-11 18:52:52 +00:00
Jonathan Li
d952811ec8 debugger: fix help text typo 2015-11-11 18:48:04 +00:00
Akash
739faac264 EE: Invert the slider values logic 2015-11-11 18:46:09 +05:30
Akash
90b11b2fb9 EE: Rework overclock and underclock function 2015-11-11 18:45:40 +05:30
Gregory Hainaut
916c80d53f Merge pull request #963 from PCSX2/game-starting-too-late-i627
Call eeGameStarting sooner
2015-11-11 10:46:06 +01:00
refractionpcsx2
52802371e4 GSdx D3D11: Workaround for Gust games, must enable sprite hack (which these games need anyway) and it will fix the squares caused by the Nvidia fix. Not a perfect solution but we can't have it both ways :( 2015-11-10 22:58:53 +00:00
Gregory Hainaut
ac0e40a2b7 onepad: safely dispatch rumble action
Fix onepad crashes
2015-11-10 08:12:20 +01:00
Jonathan Li
d62d2abf59 Merge pull request #925 from willkuer/GS_Renderer_Enum
Gs renderer enum & default renderer handling
2015-11-10 00:09:01 +00:00
willkuer
9245d3ed7e gsdx: RendererEnum
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()
2015-11-10 00:26:39 +01:00
Gregory Hainaut
fa1199ac24 pcsx2: apply patch when first block is compiled
Previous behavior apply the patch when first block is executed (it is
already too late)

Fix #627
2015-11-09 22:44:11 +01:00
Gregory Hainaut
321193cf44 Merge branch 'master' of github.com:PCSX2/pcsx2 2015-11-09 22:43:27 +01:00
Jonathan Li
44d89308c9 Revert "Revert "gsdx|spu2-x: Use atlcomcli.h for CComPtr definition""
This reverts commit 9bb990e9ed.

Fight! Ahem...
2015-11-09 20:55:07 +00:00
Akash
d5ba546d2e GSDX: Improve CRTC output size handling 2015-11-09 05:52:42 +05:30
Jonathan Li
b6f78d8d95 gui:windows: Fix pxStaticText colours in Emulation Settings
The window is redrawn when Layout() is used (I think), so the text is
repainted with the correct colour.

This fixes the gray/ungray behaviour in the Emulation Settings dialog.
(Specifically, it affected the GS, Speedhacks, and Game Fixes Panel).
2015-11-08 22:07:20 +00:00
Jonathan Li
9bb990e9ed Revert "gsdx|spu2-x: Use atlcomcli.h for CComPtr definition"
This reverts commit 0eb771c2a6.

The buildbot apparently cannot find atlcomcli.h. Oh joy.
2015-11-08 20:46:41 +00:00
Gregory Hainaut
2ef9b732e2 build: reduce the scope of cppcheck
Faster for GSdx analysis
2015-11-08 21:37:03 +01:00
refractionpcsx2
dfd52282a7 Vif: Fix for Warship Gunner 2 geometry holes. Fixes Issue 665 2015-11-08 18:42:55 +00:00
refractionpcsx2
545e47aacc Merge pull request #960 from ssakash/SPU2-Xconlog
SPU2-X: Update Console log to display Delay Cycles from the INI
2015-11-08 14:31:15 +00:00
Jonathan Li
85a1817ecc gui: Make Plugin/BIOS selector dialog wider
If the plugin info is too long it becomes truncated on Windows, which
could be quite annoying for testing.
2015-11-08 13:32:32 +00:00
Jonathan Li
49ff324882 Merge pull request #955 from turtleli/replace-comptr-h
gsdx|spu2-x: Use atlcomcli.h for CComPtr definition
2015-11-08 13:27:28 +00:00
Akash
a45f3ac5d6 SPU2-X: Handle INI changes to variable on Conlog 2015-11-08 10:47:03 +05:30
refractionpcsx2
8ed56bd971 Merge pull request #953 from ssakash/SPU2-X_debug
SPU2-X: New INI variable for cycle delay
-Configurable for Higurashi no Naku Koro ni Matsuri Kakera Asobi (SPLM-66913)
2015-11-07 16:54:54 +00:00
Gregory Hainaut
d9610d25e5 mvu: enable custom cmp function
From the comment, it used to be bad to gcc alignment issue.

Recent gcc align the stack on 16B boundary. Maybe it solved the issue.
I play severals minutes without any crashes but it requires more tests.
2015-11-07 17:42:08 +01:00
Gregory Hainaut
870e799baa memcpy: remove AMD copyright
memcmp comes from zerofrog (him or external) but likely not AMD

https://www.cs.virginia.edu/stream/FTP/Contrib/AMD/memcpy_amd.asm
2015-11-07 15:57:34 +01:00
Akash
ff77708e0e SPU2-X: New INI variable for cycle delay 2015-11-07 20:16:23 +05:30
Gregory Hainaut
30866833ef mv fps2bios to unfree
Code are likely free but don't have any copyright header :(
2015-11-07 15:42:47 +01:00
Gregory Hainaut
0029956221 add an unfree directory
The idea is to copy files that don't have a clean situation.

Please edit the readme to explain the issue.
2015-11-07 15:08:18 +01:00
Gregory Hainaut
8fb6f0f328 debug: properly redo VU dissassembler function
I misses some calls in DisVUops. Use a macro to directly output the string
in the correct buffer position.
2015-11-07 13:55:47 +01:00
Gregory Hainaut
e5f9923f76 onepad: fix the reset screen saver commit...
Thanks @olegv11 for the review
2015-11-07 13:19:46 +01:00
Gregory Hainaut
2b02a7433f onepad: reset the screen saver every 4096 Vsync
I didn't put the code in PCSX2 because it requires the display pointer.
And I'm afraid of multithread issue.

Related to issue #942
2015-11-07 11:03:39 +01:00
Gregory Hainaut
83d578f39a onepad: release shift when losing the focus 2015-11-07 10:45:10 +01:00
Gregory Hainaut
43390ec240 onepad: remove remaining XAutoRepeat* call 2015-11-07 10:42:15 +01:00
Gregory Hainaut
4ef0572ceb gsdx-ogl: disable copy constructor
'class GSVertexBufferStateOGL' does not have a copy constructor which is recommended since the class contains a pointer to allocated memory.
2015-11-06 23:01:59 +01:00
Gregory Hainaut
345a538c84 pcsx2: Clarify calculation precedence for '>>' and '?'
(cppcheck)
2015-11-06 23:01:58 +01:00
Gregory Hainaut
3e4c3353ce gsdx-ogl: missing break 2015-11-06 23:01:58 +01:00
Gregory Hainaut
9f1649ae57 gsdx: use a type in sizeof
(warning) Suspicious usage of 'sizeof' with a numeric constant as parameter.
2015-11-06 23:01:58 +01:00
Gregory Hainaut
e4e68a6179 debug: 'ostr' is used as parameter and destination in s[n]printf(). 2015-11-06 23:01:58 +01:00
Gregory Hainaut
7c6d2361af gsdx: use scalar delete
(error) Mismatching allocation and deallocation: data
2015-11-06 23:01:58 +01:00
Gregory Hainaut
f3394b16b8 gsdx: use standard quote character
Nicer with tool that support ANSII text (cppcheck)
2015-11-06 23:01:58 +01:00
Gregory Hainaut
1aa6749956 cdvd: remove break after return
cppcheck:[pcsx2/CDVD/CDVD.cpp:1120]: (style) Consecutive return, break, continue, goto or throw statements are unnecessary.
2015-11-06 23:01:58 +01:00
Gregory Hainaut
d4e088b726 build: add clang-tidy support
Slow and generate a 100k log!

Better to fix cppcheck/coverity/gcc(/clang) report first.

Anyway, clang-tidy incorporates clang-modernize (port code
to use some C++11 features)
2015-11-06 23:01:58 +01:00
Jonathan Li
0eb771c2a6 gsdx|spu2-x: Use atlcomcli.h for CComPtr definition
VS2013/VS2015 community includes it, so everything will still compile
for everyone.

Also delete common/include/comptr.h.
2015-11-06 18:52:33 +00:00
Jonathan Li
4ab092d011 Merge pull request #911 from ssakash/gsdx_debug
Gsdx: Add Mipmap (Software mode) and preload data frame to GUI.
2015-11-06 13:01:49 +00:00
Akash
754a7eb7de GSDX: Update toggle key messages 2015-11-06 01:47:53 +05:30
Akash
d866b5592e GSDX: Add two new options to GUI.
The following patch adds Mipmap option (software mode exclusive) and Preload Data Frame (Hardware mode exclusive) to the GSDX plugin settings for debug purposes.
2015-11-06 01:47:44 +05:30
Jonathan Li
372db4b539 Merge pull request #946 from turtleli/linux-console
gui:linux: Redirect stdout/stderr to the PCSX2 console
2015-11-05 18:15:50 +00:00
Jonathan Li
5f5556ee69 gui:linux: Show plugin stdout/stderr in pcsx2 console
Behaviour is now similar to Windows, except we can also show messages in
the terminal as well.
2015-11-05 18:12:45 +00:00
Gregory Hainaut
fa487474d2 build: s/\t/ / 2015-11-05 18:24:36 +01:00
Gregory Hainaut
41081e1b40 build: add a nice cppcheck option 2015-11-05 09:49:06 +01:00
Jonathan Li
45fb0ebcdf Merge pull request #952 from PCSX2/hyperlink-copyright
spu2x: remove hyperlink in windows about box
2015-11-04 17:50:26 +00:00
Gregory Hainaut
d0ea904cdf spu2x: remove hyperlink in windows about box
Code isn't free (and kinda useless)
2015-11-04 07:43:00 +01:00
Gregory Hainaut
6e7962e06a pcsx2: replace memset_sse_a by standard memset
Code is only enabled in dev build.

In the future allocation (therefore the memset) will be done at startup anyway.
2015-11-03 09:17:31 +01:00
Gregory Hainaut
8ab9cea3f7 pcsx2: comment set but unused variable 2015-11-02 07:54:24 +01:00
Gregory Hainaut
82520555b3 cmake: reduce warning level on strict-overflow
It is quite verbose
2015-11-02 07:44:11 +01:00
Gregory Hainaut
5ba41306ea gsdx-tc: HasSharedBits uses PSM not address
Nice heap overflow. I'm surprised that it kinda worked.
2015-11-02 07:36:37 +01:00
Gregory Hainaut
6a38e1d06e onepad: init sigaction struct 2015-11-02 07:36:17 +01:00
Gregory Hainaut
a9af374be6 onepad: don't touch autorepeat setup
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
2015-11-01 10:48:54 +01:00
refractionpcsx2
83549e6f61 Merge pull request #940 from ssakash/dothack_fix
MicroVU: check for VF write on mvu flag hack .
2015-11-01 09:21:32 +00:00
Akash
6bf901faee MicroVU: check for VF write before flag set.
Fixes flickering issues on .Hack games, don't do a early break when Reg Index hasn't been written to a valid destination.
2015-11-01 04:38:58 +05:30
Gregory Hainaut
c3d8cc0978 Merge pull request #897 from PCSX2/coverity-spu2x-mixer
spu2x: correctly apply the volume to the external source
2015-10-31 20:10:43 +01:00
Jonathan Li
08dfa20da1 utilities:linux: Add function to change stdout stream
stdout is not necessarily at stdout - at least not after I'm done with it.
2015-10-31 13:50:02 +00:00
ramapcsx2
49688e2b0d Merge pull request #944 from ssakash/coverity_EE
EE: Prevent usage of uninitialized scalar variable
2015-10-31 13:39:19 +01:00
Gregory Hainaut
36361f04c6 Merge pull request #929 from PCSX2/spu-sdl-api-config
Spu sdl api config
2015-10-31 11:39:45 +01:00
Jonathan Li
e31cb8cbcd spu2x-sdl: restore WX2.8 build compilation
Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com>
2015-10-31 11:06:15 +01:00
Akash
491efd91a5 EE: Prevent usage of uninitialized scalar variable
Fixes CID 153601 , CID 153602 , CID 153603
2015-10-31 15:26:34 +05:30
Gregory Hainaut
2f0077a081 pcsx2-ee: more cleaning of BaseBlockArray
* Remove useless erase(first)
* Move reserve in private section
* if 0 GetByX86
2015-10-30 21:59:06 +01:00
Gregory Hainaut
9c75c84e83 pcsx2-ee: Use a single constructor for BaseBlockArray
Directly reserve the array instead to rely on the reserve function.

+ add a couple of comments
2015-10-30 18:57:46 +01:00
Gregory Hainaut
b215885188 pcsx2-ee: remove unused ManualPageTracking struct 2015-10-30 18:19:46 +01:00
Gregory Hainaut
66259dee17 spu2x-sdl: always use 16 bit formats
32 bits range is too big and requires to maximize the volume.
2015-10-30 17:38:12 +01:00
Gregory Hainaut
2a68c3585c spu2x-sdl: fiddle with SDL to init the selected API
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
2015-10-30 17:37:25 +01:00
Gregory Hainaut
84c6455c95 spu2x-sdl: add a gui setting to select the API
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
2015-10-30 17:13:45 +01:00
Gregory Hainaut
fee3d7c151 pcsx2: sed /branch/g_branch/
Be nice with grep.
2015-10-29 22:35:48 +01:00
Jonathan Li
618ef8b549 pcsx2:linux: Use narrow characters for stdout
Things seem to break when you mix wide and narrow characters.

Plugins messages sent to stdout are now viewable.
2015-10-29 19:09:49 +00:00
Gregory Hainaut
96fc260488 linux: restore default INT/TERM signal handler
Allow to use CTRL-C to quit PCSX2 ("regression" of SDL2)
2015-10-29 15:04:55 +01:00
Jonathan Li
6f4ba08d4a pcsx2:windows: Fix stdout/stderr redirection
The current redirection code doesn't work on VS2015:
 - It relies on undefined behaviour (*stdout/*stderr = *fp)
 - stdin/stdout/stderr are not pre-opened when compiled with the v140*
   toolkits
 - It seems to be the reason PCSX2 fails to terminate properly.

Use a combination of named pipes and freopen to redirect stdout/stderr.

Note: The redirect stuff doesn't seem to work in debug builds, both
before and after the change.
2015-10-28 19:27:15 +00:00
Gregory Hainaut
17e3c570ba pcsx2-ee: properly set the running variable
Fix exception propagation. Behavior is now equivalent to Windows.
2015-10-28 14:25:12 +01:00
Gregory Hainaut
2194685d76 memset-linux: use std memset for memset_8
This memset is only used in the init (to clear the page that will
contains the dynarec dispatcher
2015-10-28 14:25:12 +01:00
Jonathan Li
344d6c201e pcsx2|utilities: Remove Windows wx2.8 code
It's not used anymore.
2015-10-28 00:02:11 +00:00
refractionpcsx2
dc5885790a Merge pull request #816 from ssakash/EE_Control
Speedhacks: Add Overclock function for EE cycle rate.
2015-10-27 15:01:40 +00:00
Akash
156f573842 R5900: Add Overclock function for EE cycle rate.
Pratically, use lower scalar values which eventually increases the clockspeed of the R5900.
2015-10-27 16:24:00 +05:30
Gregory Hainaut
d81481a974 Merge pull request #926 from kust2708/onepad-gui-images
Onepad GUI for Linux - New wxWidget interface (Images)
2015-10-26 21:21:12 +01:00
Gregory Hainaut
b7c51922e8 pcsx2: print a nice message when SYSCALL 2 is called
This syscall is used to setup the CRTC display. Maybe the information
can be useful for GS rendering.
2015-10-26 17:53:25 +01:00
kust2708
9dff864de8 onepad:
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).
2015-10-26 14:28:32 +01:00
Gregory Hainaut
59be6c8710 gsdx: protect some options to avoid buffer overflow
Keep TVShader/interlace/aspectratio in the legal range.

Avoid a crash if the user (aka me) edit the ini file with bad value.
2015-10-25 21:44:20 +01:00
Gregory Hainaut
f1fc9dce36 Merge branch 'turtleli-glsl-fix-tv-shaders' 2015-10-25 21:30:23 +01:00
Gregory Hainaut
b87cda94c5 Merge branch 'glsl-fix-tv-shaders' of git://github.com/turtleli/pcsx2 into turtleli-glsl-fix-tv-shaders 2015-10-25 21:23:39 +01:00
Gregory Hainaut
6547881920 pcsx2: fix gcc reorder warning (due to previous init commit)
Lesson lear for myself, next time compile PR on my box before a merge
2015-10-25 21:17:59 +01:00
Gregory Hainaut
bba67fbd83 Merge pull request #912 from PCSX2/accurate-blending-issue-762
gsdx-ogl: PrimitiveOverlap requires real rectangle
2015-10-25 20:55:41 +01:00
Jonathan Li
1659d5974e gsdx-ogl: Fix scanline, diagonal, triangular TV shaders
PSin.p is normalised, so integer conversions won't work. Use
gl_FragCoord instead.
2015-10-25 19:20:22 +00:00
Gregory Hainaut
50e6306331 Merge pull request #919 from ssakash/coverity_init
Coverity: Initialize class members
2015-10-25 20:08:46 +01:00
Gregory Hainaut
03bf1ec7b3 gsdx-tc: extend preload frame hack to load target too
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).
2015-10-25 15:26:38 +01:00
Gregory Hainaut
fba5a8017c Merge pull request #921 from Leucos8/master
it_IT translation update
2015-10-25 10:12:49 +01:00
Akash
e4490694f1 SPU2-X: Initialize all class members
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.
2015-10-25 14:11:44 +05:30
Akash
f6f8dc1a22 CDVD: Initialze all class members
CID 147025 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)8. uninit_member: Non-static class member m_current_count is not initialized in this constructor nor in any functions that it calls.
2015-10-25 14:11:43 +05:30
Akash
cfd02bff53 Utilities: Initialize all class members
CID 147010 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)4. uninit_member: Non-static class member Enabled is not initialized in this constructor nor in any functions that it calls.
2015-10-25 14:11:34 +05:30
Akash
b2ee732321 pcsx2-debug: Initialize all class members
CID 147005 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)2. uninit_member: Non-static class member PrePrefix is not initialized in this constructor nor in any functions that it calls.
2015-10-25 10:11:18 +05:30
Akash
1512b3ba6c pcsx2-debug: Initialize all class members
CID 146995 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize cpu
2015-10-25 10:11:17 +05:30
Akash
f95664e846 GUI: Initialize all class members
CID 146990 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)6. uninit_member: Non-static class member PluginId is not initialized in this constructor nor in any functions that it calls.
2015-10-25 10:11:15 +05:30
Akash
55a88688a3 GUI: Initialize all class members
CID 146984 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)6. uninit_member: Non-static class member m_performFileWrites is not initialized in this constructor nor in any functions that it calls.
2015-10-25 10:11:14 +05:30
Akash
589e838fa0 GUI: Initialize all class members
CID 146980 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)2. uninit_member: Non-static class member m_panel is not initialized in this constructor nor in any functions that it calls.
2015-10-25 10:11:00 +05:30
Akash
c912064c8d GUI: Initialize all class members
CID 146979 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)2. uninit_member: Non-static class member m_miscGroup is not initialized in this constructor nor in any functions that it calls.
2015-10-25 10:03:35 +05:30
Akash
578b75aa76 GUI: Initialize all class members
CID 146978 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)4. uninit_member: Non-static class member s_rightside_buttons is not initialized in this constructor nor in any functions that it calls.
2015-10-25 10:03:33 +05:30
Akash
61e1686da3 GUI: Initialize all class members
CID 146977 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)6. uninit_member: Non-static class member SizeInMB is not initialized in this constructor nor in any functions that it calls.
2015-10-25 10:03:19 +05:30
ramapcsx2
79075282e5 Merge pull request #922 from ssakash/spu2-x_realtime
SPU2-X: Fix a "Fixme" part of the code.
2015-10-24 16:33:36 +02:00
Gregory Hainaut
295f867118 gsdx: invalid alpha after an EE write
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)
2015-10-24 16:23:50 +02:00
Akash
5d13dfee25 SPU2-X: Remove a logically impossible break
* 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.
2015-10-24 19:48:52 +05:30
Akash
0cc4287b59 SPU2-X: Realtime update for soundtouch configure
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.
2015-10-24 19:34:24 +05:30
refractionpcsx2
286769dc03 VIF MFifo: Simulate buffer filling time from Scratchpad.
-Fixes other Chessmaster hang.
-having it say it has data really quickly if the data incoming was huge seemed to throw it off.  I suspect it may actually be the time it takes to fill 16qw (or whatever is incoming if lower) is the wait time but it seems rather happy with the incoming data size.
2015-10-24 13:25:29 +01:00
Gregory Hainaut
5cbd0cf42a gsdx-debug: add more push/pop debug group on the init 2015-10-24 14:14:37 +02:00
Gregory Hainaut
9ba949c2d9 gsdx-debug: support correct logging on mesa
By default low severity message were disabled. (thanks to be open source)
2015-10-24 14:14:37 +02:00
Gregory Hainaut
c26f2cc80a linux: remove an useless script 2015-10-24 14:14:37 +02:00
Gregory Hainaut
e8fdd99962 spu2x-sdl: keep only C++11 code path
Linux supports C++11 completely.
2015-10-24 14:14:37 +02:00
Leucos
6ab6473cd7 it_IT translation update
Translation update and fixes.
2015-10-24 10:42:38 +02:00
refractionpcsx2
8d22006165 Vif MFIFO: Logic fix for Chessmaster. Game still needs EE Timing Fix to solve later hang in video, but game is playable now. Thanks to Ssakash for looking in to this :) 2015-10-24 03:30:29 +01:00
Gregory Hainaut
e64bdbdb2c Merge pull request #920 from PCSX2/ee-recompiler-stack-alignment
Ee recompiler stack alignment
2015-10-23 22:49:55 +02:00
Gregory Hainaut
1f2d95db7e cmake: restore omit frame pointer optimization
Crash was related to unaligned stack in dyna_page_reset/dyna_block_discard
2015-10-23 22:17:14 +02:00
Gregory Hainaut
b07621f1a1 cmake: drop ASAN workaround
It was used to mask stack issues. It seems to be fixed with previous commits.

I managed to boot a game without any crash ^^
2015-10-23 22:17:14 +02:00
Gregory Hainaut
ccea764556 EE-rec: Don't jump directly to C++ function
On linux, it breaks the 16B stack alignment requirement.

2 dispatchers were added to handle the call to the function. It avoid
any performance impact and remove the extra inlined asm

Fix #506
2015-10-23 22:16:49 +02:00
Gregory Hainaut
40b5195f0e EE-rec: don't save useless variable
the 2 static variables are only used to debug stack issue.
It saves 2 move instructions by block
2015-10-23 22:02:41 +02:00
Gregory Hainaut
464aeecef8 EE-rec: use uptr for function pointer
Avoid potential issue on 64 bits port
2015-10-23 22:02:41 +02:00
Gregory Hainaut
3d5393a0e7 i10n: update template POT file
Nearly 1 year old but hopefully few strings where updated.
2015-10-23 20:00:16 +02:00
Akash
c1f1646dab GSDX: Initialize class members
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}
2015-10-23 01:35:15 +05:30
Gregory Hainaut
87001326f6 gsdx: remove 4Y-old unused code
It was never used.
2015-10-22 19:51:03 +02:00
Gregory Hainaut
a8968257db glsl: keep fract in [0;1] range
Shin Megami Tensei Lucifers seems to generate infinites values.
I suspect that DX always clamp fract output.

Finally fix #782 !
2015-10-22 18:36:45 +02:00
Gregory Hainaut
c0d0e2e89d gsdx-ogl: PrimitiveOverlap requires real rectangle
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)
2015-10-22 12:34:50 +02:00
Gregory Hainaut
56f2e74ff4 Merge pull request #893 from PCSX2/accurate-date-regression
gsdx-ogl: accurate date regression. Bad interaction between depth & DATE
2015-10-22 12:34:00 +02:00
Gregory Hainaut
92553add8e gsdx-ogl: accurate date regression. Bad interaction between depth & DATE
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
2015-10-22 12:31:51 +02:00
Gregory Hainaut
059d4a1306 Merge pull request #898 from PCSX2/gsdx-aniso-hw-unit
gsdx-ogl: only enable aniso when sampling from the HW texture unit
2015-10-22 12:22:21 +02:00
Gregory Hainaut
6561fbc831 gsdx-ogl: only enable aniso when sampling from the HW texture unit
Potentially help issue #884
2015-10-22 12:21:43 +02:00
micove
b13a1ff3dd Merge pull request #908 from micove/WX_PIZZA
Linux GUI: Fix invalid cast from 'wxPizza' to 'GtkBin'.
2015-10-21 16:38:21 -04:00
Gregory Hainaut
ffdc914c71 linux: SDL2
For older distribution you can still use SDL1.2

./build.sh ... --sdl12 ...
or
cmake ... -DSDL2_API=FALSE ...

Note: there is a hard dependency between WxWidget and SDL. If Wx is linked against
SDL1.2, you must use SDL1.2. Crashes are expected otherwise.
2015-10-21 22:35:38 +02:00
Gregory Hainaut
b6d9ea86ee spu2x-sdl: memset the stream buffer in SDL2
Fix #382
2015-10-21 22:13:29 +02:00
Gregory Hainaut
53c38ef2cc spu2-sdl: move the ifdef to support automatic indentation 2015-10-21 20:54:09 +02:00
Gregory Hainaut
281c5e4c66 Properly swap the argument of the good option
AKA: redo commit d7afd7aae0 with the eye open...
2015-10-21 20:41:40 +02:00
Gregory Hainaut
96bf714d85 spu2x-sdl: unique_ptr is always supported
So let's drop various ifdef
2015-10-21 20:36:07 +02:00
Gregory Hainaut
2b06d34279 pcsx2: use Reassign of the scoped pointer to improve readability
Note: it is equivalent to a basic assignment due to operator overloading
2015-10-21 20:10:16 +02:00
Gregory Hainaut
826319ce34 gsdx-ogl: check null pointer
CID 151735 (#1 of 1): Dereference after null check (FORWARD_NULL)
61. var_deref_model: Passing null pointer rt to CopyRectConv, which dereferences it
2015-10-21 20:10:16 +02:00
Gregory Hainaut
d7afd7aae0 pcsx2:debug: swap 2 arguments
It changes nothing but it is more consistent

CID 146916 (#1 of 1): Arguments in wrong order i
(SWAPPED_ARGUMENTS)swapped_arguments: The positions of arguments in the call to disBranch do not match the ordering of the parameters:

    rt is passed to rs
    rs is passed to rt
2015-10-21 20:10:16 +02:00
Jonathan Li
aff1467ea3 debugger:linux: Fix wx2.8 compilation
Bind doesn't work on wx2.8. Replace with event tables and Connect.
wxString::Format also requires the format string to be L"something".
const char* requires an explicit conversion to wxString.
The show 128/64/32 bit menu column stuff doesn't have a direct wx2.8
replacement so just omit it - I'm not sure it's useful functionality
anyway.
2015-10-21 17:34:02 +01:00
Jonathan Li
ccb261a8a3 debugger: Set wxGrid label font as well
It makes the debugger window more vertically compact.
2015-10-21 17:34:02 +01:00
Jonathan Li
9d23fc222a Merge pull request #885 from byehi5299/ctrlregisterlist
Rewrite CtrlRegisterList to allow scrolling and fix size issues.
It now works better on small screens and has simpler code.
2015-10-21 17:33:10 +01:00
Gregory Hainaut
e5015faafa Merge pull request #906 from PCSX2/try-catch-register-allocation-error
pcsx2: generate an exception when recompilation failed
2015-10-21 15:16:45 +02:00
Gregory Hainaut
a4c37d7f51 pcsx2: fallback to the interpreter if bad register allocation 2015-10-21 13:16:51 +02:00
Miguel A. Colón Vélez
8cf51c5cf4 Linux GUI: Fix invalid cast from 'wxPizza' to 'GtkBin'.
(PCSX2:32189): GLib-GObject-WARNING **: invalid cast from 'wxPizza' to 'GtkBin'
.
Cast the wxPizza directly to a GtkWidget. Looking at the wx3.0 source code the pizza
constructor returns a GtkWidget. Also GetHandle() returns a GtkWidget:
http://docs.wxwidgets.org/trunk/classwx_window.html#a185e6cd7065367b552748cb722651b27
2015-10-20 18:23:48 -04:00
refractionpcsx2
2a21224ab8 Merge pull request #907 from ssakash/gameDB_update
GameDB: Update compatibility status of games.
2015-10-20 22:43:30 +01:00
Akash
78890f925c GameDB: Update compatibility status of games. 2015-10-21 03:08:43 +05:30
Gregory Hainaut
796f831296 pcsx2: generate an exception when recompilation failed
Avoid the cost of checking -1 for a very rare case.

It misses currently a good fallback
2015-10-20 18:23:38 +02:00
Gregory Hainaut
5f78644bb6 Merge pull request #902 from PCSX2/convert-auto_ptr-unique_ptr
pcsx2: auto_ptr is deprecated in favor of auto_ptr
2015-10-19 15:37:35 +02:00
Gregory Hainaut
c42f46eba4 pcsx2: auto_ptr is deprecated in favor of unique_ptr 2015-10-19 13:41:34 +02:00
byehi5299
369a6a30da A few small formatting changes. 2015-10-18 22:01:30 -04:00
Gregory Hainaut
395b4c25f3 Merge pull request #899 from ssakash/gsdx_nullcheck
gsdx: use old size of target if ds and rt is null
2015-10-18 19:25:39 +02:00
Jonathan Li
26de185f54 pcsx2: Fix OpenSUSE 13.2 wx3.0 compile
I have no idea why it fails to convert the wxString to a const wxChar *.
2015-10-18 15:13:59 +01:00
Jonathan Li
7fac189ab3 spu2-x:linux: Fix potential null deference
Coverity CID 146911: Dereference before null check (REVERSE_INULL)
2015-10-18 14:01:27 +01:00
Gregory Hainaut
d5e0899955 oups collision with ref commit 2015-10-18 11:19:39 +02:00
Gregory Hainaut
f99882c61c gsdx-ogl: keep gl_ActiveTexture & gl_BlendColor (fix MS compilation)
It seems openGL ABI isn't exactly the same between Windows and my PC.
2015-10-18 11:18:19 +02:00
refractionpcsx2
42a4c7d368 GameDB: Add comment for hack required for Dakar 2 on OPM Demo Disc 33 2015-10-18 02:38:58 +01:00
refractionpcsx2
179a4cead5 GSdx: Fix compilation 2015-10-18 02:01:56 +01:00
refractionpcsx2
b132557f04 GameDB: Fixed entry for PBPX-9505, serial incorrect, updated name 2015-10-18 01:26:13 +01:00
Akash
294b8d3c6e gsdx: use old size of target if ds and rt is null
CID 146843 (#1 of 1): Dereference after null check (FORWARD_NULL)6. var_deref_model: Passing null pointer ds to GetSize, which dereferences it.
2015-10-17 22:47:44 +05:30
Gregory Hainaut
0958b9db8e gsdx-ogl: use the standard openGL name
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.
2015-10-17 17:05:15 +02:00
Gregory Hainaut
1c8f8a00b8 Merge pull request #894 from ssakash/coverity_fix
Coverity: Prevent NULL dereferences and other stuffs.
2015-10-17 16:00:28 +02:00
Gregory Hainaut
eb387e16f4 onepad: fix compilation on SDL1 2015-10-17 14:38:46 +02:00
refractionpcsx2
706bbcf8a9 IOP Counters: Silly error fixed.
-Coverity CID 152835 & 152834: The expression's value does not depend on the operands; often, this represents an inadvertent logic error.
In psxRcntWcount32(int, unsigned int): An operation with non-constant operands that computes a result with constant value (CWE-569)
2015-10-17 12:52:49 +01:00
Gregory Hainaut
4f86cca306 common: don't return a boolean for an assert
It might help to fix those 2 coverity reports.

CID 151744 (#1 of 1): Useless call (USELESS_CALL)
side_effect_free: Calling EnumAssert(id) is only useful for its return value, which is ignored

CID 151745 (#1 of 1): Useless call (USELESS_CALL)
side_effect_free: Calling EnumAssert(id) is only useful for its return value, which is ignored.
2015-10-17 11:49:04 +02:00
Gregory Hainaut
9b796d0f27 Merge pull request #892 from 3kinox/rumble_onepad
Implement rumble and isolate SDL code path
2015-10-17 11:00:06 +02:00
Akash
fedd07e4a8 gsdx: prevent a potential division by zero
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.
2015-10-17 11:26:11 +05:30
Akash
b8caab5f3d pcsx2: prevent a potential null deference
CID 146889 (#1 of 1): Dereference null return value (NULL_RETURNS)4. dereference: Dereferencing a pointer that might be null wxGetApp()->GetDisassemblyPtr() when calling update

FindWindowById returns NULL if the Window with the given id is not found, no need to do a extra check for validation of the id. also do a check for wxGetApp()->GetDisassemblyPtr() to prevent a null deference.
2015-10-17 11:26:08 +05:30
Akash
04b765a674 gsdx: check for null deference.
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()```
2015-10-17 09:14:07 +05:30
3kinox
d7155f839f onepad:
+ Implement and activate rumble.
2015-10-16 23:55:18 +02:00
3kinox
fb0d7139f2 onepad:
+ 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).
2015-10-16 23:53:51 +02:00
3kinox
9ab554af5b onepad:
+ 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.
2015-10-16 23:47:55 +02:00
Gregory Hainaut
096e5e1fef spu2x: correctly apply the volume to the external source
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.
2015-10-16 23:17:07 +02:00
Gregory Hainaut
03bc304ecf gsdx-ogl: fix colclip regression when accurate blending is enabled
Fix #865
2015-10-16 22:07:50 +02:00
refractionpcsx2
9a2212c86e IOP Counter/IRQ: Misc Counter and IRQ handling changes based on NoCash documents for PS1. 2015-10-16 00:48:26 +01:00
refractionpcsx2
d01f8f9252 VSync/EE Counters: Fixes for Fatal Fury BA 1 & Legendz Gekitou! Saga Battle
-Fix up Vsync again, broken back in google code days, broke Fatal Fury, matches PS2 test again.
-Corrected the Vsync Gate 0, which was the wrong way around, Causing Legendz Gekitou not to work unless Vsync was wrong
2015-10-16 00:38:04 +01:00
byehi5299
f7e10ed53e Rewrite of CtrlRegisterList class to enable scrolling. 2015-10-14 18:11:22 -04:00
refractionpcsx2
bbd74e5a7e Merge pull request #891 from ssakash/MicroVU_branch_addr
MicroVU: Replace BranchAddr macro with an Inline function
2015-10-13 16:36:35 +01:00
Akash
71dbe3e4c4 MicroVU: Replace BranchAddr macro with an Inline function
Coverity seems to not like the assert trick and only considers the macro as a single statement, so let's rework branchAddr and branchAddrN to satisfy coverity and improve the code quality. The following patch fixes 8 coverity issues with the same problem , CID 151736 - 151743.

(#1 of 1): Misused comma operator (NO_EFFECT)extra_comma: Part !!((mVU.prog.IRinfo.curPC & 1U) == 0U) of statement (!!((mVU.prog.IRinfo.curPC & 1U) == 0U)) , ((mVU.prog.IRinfo.curPC + 2U + (s32)((mVU.code & 0x400U) ? 0xfffffc00U | (mVU.code & 0x3ffU) : (mVU.code & 0x3ffU)) * 2 & mVU.progMemMask) * 4U) has no effect due to the comma.
2015-10-13 20:25:02 +05:30
Gregory Hainaut
4d680b73dc pcsx2 debugger: don't use erased iterator
CID 146848 (#1 of 1): Using invalid iterator (INVALIDATE_ITERATOR)
8. use_iterator: Using invalid iterator existing.

Directly edit the value through the iterator.
2015-10-13 00:17:28 +02:00
Gregory Hainaut
7c69958c92 i10n: add zh_TW 2015-10-12 23:48:02 +02:00
Gregory Hainaut
3027b4b694 pcsx2: exit function if we can't allocate an xmm register
Allocation must always succeed
2015-10-12 23:45:43 +02:00
refractionpcsx2
4560620210 GS-Wnd: Fix UI to show UI percentage. Set defaults for the title bar. Add a sort of lie mode omodec, which says you are using progressive when Interlace(Field) is active as this most isn't technically interlaced but actually half FPS, see this comment https://github.com/PCSX2/pcsx2/issues/832#issuecomment-141248883 2015-10-12 21:21:46 +01:00
refractionpcsx2
b3d9feb1f2 Merge pull request #880 from PCSX2/coverity-negative-index-array
pcsx2: forbid negative index of array in case of register allocation failure
2015-10-12 20:52:28 +01:00
Gregory Hainaut
90df78c9e0 Merge pull request #874 from pcsx2fan/master
Update GUI Translation for Chinese Traditional aka zh_TW
2015-10-12 21:47:57 +02:00
Gregory Hainaut
63889d3bea pcsx2: replace error message with a dev assert
Code mustn't be reached. Otherwise registers aren't properly freed
2015-10-12 21:38:27 +02:00
Avi Halachmi (:avih)
5379b89dbd gui: kb shortcuts: handle Sys_TakeSnapshot with shift/ctrl better
There's only one plugin api for this, but GSdx also checks whether shift/ctrl
are held down, so PCSX2 needs to map those too to the same API.

Make this more systematic by only mapping one shortcut to this API, and then
deriving the other two from it amd mapping them too automatically.

This also makes it possible to override it at PCSX2_keys.ini since now it
doesn't need to handle different shortcuts for the same function (which it still
can't handle, but now it also doesn't need to for this function).
2015-10-12 04:04:14 +03:00
Avi Halachmi (:avih)
69a978fe05 gui: kb shortcuts: yet another fix for the ini parser
Apparently I logged the values incorrectly previously. I said
that shift-q  gets parsed as Q without shift, but actually the shift flag
is set correctly on such case (though the letter is still upper case for shift-q
and it's still lower case for plain q)

So I retested all the 8 modifiers combination, and noticed that the modifiers
are always parsed and set correctly, but the letter ends up upper case if any
modifiers are used, but lower case if no modifiers are used.

We still need to make lower if it's upper, but don't need to add the shift flag.
2015-10-12 03:33:50 +03:00
Avi Halachmi (:avih)
efeb66c852 gui: kb shortcuts: fix z shortcut 2015-10-12 01:55:45 +03:00
Avi Halachmi (:avih)
a76914a4b1 gui: kb shortcuts win: faster VK to WX translation with a table 2015-10-11 20:11:33 +03:00
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
Miguel A. Colón Vélez
3dd3ed2602 Buildbot: Revert to using the sln instead of the project file.
Bot does not like using the project directly.
2015-09-26 10:49:25 -04:00
refractionpcsx2
b63590152a Vif: Fixed logically dead code (not that it mattered)
-Coverity CID 146826: In vifExecQueue(int): Code can never be reached because of a logical contradiction (CWE-561)
2015-09-26 13:55:50 +01:00
refractionpcsx2
4b63847e04 microVU: Fix logically dead code + bug
-Coverity CID 146821: In _mVUflagPass(microVU &, unsigned int, unsigned int, unsigned int, std::​vector<unsigned int, std::​allocator<unsigned int>> &): Code can never be reached because of a logical contradiction (CWE-561)

-Coverity CID 146822: In mVUcompileSingleInstruction(microVU &, unsigned int, unsigned int, microFlagCycles &): Code can never be reached because of a logical contradiction (CWE-561)
2015-09-26 13:34:20 +01:00
refractionpcsx2
a89307c5ba Vif: Fix logically dead code with something slightly quicker. Coverity CID 146827: In _vifCode_MPG(int, unsigned int, unsigned int const*, int): Code can never be reached because of a logical contradiction (CWE-561) 2015-09-26 13:00:28 +01:00
Gregory Hainaut
00e37224ed gsdx: check the return value of mkdir function
Reported by coverity
2015-09-26 13:51:23 +02:00
refractionpcsx2
457362ba84 VU Interpreter: Fix uninitialized scalar variable Coverity CID #146964. 2015-09-26 12:35:03 +01:00
micove
166818670e Merge pull request #833 from micove/Build_Bot
Simplify BuildBot and add a helper script for compilation.
2015-09-26 06:58:17 -04:00
Miguel A. Colón Vélez
f201aac946 Simplify BuildBot and add a helper script for compilation. 2015-09-26 06:27:34 -04:00
pgert
406c56e3d8 GameIndex > Added fix for the "The Incredibles" (SLUS-20905) by Prafull. 2015-09-25 22:56:04 +02:00
refractionpcsx2
931fdf0bcd Merge pull request #839 from ssakash/patch-1
MicroVU: Fix a logically dead code for XGKick Instruction
2015-09-25 21:50:10 +01:00
Gregory Hainaut
070afe57af svu: fix buffer overrun on ialu&fmac
CID 146904 (#1 of 1): Out-of-bounds write (OVERRUN)
10. overrun-local: Overrunning array VU->ialu of 8 16-byte elements at element index 8 (byte offset 128) using index i (which evaluates to 8).

CID 146903 (#1 of 1): Out-of-bounds write (OVERRUN)
10. overrun-local: Overrunning array VU->fmac of 8 32-byte elements at element index 8 (byte offset 256) using index i (which evaluates to 8).
2015-09-25 21:04:58 +02:00
Gregory Hainaut
037bd3109e pcsx2: extend the size of plugin m_info array to avoid out-of-bounds
Note: previous fix +1 wasn't enough.
2015-09-25 21:00:16 +02:00
Gregory Hainaut
78b73ba585 gsdx: avoid null pointer deferencement 2015-09-25 20:59:36 +02:00
Gregory Hainaut
421043ed12 Merge branch 'coverity-qa-extra' 2015-09-25 18:42:20 +02:00
Gregory Hainaut
927dd827ce common: make DESTRUCTOR_CATCHALL macro really exception safe
Console.Error() can trigger some exceptions (like out of memory)

v2:
Add a default fallback catch(...) in case someone badly add a new
exception in the codebase
2015-09-25 18:41:19 +02:00
Gregory Hainaut
bb6b792d06 Merge pull request #843 from pgert/master
sv_SE - update & improvements of Swedish translation.
2015-09-25 18:27:04 +02:00
Akash
ffebefb65e MicroVU: Rework a logically dead code for XGkick.
mVU_XGKICK_CYCLES can only take delay cycle values 1 and 6, it can't take NULL value. the conditional check and parameter is useless here.
2015-09-24 03:05:40 +05:30
Gregory Hainaut
2eb73644e9 pcsx2|common: use DESTRUCTOR_CATCHALL to catch exception in various destructor
Allow to print a nice error message instead of a brutal abort in case of
massive failure
2015-09-23 09:47:27 +02:00
Gregory Hainaut
0bb62bb0fd pcsx2:init IsInterpreter member in constructor 2015-09-23 09:47:27 +02:00
Gregory Hainaut
4d8a23c1fc pcsx2:gui: init all members in constructor 2015-09-23 09:47:27 +02:00
Gregory Hainaut
e41f786c72 pcsx2:gui: drop useless m_FrameCounter 2015-09-23 09:47:27 +02:00
Gregory Hainaut
5b4ba02012 pcsx2: init members in constructor 2015-09-23 09:47:27 +02:00
Gregory Hainaut
1c14389c7f pcsx2:DebugTools: init members in constructor 2015-09-23 09:47:27 +02:00
Gregory Hainaut
78ed0495ce pcsx2:CDVD: init members in constructor 2015-09-23 09:47:27 +02:00
Gregory Hainaut
8083b2c754 common: init values in the constructors of SpatialArrayReserve and pxStaticText 2015-09-23 09:47:27 +02:00
Gregory Hainaut
2c914b9b8f common:FastFormatString: remove unimplemented m_Length 2015-09-23 09:47:27 +02:00
Gregory Hainaut
a6c29a5061 common: always set a default color in trace log 2015-09-23 09:47:27 +02:00
Gregory Hainaut
3064d0c300 common: init m_handled in the SrcType_PageFault constructor
Coverity:
CID 147021 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)i
2. uninit_member: Non-static class member m_handled is not initialized in this constructor nor in any functions that it calls.
2015-09-23 09:47:27 +02:00
Gregory Hainaut
23591deb81 pcsx2: initialize members in constructor of objects 2015-09-23 09:47:27 +02:00
Gregory Hainaut
5fb8c7e65c gsdx: initialize members in constructor of objects
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].
2015-09-23 09:46:53 +02:00
Gregory Hainaut
c4a3d57499 gsdx: protect fscanf string read
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 *, ...)
2015-09-23 09:39:09 +02:00
Gregory Hainaut
7bec15b99f gsdx: remove useless condition check
Base pointer and format are always positive (unsigned int BTW) so drop
>= 0 comparison
2015-09-23 09:39:08 +02:00
Gregory Hainaut
4184d6eef5 pcsx2:cso: NULL pointer check
Coverity:

CID 146846 (#1 of 1): Dereference after null check (FORWARD_NULL)
5. var_deref_model: Passing null pointer fp to fclose, which dereferences it
2015-09-23 09:39:08 +02:00
Gregory Hainaut
b9e00ab611 i10n: update es_ES mo file. 2015-09-23 09:26:24 +02:00
pgert
d256ecb6db sv_SE - update & improvements of Swedish translation. 2015-09-22 15:44:40 +02:00
Avi Halachmi (:avih)
cee0b795ee Recording: handle cancel (at the GS[dx] dialog) gracefully
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.
2015-09-22 01:11:25 +03:00
Avi Halachmi (:avih)
4474d4391b GSdx: capture - print recomended resolution and DAR to the console
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.
2015-09-22 01:11:13 +03:00
Avi Halachmi (:avih)
3f81fc98dd gsdx: custom resolution - use 0 instead of 9 2015-09-22 01:00:53 +03:00
Jonathan Li
4208267966 gsdx|spu2-x:windows: Scale GUI logo with DPI
The SS_REALSIZECONTROL style resizes image to fit the control window, so
let's use that.
2015-09-21 20:45:50 +01:00
Jonathan Li
c088039394 gsdx:linux: Fix clang compile
Everything seems to compile and run with clang 3.7.0 now. I don't know
if clang 3.6.x works or not. 3.5.x doesn't.
2015-09-21 20:45:50 +01:00
Jonathan Li
2c2c61920e cmake: Don't add -std=c++11 to CMAKE_C_FLAGS
Fixes a cmake detection problem when compiling with clang (3.7.0 in my
case). clang outputs the error "Invalid argument '-std=c++11' not allowed
with 'C/ObjC'", which causes lzma, Xext and other things to be
considered "not found".
2015-09-21 20:45:50 +01:00
Jonathan Li
b0803a4bc6 pcsx2:debugger: Fix potential buffer overrun
CID 146914 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)

The overflow can be triggered using the Debugger's Rename Function
feature.
2015-09-21 20:44:46 +01:00
Jonathan Li
39c5cd4f84 pcsx2:cdvd: Fix memleak
CID 146832 (#4-1 of 6): Non-array delete for scalars (DELETE_ARRAY)

ScopedPtr is for non-array objects only. Use ScopedArray instead.
2015-09-21 20:13:55 +01:00
Jonathan Li
69d27dfb4b Merge pull request #829 from ssakash/rework_internalres
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
2015-09-21 20:12:47 +01:00
Gregory Hainaut
130a84d2af pcsx2:debugger: miss a coma
Thanks RebelliousX
2015-09-21 09:32:13 +02:00
Gregory Hainaut
d42cef891c gsdx: remove ALIGN_STACK feature on GCC
Stack is already aligned correctly. Besides GCC optimizes the variable so it doesn't
have any effect except that it generates useless warnings.
2015-09-20 22:19:45 +02:00
Gregory Hainaut
9b69afe541 gsdx-ogl: typo that broke TC offset hack 2015-09-20 22:19:45 +02:00
Gregory Hainaut
b60dd9d1fe Merge pull request #814 from PCSX2/coverity-qa-high
Fix a bunches of coverity warning/errors.
2015-09-20 22:18:03 +02:00
Avi Halachmi (:avih)
94c5eab776 GSdx: capture dialog - actually remember the last used codec
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.
2015-09-20 20:04:36 +03:00
Jonathan Li
d4f6894e1b gsdx: Fix custom resolution and minor cleanup
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.
2015-09-20 07:49:46 +05:30
Gregory Hainaut
28191baa80 gsdx-linux: merge native/upscaling/custom into a single box 2015-09-20 07:49:44 +05:30
Akash
a9b0cfc519 GSDX: Add 8X native to Internal resolution. 2015-09-20 07:49:32 +05:30
Admiral H. Curtiss
051a7f3451 FolderMemoryCard: Handle empty files on load and write 2015-09-20 01:13:54 +03:00
avih
56452481e2 Merge pull request #834 from PCSX2/gsdx-prog-rec
GSdx: recording: Progressive: make the recorded clip play at full speed
2015-09-19 04:46:05 -07:00
Avi Halachmi (:avih)
54afd377ee GSdx: recording: Progressive: make the recorded clip play at full speed
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
2015-09-19 14:44:48 +03:00
Avi Halachmi (:avih)
ddb87027f9 folderMemoryCard: hack - don't call hundreds of times per second
In order to flush data with some delay after save-to-memory-card, the code was
calling sioNextFrame() on each frames (60 times/s) continuously as long as the
emulation is active, regardless if FMC is in use or if memory cards in general
are in use.

Further to that, each call to sioNextFrame calls 8 times into the memory card
plugin even if FMC is not in use, resulting in overall ~500 calls/sec with the
sole goal of facilitating delayed flush after MCD save with folder memory cards.

This patch is a hack to call it once per second instead of 60 per second, but we
need to remove this call completely.

The delayed flush will now happen after 60-120 frames instead of exactly 60.
2015-09-19 13:41:24 +03:00
Avi Halachmi (:avih)
ef9016e363 folderMemoryCard: hack - don't hang PCSX2 if a file has zero size
I'm not sure if it breaks the state of the folderMemoryCard (FMC) or not, but
at least it doesn't hang PCSX2.

Might need followup to make sure the state ends up valid.
2015-09-19 13:36:49 +03:00
Jonathan Li
e576f259e4 Merge pull request #807 from turtleli/windows-dpi-image-scaling
Scale images according to DPI (Windows)
Partially fix theming
2015-09-19 10:31:53 +01:00
Avi Halachmi (:avih)
f5a38ab954 gameindex.dbf: update compatibility from the forum: 31 better, 1 worse 2015-09-18 15:06:25 +03:00
Avi Halachmi (:avih)
dfe08e3c96 gameindex.dbf updater: slightly more verbose by default
Now also summarizes regions by default and also lists compatibility improvements
by default (both can be configured to be silent).
2015-09-18 15:02:23 +03:00
pgert
9eb5f36ecc Specifications & Corrections of PAL languages in GameIndex.
What this PR primarily does is to sort out the PAL-E mess.
Some have used PAL-E for Englsh, others for Europa (PAL-M5), and others still for España.
With this PR all PAL-E should refer to English, while the ones referring to Europa have PAL-M5 or something as a code, and the ones referring to España have PAL-S as a code.

Generally only one letter is used for the more common languages; English etc.
So is the case in this PR.

For some PAL-M2 entries in particular, though maybe also for some PAL-M3 entries, there can be 2 or more discs of the same game having this code; it's not necessarily a disc specific code - it only tells how many languages the disc supports.
So is the case in this PR.

Language codes used:
E - English
G - German
I - Italian
S - Spanish
F - French
P - Portuguese
R - Russian
DU - Dutch
NO - Norwegian
SE - Swedish
DA - Danish
FI - Finnish
CZ - Czech
PL - Polish
HR - Croatian
HI - Hindu
2015-09-18 13:46:44 +03:00
Avi Halachmi (:avih)
ece9c7f2d2 GS window title: remove "align" space at fps value.
This value doesn't fluctuate frequently between 2/3 digits, so there's no need
for alignment, and it also saves some space most of the time.
2015-09-17 05:32:15 +03:00
Avi Halachmi (:avih)
a6737b87fd Custom frame rate: improve message, respect also for NTSC-progressive
When a custom PAL/NTSC frame rate is used, PCSX2 respects it for PAL and NTSC,
but disrespected it for NTSC-progressive mode (used hardcoded 30/60). Fixed.

Also, when a custom rate was used, the console message displayed half the rate
which was configured. Now print the actual rate.
2015-09-17 01:40:05 +03:00
avih
ca5e9d872f Merge pull request #827 from ssakash/patch-2
GS window title: Add speed in percentage and make it the main speed value
2015-09-16 15:38:25 -07:00
Akash
304fc990a1 PCSX2: Add Percentage Counter for FPS.
The FPS has been Indicated in Paranthesis whereas Speed would provide the Integer percentage value based on the FPS limit for NTSC, PAL games. (59.94, 50)

Thanks to avih for the suggestions.
2015-09-17 03:59:48 +05:30
Avi Halachmi (:avih)
d10bbb73f7 FixedInt - round instead of truncate on construction
This could have caused issues where e.g. Fixed100(59.94) differed from
Fixed100::fromString("59.94") due to precision compilation flags
(the former could, and did on Devel builds, end up with Raw == 5993, which
differs from the value constructed from the string at the ini file,
and then it would be incorrectly identified as a custom rate).

Rounding seems the more likely intention when effectively decreasing the
precision of a value.

Unlikely that we have code which depends on truncating behavior, though not
impossible.
2015-09-17 00:30:08 +03:00
Gregory Hainaut
2d97f6dd53 Merge pull request #823 from IlDucci/master
Updating Spanish translation
2015-09-15 10:31:46 +02:00
Jonathan Li
f8104137ce Merge pull request #821 from turtleli/fix-linux-aligned-realloc
Fix _aligned_realloc implementation on linux
2015-09-14 22:51:07 +01:00
IlDucci
d78dd0c8d0 Updating Spanish translation
Fixed the SSE2 strings, rewrote other ones. Adding colons where needed.
2015-09-14 12:55:26 +02:00
IlDucci
e11cc951de Merge remote-tracking branch 'PCSX2/master' 2015-09-14 12:21:07 +02:00
Akash
b97018932d GSDX: Rework Internal Resolution function
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.
2015-09-14 10:26:27 +05:30
Jonathan Li
67dc65ea91 linux: Fix _aligned_realloc implementation
Out-of-bounds memory is no longer accessed if the realloc size is larger.
If reallocation fails, the old memory will not be freed and a memcpy
will not take place.

This should match the Windows _aligned_realloc behaviour, except that an
extra parameter is used.
2015-09-13 21:05:33 +01:00
Miguel A. Colón Vélez
4760d71a86 Remove the remaining postbuild stuff.
The bot should work now.
2015-09-13 04:33:17 -04:00
Pistachioman
3df5c2835e Remove useless postBuild stuff 2015-09-13 04:31:41 -04:00
micove
f062b0f671 Merge pull request #818 from micove/Linux_Segfault
Linux: Fix segmentation fault with the new libstdc++ ABI.
Closes #780
2015-09-13 00:31:09 -04:00
Miguel A. Colón Vélez
f1cb2cfa35 Fix segmentation fault with the new libstdc++ ABI.
Local variable goes out of scope and everything goes boom.
2015-09-12 17:35:45 -04:00
micove
53680d538d Merge pull request #817 from micove/GIT_TZ
Fix git version detection.
2015-09-12 06:33:00 -04:00
Jonathan Li
5c6915f633 utilities: Simplify _aligned_malloc wrapper
Windows doesn't actually use it at all, so let's exclude it from the
VS build. Also include ScopedAlloc.h into the VS project file.
2015-09-12 10:01:04 +01:00
Jonathan Li
8312e21f00 utilities: Cleanup unused memcpy defines
All refer to memcpy, and only memcpy_fast is used, so there's no point
keeping them.

Also remove the _memset16_unaligned function prototype since there's no
function definition for it.
2015-09-12 10:00:49 +01:00
Jonathan Li
239306e9a2 pcsx2|gsdx:linux: Fix posix_memalign
The AddressSanitizer can be used on Linux again. Well, PCSX2 doesn't get
very far when it's used though.
2015-09-12 09:58:00 +01:00
Miguel A. Colón Vélez
49072d6e02 Fix git version detection
- It currently fails to detect a 64bit git.
- It currently breaks with a TZ left of the Greenwich meridian.
- The output of git show -s can cause compilation errors pipe to NUL.
- Pipe the two can't find the git command error messages to NUL too.
2015-09-11 19:20:23 -04:00
Gregory Hainaut
fc67e372d2 pcsx2:gui: fix potential infinite loop 2015-09-11 21:01:23 +02:00
Gregory Hainaut
0422854384 pcsx2:interpreter: always false condition
Both fields are 10 bits but the ~ operation apply on the 32 bits.
Therefore msb bits were always '1' and the condition always false.

Code is only used on the interpreter but it could explain some hangs
2015-09-11 20:01:01 +02:00
Gregory Hainaut
bfe1236d98 pcsx2|lilypad: Unintentional integer overflow
Add some cast to do the intermediate operation in 64 bits
2015-09-11 16:50:02 +02:00
Gregory Hainaut
0a7eed686c Merge pull request #763 from PCSX2/gsdx-texture-format
Gsdx improves texture format setup
2015-09-11 14:44:31 +02:00
Gregory Hainaut
cee0fde940 gsdx-tc: improve support of TEXA register
* 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.
2015-09-11 14:16:11 +02:00
Gregory Hainaut
78569ee833 gsdx-ogl: redo properly the setup of texture format
* 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
2015-09-11 14:14:22 +02:00
Gregory Hainaut
6c7ce3465e pcsx2:CDVD: guarantee that index of mg_zones array is below than 8
CID 146917 (#1 of 1): Untrusted array index read (TAINTED_SCALAR)
tainted_data: Using tainted variable cdvd.Result[1] as an index into an array mg_zones
2015-09-11 09:25:09 +02:00
Gregory Hainaut
8928c3e7f1 onepad: be sure pad variable is 0 or 1
CID 146918 (#1 of 1): Use of untrusted scalar value (TAINTED_SCALAR)
tainted_data: Passing tainted variable pad to a tainted sink
2015-09-11 09:18:49 +02:00
Gregory Hainaut
113c0aa411 pcsx2: use sizeof of object instead of pointer (portability)
CID 146912 (#1 of 1): Sizeof not portable (SIZEOF_MISMATCH)
suspicious_sizeof: Passing argument recConstBuf of type u32 * and argument 131072U /* RECCONSTBUF_SIZE * sizeof (recConstBuf) */ to function memset is suspicious. In this case, sizeof (u32 *) is equal to sizeof (u32), but this is not a portable assumption.
2015-09-11 08:54:29 +02:00
Gregory Hainaut
2430abed33 gsdx: potential division by zero
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.
2015-09-11 08:54:29 +02:00
Gregory Hainaut
e6d1a4cccf gsdx: avoid a potential division by zero
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
2015-09-11 08:54:29 +02:00
Gregory Hainaut
2934a15902 gsdx: remove a duplicated check 2015-09-11 08:54:29 +02:00
Gregory Hainaut
f092f9045c pcsx2: initialize the block pointer
There is a check on it on the resize function
2015-09-11 08:54:29 +02:00
Gregory Hainaut
ac8f4e69d6 pcsx2|gsdx: avoid potential null deferencement 2015-09-11 08:54:29 +02:00
Gregory Hainaut
0260c9119e common: suspicious missing comma 2015-09-11 08:54:29 +02:00
Gregory Hainaut
1baa6be6de debugger: enforce a null terminated char of a C-string
CID 146728 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)
buffer_size_warning: Calling strncpy with a maximum size argument of 128 bytes on destination array mod.name of size 128 bytes might leave the destination string unterminated
2015-09-11 08:52:05 +02:00
Gregory Hainaut
b082147c4d onepad: avoid potential resource leak 2015-09-10 14:21:27 +02:00
Gregory Hainaut
f4f08b9c99 pcsx2: avoid couple of out-of-bounds access 2015-09-10 14:20:51 +02:00
Gregory Hainaut
c687c73edd pcsx2:debugger: avoid strlen call on random data 2015-09-10 13:46:36 +02:00
Gregory Hainaut
0bcaff4214 pcsx2:cdvd/debug: various uninitialized data
Most of the time, code is correct. In doubt always init the value.
2015-09-10 13:45:42 +02:00
Gregory Hainaut
5e8f899620 pcsx2:debug: miss a break that lead to a mem leak 2015-09-10 13:42:23 +02:00
Gregory Hainaut
5c933a7faf pcsx2:gzip: free the index
Normally index will be NULL if len is 0 but it won't hurt
2015-09-10 13:41:22 +02:00
Gregory Hainaut
8b2de15096 build: add an option to build a coverity DB 2015-09-10 13:40:45 +02:00
refractionpcsx2
2a8bae187f Merge pull request #811 from micove/GSdx_Debug
Rename Release/Debug SSE2 to Release/Debug.
2015-09-09 23:28:05 +01:00
Miguel A. Colón Vélez
26e2b4a5be Rename Release/Debug SSE2 to Release/Debug. 2015-09-08 23:17:07 -04:00
Jonathan Li
d8a7bfd438 gui: Adjust mainframe size and status bar position
There are a few odd things with Windows and the background logo.
1. The windows containing the logo is smaller than the logo.
2. The fitting algorithm doesn't work at 200% DPI.

Both make no sense, but can apparently be worked around.
2015-09-08 18:47:45 +01:00
Jonathan Li
bcc125ceb6 gui:windows: Implement image DPI scaling
This should reproduce the old non-DPI aware pre-wxWidgets 3.0 behaviour
for the main dialogs, except the font rendering should be better.

And add comments that I should have already added but didn't.
2015-09-08 18:47:44 +01:00
Jonathan Li
59ffed85ba gui: Fix image list scaling
The listbook images aren't rescaled unless the embedded icons are used.
Make sure all the images are correctly rescaled.
2015-09-08 18:27:48 +01:00
Jonathan Li
5cf94e5a15 gui: Allow screenshot icon to be themed.
The logo and all the other icons can apparently be themed (though
theming is a bit broken). Let's allow the camera screenshot to be
themed as well.
2015-09-08 18:27:48 +01:00
Jonathan Li
2263961d4d gui: Simplify and rework EmbeddedImage class
The wxImage Scale/Rescale methods with wxIMAGE_QUALITY_HIGH upsamples
and downsamples using the bicubic and box resampling methods
respectively, so let's just use that instead of the ResampleBox method,
which is undocumentated and probably shouldn't be used.

The Rescale function also modified the image when it was not supposed
to. Fix it, and rename it scale to avoid confusion with the wxWidgets
class.
2015-09-08 18:27:48 +01:00
Gregory Hainaut
ddc03cbccf gsdx: add a nice enum to replace the hardcoded convert shader 2015-09-08 16:51:24 +02:00
Gregory Hainaut
1ae0fed83b gsdx: fix a regression due to the shader renaming 2015-09-08 16:06:15 +02:00
Gregory Hainaut
81e056e79a gsdx: always enable the boost queue
ifdef was for VS2010

GSThread.h is useless. I keep it for the transactional queue implementation
2015-09-08 14:43:09 +02:00
Gregory Hainaut
3706cfe908 gsdx: always enable CXX11 mutex feature.
ifdef was only useful for VS2010
2015-09-08 14:34:17 +02:00
Gregory Hainaut
ca9b5ce11d gsdx-ogl: move depth conversion shader
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
2015-09-08 12:41:05 +02:00
Gregory Hainaut
4eed4ca3a1 gsdx-debug: restore 16 bit dump format in the SW renderer
Actually dump both 32/16 bits (former for texture shuffle and later
for real 16 bits RT)
2015-09-08 12:41:05 +02:00
Jonathan Li
9d4a8688c1 Merge pull request #801 from turtleli/windows-left-list-icons
Have listbook icons (Emulation Settings, Plugin BIOS selector) on the left for all platforms.
Don't set minimum widths for Framelimiter and Frameskip panels.
2015-09-07 08:46:49 +01:00
Jonathan Li
1d2d8cd38b gui: Don't set min widths for Framelimiter/skip panels
It causes weird behaviour at higher DPIs.
2015-09-07 08:26:20 +01:00
Jonathan Li
5e9ba64db8 gui: Have listbook icons on left for all platforms
On Windows, this fixes the minimise/restore weird dialog bug on the
Emulation Settings and Plugin/BIOS selector dialogs. It also fixes a bug
at high DPI, where it becomes difficult to click on GUI elements at the
top of the dialog.

It also makes it easier for me to work on the Windows DPI stuff, I don't
have a 4k monitor.
2015-09-07 08:25:56 +01:00
Jonathan Li
ca0aeb8e62 Windows: Avoid lockup for RuntimeError exception
This is the same problem that the Plugin Open and BIOS load exceptions
had - The message box pops up, intercepts the hide event for GSFrame and
leaves you with no alternative but to terminate PCSX2 via the Task
Manager.

The same solution applies - Close the GSFrame first.
2015-09-06 20:36:19 +01:00
Jonathan Li
d87b34ab36 gui: Increase presets message width
This prevents clipping at 200% DPI on Windows.
2015-09-05 23:10:15 +01:00
Jonathan Li
e2f1bafeef gui:windows: Fix tooltip wrapping
wxWidgets 3.0 now wraps tooltips automatically on Windows, so the custom
tooltip wrapping functionality is no longer necessary.
2015-09-04 22:54:11 +01:00
Jonathan Li
31a505768d gui: Use SetSizerAndFit after dialogs are constructed.
It seems to fix the button UI problem for Linux wx3.0 builds.
2015-09-04 17:58:25 +01:00
Jonathan Li
9052930ebc Merge pull request #791 from turtleli/gsdx-gui-changes
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.
2015-09-03 22:49:41 +01:00
Jonathan Li
2b6d44a043 gui: Fix Emulation Settings dialog, GS section
Expand "Disable Framelimiting" and "Synchronised MTGS". Fixes message
truncation on Linux, and Windows at higher DPI.

Don't use pxFitDigits on Spin Controls - the sizing algorithm fails
horribly on GTK3, which means you can't see anything.

And don't use a row of spacers - it causes a minor display issue with
GTK3.
2015-09-03 17:22:12 +01:00
Jonathan Li
288931ddc3 Merge pull request #781 from ssakash/patch-49
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.
2015-09-02 21:51:04 +01:00
Akash
b5aceceef2 don't minimize GS window along with main window.
previously the GS window (rendering window) also gets minimized with the Main window (GUI) whenever it gets minimized. many users didn't like this behavior, hence make it so that GS window doesn't get minimized along with the main one.

The parent window pointer parameter is no longer needed, since the parent parameter at WX Frame has been replaced with Null which doesn't force minimize it due to no parent relationship.
2015-09-02 08:27:18 +05:30
Akash
8ebe03a89d MicroVU: use DevCon.Warning for E-bit delay slot.
The following E-bit delay slot warning initially used a console error message which has a sort of bright red which would cause users to provide a lot of attention towards to it, whereas it isn't much to be bothered since it doesn't cause any issues on the game according to refraction it was already dealt with on the code.

So, use a proper warning indicator instead of a error log message.
2015-09-02 08:27:15 +05:30
Jonathan Li
e5f045c375 gsdx: Add new tooltips and descriptions.
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.
2015-09-01 19:25:28 +01:00
Jonathan Li
55adc7e728 gsdx: tooltip description formatting and minor fixes
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.
2015-09-01 19:25:27 +01:00
Jonathan Li
b687b106f1 gsdx: Removed unnecessary defines and functions
The changes to the Hacks dialog removes the need for these defines.

Also remove the swap_state function since it's now unused.
2015-09-01 19:25:26 +01:00
Jonathan Li
c72b4d6e8a gsdx:windows: Rework hacks dialog to use tooltips
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.
2015-09-01 19:25:26 +01:00
Jonathan Li
fcc8a941b0 gsdx:windows: Redo main 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.
2015-09-01 19:25:25 +01:00
Jonathan Li
e6b9805167 gsdx:windows: Show tooltips on main dialog 2015-09-01 19:25:25 +01:00
Jonathan Li
48bba4d581 gsdx:windows: Add tooltip support
Tooltips will be usable for all Gsdx dialogs if required.
2015-09-01 19:25:24 +01:00
Jonathan Li
9929962d54 gui:windows: Scale settings dialog widths with DPI
Height is calculated automatically, so that's sort of ok. A lot more
fixes will be needed to fix the rest of the DPI stuff.
2015-09-01 18:25:19 +01:00
Jonathan Li
149b7fc347 gui: Fix Windows screenshot workaround comment.
It's an actual wx3.0 bug, not a bug in dialog construction.
2015-09-01 18:14:03 +01:00
Jonathan Li
cc1d50a06c gui:windows: Show tooltips for as long as possible.
It'll show for 32.767s. Windows unfortunately doesn't have an infinite
value, and also uses a signed 16-bit integer for the delay.
2015-09-01 18:14:03 +01:00
Miguel A. Colón Vélez
4a743ac2fb Remove Dependency and UAC info from the manifest file.
Visual Studio adds the dependency info automatically and /MANIFESTUAC
adds the UAC part.
2015-08-31 21:03:53 -04:00
micove
287672d3c1 Merge pull request #795 from micove/Recognize_Win8-10
Recognize Win 8, 8.1 and 10.
2015-08-27 08:36:10 -04:00
Miguel A. Colón Vélez
f29dd8b927 Fix Windows XP Home vs Pro detection.
VER_SUITE_PERSONAL is set for XP Home therefore the check was backwards.
2015-08-26 16:02:26 -04:00
Miguel A. Colón Vélez
45fc9603e3 Recognize Win 8, 8.1 and 10.
https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241(v=vs.85).aspx
Windows 8.1 and 10 require a manifest file or they will be reported as
6.2 which is Windows 8.
.
Also add the information for Win 8, 8.1 and 10 in the WinMisc.cpp file.
2015-08-25 21:30:27 -04:00
micove
9e7a2bf1b9 Merge pull request #792 from micove/Update_Pthreads291
Update pthreads to 2.9.1
2015-08-25 13:59:02 -04:00
Gregory Hainaut
bdc8038e7e glsl: set a size to gl_ClipDistance array
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.
2015-08-25 18:58:39 +02:00
Gregory Hainaut
a1957a685d glsl: drop an useless min in FS
GPU will clamp color anyway. It reduces the number of instruction of 25% (4->3)
2015-08-25 18:58:39 +02:00
Miguel A. Colón Vélez
c97c4f878a Update pthreads project.
- Add x64
- Use static library
2015-08-25 09:53:00 -04:00
Miguel A. Colón Vélez
05500bf759 Add local pthread changes.
- Move the 3 public headers to a include directory.
  + pthreads ships a config.h therefore leaving them in the top dir
    pollutes the include path.
- Starting with VS2015, MS defines timespec. Declare to only have it
  if _MSC_VER >= 1900.
- On Linux pthread_t is an integer and you can easily do ==. On Windows
  pthread_t is a structure and ==/!= have to be overloaded or every use of
  those operator must be guaded with #ifdef's.
2015-08-25 09:51:16 -04:00
Miguel A. Colón Vélez
70aba9d3ff Update pthreads to 2.9.1
- It adds support for x64.
2015-08-25 09:00:12 -04:00
Jonathan Li
6b11497cdc Don't log errors when initially setting the default language
The PCSX2 log system isn't in place yet, so on Windows it's possible for
a language error message to pop up, which might cause alarm. Suppress
the error - it's harmless and it's done everywhere else for locales
(though perhaps the code should be reworked to avoid this).
2015-08-24 19:17:59 +01:00
Jonathan Li
995a09a2a6 gui: Use full dialog width for Enable Speedhacks text
The "Enable Speedhacks" description on the Emulation Settings dialog
now uses the entire dialog width instead of word wrapping at the
half-way point.
2015-08-24 15:43:48 +01:00
micove
94d8d3217c Merge pull request #767 from charliebruce/master
Improve nVidia Optimus and AMD PowerXpress compatibility
2015-08-24 08:15:20 -04:00
Charlie
37cfdf6fe2 Request the use of the high-performance graphics card on systems where
multiple graphics processors are available (nVidia Optimus, AMD Hybrid
Graphics).
2015-08-24 12:35:08 +01:00
Jonathan Li
48745a3bc5 Ignore "Do not show dialog again" checkbox when cancelled
It's undesirable to not be able to reboot or change plugin if you
checked the checkbox and then pressed Cancel.
2015-08-23 23:35:13 +01:00
Jonathan Li
3f39741d0a Remove do not show checkboxes from swap/reset dialogs
It didn't make any sense to have them there.
2015-08-23 23:35:12 +01:00
refractionpcsx2
1800770c94 Merge pull request #789 from AdmiralCurtiss/memcard-filter-dont-load-root-files
FolderMemoryCard: Don't load files in the root dir when filtering.
2015-08-23 19:10:04 +01:00
Jonathan Li
6f6a7b92e4 gsdx:windows: Move CRC box to main dialog
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.
2015-08-23 14:04:09 +01:00
micove
e65a223c91 Merge pull request #790 from micove/Update_3rdparty
Update some of the 3rd party libraries.
2015-08-23 08:31:49 -04:00
Miguel A. Colón Vélez
9565aaf469 Backport wx30 fix for VS2015.
This is commit f350babf36818ba805ab0b4510b6616aaf3063fc.
.
Reading "Please update wx/compiler.h to recognize this VC++ version" gets
old pretty quickly.
2015-08-22 10:30:11 -04:00
Admiral H. Curtiss
5ffc6e0558 FolderMemoryCard: Don't load files in the root dir when filtering.
No official game stores files there. You can easily check this by putting any file in the root dir and loading the PS2 BIOS, which will show it as corrupted data with an unknown filesize.
2015-08-22 16:27:29 +02:00
Miguel A. Colón Vélez
09c8a41294 Update SoundTouch to 1.9.0.
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.
2015-08-22 10:16:27 -04:00
Gregory Hainaut
bfadd884c9 glsl: expand tab into space
The mix of the 2 was awful
2015-08-22 13:34:02 +02:00
Gregory Hainaut
a46c11b088 gsdx-ogl: delete various leftovers 2015-08-22 13:33:32 +02:00
Gregory Hainaut
7002ff3ec3 gsdx-ogl: move texture scale from vs_cb to fs_cb
It avoid useless update of the vs_cb.
2015-08-22 13:33:04 +02:00
Miguel A. Colón Vélez
9f2642a714 Update glext.h to the latest version. 2015-08-22 07:00:56 -04:00
Miguel A. Colón Vélez
3ef69c7fe9 Update zlib 1.2.7 to 1.2.8.
There were no local changes done to zlib.
.
The examples were added later and are from 1.2.8.
.
This syncs the library to the examples.
2015-08-22 06:27:07 -04:00
Gregory Hainaut
499206f0ea gsdx-ogl: disable advance rendering when drivers don't support it 2015-08-22 12:22:35 +02:00
Gregory Hainaut
d9cf326879 gsdx: windows requires a static cast 2015-08-22 12:22:35 +02:00
Miguel A. Colón Vélez
5761e475ee Update bzip from 1.0.4 to 1.0.6.
- Only adds 2 security fixes.
- Add the CHANGES file.
- Add local changes:
  + setmode to _setmode
  + fileno to _fileno
  + fdopen to _fdopen
- sudonim1 removed all trailing whitespaces in svn2897 so I ran:
find . -type f -name '*.c' -o -name '*.h' | xargs sed -i 's/[[:space:]]\+$//'
  This makes the delta of changes smaller.
2015-08-22 05:57:20 -04:00
micove
8223b09f60 Merge pull request #786 from Pistachioman/lilyxinput
Avoid potential header clash between DirectX' and lilypad's xinput.h
2015-08-22 05:14:49 -04:00
Pistachioman
a002e5ff0a Avoid potential header clash between DirectX' and lilypad's xinput.h 2015-08-21 16:44:21 +02:00
Jonathan Li
6e826d5193 Merge pull request #754 from ssakash/patch-45
gsdx: little changes on AF value behavior.
2015-08-21 11:29:49 +01:00
Akash
111653833f AF checkbox status depends on paltex.
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.
2015-08-21 15:50:13 +05:30
Akash
3c9ca799a6 Remove anisotropic filtering checkbox value.
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.
2015-08-21 09:45:00 +05:30
Jonathan Li
55eebb5fd2 Fix cheats path and folder creation
For the install version on Linux, PCSX2 now searches for cheats in $HOME
instead of /usr. For the install version on Windows, PCSX2 now searches
for cheats in Documents/PCSX2 instead of the cheats directory where
PCSX2 is installed.

Also make a few small consistency changes.
2015-08-21 00:14:49 +01:00
refractionpcsx2
60a90aa51c GSdx-dx11: Another attempt at the nvidia hack, changing the viewport top left slightly also seems to alleviate the issue. Lets see how well this goes down.
At worst things will look zoomed out by like, a pixel :P
2015-08-20 23:45:26 +01:00
Gregory Hainaut
d2e4dac9ab Merge pull request #782 from PCSX2/gsdx-texture-format-v2split
Improve GSdx texturing
2015-08-21 00:42:56 +02:00
Jonathan Li
579507a6d1 Merge pull request #783 from jobermayr/master
Fixes wx2.8. Mkdir() doesn't allow const qualifier [-fpermissive]
2015-08-20 23:18:50 +01:00
Gregory Hainaut
37f9bcf9cb gsdx-ogl: reduce state change
* don't dirty aref when a fog color is uploaded
* only set clamp mode in clamp mode (region clamp is handled in shader)

v2: fix SSE2/3 compilation
2015-08-20 23:01:43 +02:00
Gregory Hainaut
c5a786ed2c gsdx-ogl: remove support WMS/T == 2 in hardware unit
I think behavior was wrong because only first texel coordinate was clamped.

Beside we can't interpolate if AEM isn't yet applied
2015-08-20 23:01:43 +02:00
Gregory Hainaut
53d1fdd8f1 glsl:debug: disable fst when testing texturing shader
Reduce clutter in ASM dump
2015-08-20 23:01:43 +02:00
Gregory Hainaut
78dd957717 gsdx-ogl: use normalized index coordinate for palette texture
In palette mode, 90% of texture accesses are done in 8 bits.
So let's keep this path as light as possible. It reduces GPU load.
2015-08-20 23:01:43 +02:00
Gregory Hainaut
42c08e6123 gsdx-debug: infinite replay for value > 90
Allow to use Nvidia debugger & give time to see the glitches
2015-08-20 23:01:20 +02:00
Johannes Obermayr
a0527fc53b Mkdir() doesn't allow const qualifier [-fpermissive]
Fixes: error: passing 'const wxFileName' as 'this' argument of 'bool wxFileName::Mkdir(int, int)' discards qualifiers [-fpermissive]
2015-08-20 22:35:20 +02:00
Akash
1039df5077 Fix Vista volume control on Lilypad. 2015-08-20 21:41:05 +05:30
refractionpcsx2
9f291a6666 Merge pull request #776 from micove/Fix_Bot
Windows: Fix bot
2015-08-19 23:47:02 +01:00
Miguel A. Colón Vélez
a5a510656f x86emitter requires the setup.h generated by wx.
Build wx30config before x86emitter.
2015-08-19 18:28:42 -04:00
refractionpcsx2
561fa8a95e GSdx-dx: Workaround for NVidia Win10 Issues, possibly? at least seems to fix it.. 2015-08-19 23:01:39 +01:00
Jonathan Li
70990002d8 debugger: Fix Assemble Opcode functionality
For some reason it was working in wx2.8 with a GetLabel(). Strange that.
2015-08-19 19:17:20 +01:00
avih
b55d6539b5 Merge pull request #773 from micove/Fixes_MSVS
Visual Studio: Fixes for Compilation
2015-08-19 10:59:35 -07:00
Miguel A. Colón Vélez
96df56ca8e VS2015: Fix Devel. 2015-08-19 13:31:56 -04:00
Miguel A. Colón Vélez
157565eaa0 Remove extra debug configurations from sln.
Removed
- Debug SSE2 (same as Debug)
- Debug SSSE3
- Debug SSE4
- Debug AVX
- Debug AVX2
- Release SSE2 (same as Release)
.
I also checked the x64 part and made sure no skips and
Debug/Devel/Release used the correct configurations.
.
GSdx can still be compiled with these debug flavors but requires
to manually select them.
2015-08-19 11:59:47 -04:00
Miguel A. Colón Vélez
fd78b7bbf8 ZeroGS: Add 61 missing symbols.
Apparently only Debug/Devel require
- comctl32.lib
- RpcRT4.lib
- pthreads.lib
2015-08-19 11:08:24 -04:00
Miguel A. Colón Vélez
6cddd04518 old_plugins: Remove unused configurations + more.
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.
2015-08-19 09:35:21 -04:00
Gregory Hainaut
03ee62971e Merge pull request #689 from micove/Update_gitignore
Update .gitignore file.
2015-08-19 14:10:15 +02:00
Miguel A. Colón Vélez
3193eb5106 Update .gitignore file.
- 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.
2015-08-19 07:45:02 -04:00
Miguel A. Colón Vélez
69b056e121 Devel: Don't mix Devel with Debug.
Devel uses /MD
Release uses /MD
Debug uses /MDd
.
Don't mix /MD with /MDd.
2015-08-19 07:11:49 -04:00
Miguel A. Colón Vélez
fd813a002c Lilypad: Fix compilation error in Debug target.
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.
2015-08-19 05:37:14 -04:00
Miguel A. Colón Vélez
b07608d438 Debug: Make sure everything builds using Debug.
Skipped: 45
Release to Debug: 6
2015-08-19 02:07:36 -04:00
Miguel A. Colón Vélez
683c003622 Add Debug target for CDVDnull.
It's the only one w/o it.
2015-08-19 01:38:36 -04:00
Miguel A. Colón Vélez
dab37e0fe2 MSVS: Compile all plugins. Missing 7. 2015-08-18 23:32:00 -04:00
Pistachioman
223eb44f19 Don't use ASIO in release builds of portaudio
Just like in Debug and Devel builds

Conflicts:
	pcsx2_suite_2013.sln
2015-08-18 23:21:14 -04:00
Avi Halachmi (:avih)
4dd53a732f .gitignore: add another auto-generated instance of rcdefs.h 2015-08-18 22:48:17 +03:00
Avi Halachmi (:avih)
fd7d05d003 cheats_ws: 1938 widescreen patches (176 new, 1 removed, 33 modified)
and 1729 patches remain identical.

Updated to Devina's latest archive (2015-08-18), with 3 WIP patches removed
(1771BFE4, C77AF2CA, DA3DD765).

See:
- http://forums.pcsx2.net/Thread-PCSX2-Widescreen-Game-Patches?pid=476028#pid476028
- http://forums.pcsx2.net/Thread-PCSX2-Widescreen-Game-Patches?pid=271674#pid271674
2015-08-18 22:00:41 +03:00
Gregory Hainaut
6b84a89b6a gsdx-ogl: remove old ati hack for point sampler
Was never used on openGL

In the future absolute coordinate will be use anyway
2015-08-18 19:09:45 +02:00
Gregory Hainaut
ed21d88735 gsdx-ogl: add support of Intel GPU on Windows
It requires at least an Ivy Bridge GPU.
2015-08-18 19:06:43 +02:00
refractionpcsx2
8539805691 Merge pull request #690 from micove/VS_universal_sln
VS Now uses a universal solutions file - VS 2012 and below dropped due to incompatibility with C++11
2015-08-18 11:40:53 +01:00
refractionpcsx2
a4f8c6d5b3 Merge pull request #770 from micove/Lintian_Fixes
Fix things found using lintian by micove. Grammatical changes only.
2015-08-18 10:19:37 +01:00
Gregory Hainaut
37661f3a86 gsdx-ogl: fix blending regression (VP2)
Negative factor must be disabled in negative accumulation "-Cs*As + Cd"
Shader must output Cs*As and blending unit will do the Cd - C subtraction
2015-08-18 09:14:11 +02:00
Miguel A. Colón Vélez
961e0b5d28 Remove wx2.8 from the 3rdparty folder. 2015-08-18 01:16:59 -04:00
Miguel A. Colón Vélez
5997e680d0 Remove unused vs2013 file. 2015-08-18 01:16:43 -04:00
Miguel A. Colón Vélez
a1de0614d7 Remove vs2012 files.
It does not support several things from C99/C++11 that are
used in the project.
2015-08-18 01:15:51 -04:00
Miguel A. Colón Vélez
f22bc63fee Disable 8,000+ warnings.
Someone can try renaming v,a,b,m,t but since they are
shadowed one mistakes can mess too much hence the warning.
2015-08-18 00:45:14 -04:00
Miguel A. Colón Vélez
51bd9fe40e Fix compilation errors of the old plugins.
- 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+)
2015-08-18 00:45:03 -04:00
Miguel A. Colón Vélez
a1e56518a5 Rename inside the files. 2015-08-18 00:44:49 -04:00
Miguel A. Colón Vélez
277217353e Rename files. 2015-08-18 00:44:35 -04:00
Miguel A. Colón Vélez
1fe5aceded Enable round-tripping.
- Remove ToolsVersion
- Use $(DefaultPlatformToolset)_xp until XP support is dropped.
Note: opencl had no XP support and was not enabled in VS2012.
2015-08-18 00:44:19 -04:00
Miguel A. Colón Vélez
f52988b93c Run devenv /upgrade
This ensures the solution can do round-tripping.
2015-08-18 00:44:02 -04:00
Miguel A. Colón Vélez
42d64b027e Add wx30 to old plugins.
- Remove wx28
- Add libpng since wx30 depends on it
- Add wx30 dependencies to ZZogl.
2015-08-18 00:43:50 -04:00
Miguel A. Colón Vélez
21c4e6caa6 Fix things found by lintian.
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).
2015-08-17 22:00:07 -04:00
ramapcsx2
9e97742a95 Merge pull request #771 from AdmiralCurtiss/linux-compile-fix-memcard-wxtime
FolderMemoryCard: Fix Linux compile error.
2015-08-17 23:21:38 +02:00
Admiral H. Curtiss
b2831ac2fd FolderMemoryCard: Fix Linux compile error. 2015-08-17 23:10:29 +02:00
bositman
f9e6a02346 Merge pull request #757 from AdmiralCurtiss/folder-memcard-keep-files-open
FolderMemcard: Keep open handles on files.
2015-08-17 11:38:38 +03:00
Gregory Hainaut
260c12756a gsdx-ogl: accelerate Cd - Cs * Alpha in sw blending
It is similar as Cd + Cs * Alpha except the operator

It would help to emulate other color clipping case correctly in basic
mode at full speed
2015-08-16 18:12:34 +02:00
Jonathan Li
6580f4922f gsdx-ogl: correct fbmask conversion on texture shuffle
Fbmask is RGBA8 and must be converted to RGB5A1
=> bit 31 must be moved to bit 15

Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com>
2015-08-16 14:06:10 +02:00
Gregory Hainaut
92dae56ff8 common: fix gcc warning
Macro is already declared in intrin header file
2015-08-16 14:04:30 +02:00
Gregory Hainaut
c32f1dfc23 gsdx-ogl: fix blend clear regression
Field selector are very dangerous to use.

Fix #764
2015-08-15 20:06:34 +02:00
Gregory Hainaut
0e3491bd58 gsdx-ogl: always do RW RT check
Jak uses it with triangle rendering.
2015-08-15 20:06:34 +02:00
Gregory Hainaut
c7b2f9d1d2 gsdx-ogl: setup fbo to always write to first buffer
GL_NONE was kind of useless because nothing was attached anyway
2015-08-15 20:06:34 +02:00
Gregory Hainaut
87f497af0a gsdx-ogl: remove an useless variable 2015-08-15 20:06:34 +02:00
Gregory Hainaut
2e9ff045e1 gsdx-ogl: try another implementation for uniform buffer
It is slower but keep it for a bindless trial
2015-08-15 20:06:34 +02:00
Gregory Hainaut
3145031c05 gsdx-ogl: add glBindBufferRange function pointer 2015-08-15 20:06:34 +02:00
refractionpcsx2
9c7d4171e8 mVU: Tweak the flag hack again so it plays nice with Bloody Roar (and any other which started experiencing issues).
- Now makes sure the previous 4 calculations are taken.
2015-08-15 12:54:40 +01:00
Gregory Hainaut
f9fe2ee2d4 Merge pull request #765 from turtleli/gsdx-minor-gui-fixes
Gsdx: Linux tooltip and label fixes, Wild Arms hack description fix and cleanup
2015-08-15 12:07:50 +02:00
Jonathan Li
63c26c45ec gsdx: Clean up Wild Arms hack cruft
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.
2015-08-15 10:54:03 +01:00
Jonathan Li
1915bf1a61 gsdx:linux: Fix tooltip and clarify/fix 2 labels
Half-pixel offset option now uses the correct tooltip.
Offset Hack -> Half-pixel Offset Hack
Wild arm Hack -> Wild Arms Hack
2015-08-15 09:53:48 +01:00
Gregory Hainaut
87dcb9336f gsdx-ogl: don't bind the 0 texture to be compatible with the Nvidia debugger 2015-08-13 09:57:51 +02:00
Gregory Hainaut
84744d429e gsdx: allow to test glsl shader without replayer
This way users can test it too.
2015-08-13 08:48:05 +02:00
Gregory Hainaut
2f9d5334ee gsdx:EGL: prefer EGL over GLX + add some error messages 2015-08-13 08:48:05 +02:00
Gregory Hainaut
84e6fb45e8 gsdx-replayer:linux: allow to use env variable as default parameter
GSDUMP_SO <= the so plugin
GSDUMP_CONF <= the dir that contains the ini
2015-08-13 08:48:05 +02:00
Gregory Hainaut
52e12baca2 pcsx2: fix gcc warning: may be used uninitialized 2015-08-13 08:48:05 +02:00
refractionpcsx2
3415da216f Whoops, too many clamps 2015-08-12 22:33:35 +01:00
refractionpcsx2
6664936529 microVU/COP2: Add clamping to solve hangs on Superman - Shadow Of Apokolips 2015-08-12 22:31:05 +01:00
Gregory Hainaut
6046d6c417 Merge pull request #749 from PCSX2/gsdx-micro-optimization
Gsdx micro optimization
2015-08-12 08:54:36 +02:00
refractionpcsx2
68de5228a8 GIF Unit: Stop multiple fires of FINISH IRQ's
- Fixes Indiecar Series 2005.
- Savestate bump was required, sorry, not sorry :P
2015-08-12 02:16:23 +01:00
Admiral H. Curtiss
7a388c73c5 FolderMemoryCard: Correctly write the internal memory card file creation/modification timestamps to the host file system's file attributes. 2015-08-11 02:41:42 +02:00
Admiral H. Curtiss
cb01523677 FolderMemoryCard: Fix the metadata writing problem that was introduced in 30eb292b48. 2015-08-11 02:11:41 +02:00
Admiral H. Curtiss
879d0c601f FolderMemoryCard: Keep handles to all accessed files while a memory card is open. This prevents users from modifying card contents while the emulator is running. 2015-08-11 02:11:39 +02:00
Admiral H. Curtiss
30eb292b48 FolderMemoryCard: Remove the Mode parameter for opening files, just always open in r+b so we can both read and write with the same handle.
This breaks metadata writes when a file is read before it's written.
2015-08-11 01:05:03 +02:00
Gregory Hainaut
98c74879bf Merge pull request #718 from PCSX2/depth-color-direct-write
Depth color direct write
2015-08-10 15:50:48 +02:00
bositman
1e4bc7dc18 Merge pull request #746 from willkuer/master
Replace background image by a compatible version that doesn't produce a warning message in png-lib
2015-08-10 12:05:20 +03:00
refractionpcsx2
2798cadb78 Merge pull request #755 from turtleli/rename-math-h
Rename common/include/Utilities/Math.h to common/include/Utilities/MathUtils.h
2015-08-10 09:22:01 +01:00
Gregory Hainaut
67c3587c0b cmake: fatal error if miss dependencies in package mode
+ don't install lilypad in package mode (not ready for distribution)
2015-08-10 08:49:55 +02:00
Gregory Hainaut
0663501d6f gsdx-linux: disable perf monitor on release build
Code is rather slow on linux. Expect a 5-10% perf increase
2015-08-10 08:35:16 +02:00
Jonathan Li
0a0008cf97 Rename Utilities/Math.h to Utilities/MathUtils.h
Math.h conflicts with <math.h> on Visual Studio and causes the utilities
project to fail. Rename it to MathUtils.h instead.
2015-08-09 22:41:18 +01:00
refractionpcsx2
76d84bf6a5 Merge pull request #753 from micove/Fix_Revert
Fix the messy revert.
2015-08-09 15:35:29 +01:00
Miguel A. Colón Vélez
1cb47f3c80 Fix the messy revert.
Because someone had to do it.
2015-08-09 10:01:56 -04:00
Gregory Hainaut
9f92f63194 gsdx-ogl: Use GetAlphaMinMax to limit the scope of FULL accurate blending
Provide a massive speed up in this level.
2015-08-09 13:44:31 +02:00
Gregory Hainaut
61694013a5 gsdx-ogl: compact blending parameter structure
Save 656B of data. It is good for the cache.
2015-08-09 13:44:30 +02:00
Gregory Hainaut
df3ade896b gsdx-ogl: use integer for blend factor
Integer argument&comparison might be lighter

V2: Forget to change one OMSetBlendState call
2015-08-09 13:44:05 +02:00
Gregory Hainaut
68379802cd Merge pull request #751 from micove/Debug_FLAGS
Linux: Don't use O2 in the Debug Build.
2015-08-09 12:39:03 +02:00
Miguel A. Colón Vélez
ddc9c394a2 Don't use O2 in the Debug Build. 2015-08-08 22:10:40 -04:00
Gregory Hainaut
0e783f0003 Merge pull request #750 from nE0sIghT/feature/deoptimize
Use global compiler optimization flags instead of defining them for every plugin/binary
2015-08-08 16:42:12 +02:00
nE0sIghT
e1272dc2f9 Use global compiler optimization flags instead of defining them for every plugin/binary 2015-08-08 16:25:17 +03:00
bositman
ca22c1bdae Merge pull request #747 from micove/Portaudio_Unicode
Windows: PortAudio Unicode - Fixes error when booting a game and using SPU2-X portaudio on UTF8 windows locales
2015-08-08 12:17:25 +03:00
Gregory Hainaut
bf7ae3a53e Merge pull request #744 from micove/Cmake_Options
Linux: Add Cmake Options
2015-08-08 09:37:53 +02:00
Gregory Hainaut
5b57405517 gsdx-ogl: blend management cleanup
* reorder the blend function
* remove OM bsel object
* add a bit to support pabe (miss the glsl part)
2015-08-08 09:18:09 +02:00
Gregory Hainaut
4d12410707 gsdx-ogl: latch constant buffer in rendering object
* Initialization of the object is done once
* Avoid to reupload it when an useless parameter toggle
 => -10% of UBO update
2015-08-08 09:18:09 +02:00
Gregory Hainaut
bd0de8fbaf glsl: (colclip) HDR doesn't need wrapping neither clamping
Might save a couple of instruction in the PS
2015-08-08 09:18:09 +02:00
Gregory Hainaut
8a4c0e9782 cmake: drop extra alignment on GSdx
It requires extensive tests
2015-08-08 09:18:09 +02:00
Gregory Hainaut
1557f82b11 gsdx:clut: comment old unused clut code 2015-08-08 09:17:21 +02:00
Gregory Hainaut
d822b6bd1a gsdx-ogl: add some comments for the future 2015-08-08 09:17:06 +02:00
Gregory Hainaut
b17803bb34 gsdx-ogl: wipeout of GL_ARB_bindless_texture
Code is completely broken. It doesn't help to improve speed.

Remove 200 lines ;)
2015-08-08 09:16:49 +02:00
Gregory Hainaut
99d81868fc cmake: use -ggdb instead of -g
Enable all gdb extensions for debug
2015-08-08 09:16:20 +02:00
Gregory Hainaut
b3919fde95 gsdx-linux: remove an old delay that pollute my benchmark mode
Also add a glFinish to ensure rendering is done
2015-08-08 09:16:13 +02:00
Miguel A. Colón Vélez
0e533e1630 Fix Unicode issues in SPU2-X with PortAudio. 2015-08-07 15:51:54 -04:00
Miguel A. Colón Vélez
2c4cda1e0a Use Unicode in portaudio. 2015-08-07 14:28:02 -04:00
willkuer
26226e2094 replace background image by a compatible version that doesn't produce a warning message in png-lib 2015-08-07 17:57:55 +02:00
Miguel A. Colón Vélez
44bb093438 Run update_svnrevision.sh. 2015-08-07 06:06:36 -04:00
Miguel A. Colón Vélez
5a860d87c7 Merge back the local changes. 2015-08-07 05:57:35 -04:00
Miguel A. Colón Vélez
c17667971c Update portaudio to svn1954. 2015-08-07 05:53:01 -04:00
Miguel A. Colón Vélez
0d344605e1 Use glibc for strcmp and memcmp.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59048
.
The bug is 5+ years old with no fix in sight.
Mesa did some test that showed 50% improvement and enabled it by default.
http://lists.freedesktop.org/archives/mesa-dev/2011-June/009078.html
.
It could also be coded but glibc version has mmx, sse2, and sse4 support.
2015-08-07 05:04:19 -04:00
Miguel A. Colón Vélez
1db74162e6 Update the gcc version requirements.
It no longer builds with 4.6 and 4.7 since it requires features from 4.8.
Start using c++11 since we no longer support 4.5 & 4.6.
2015-08-07 05:03:37 -04:00
Miguel A. Colón Vélez
8a87981d94 Add options to not install optional files. 2015-08-07 02:39:39 -04:00
gabest11
d826d925db gsdx: eliminated a few bugs in the texture size changer algorithm 2015-08-07 02:08:29 +02:00
Gregory Hainaut
241367ec5c Merge pull request #742 from turtleli/gsdx-linux-fix-missing-symbol
gsdx:linux: Add GSDrawingContext.cpp to CMakeLists.txt
2015-08-06 19:54:13 +02:00
Gregory Hainaut
7bb506c5bb Merge pull request #739 from Asmodean-/master
GSdx: Post-processing updates
2015-08-06 19:53:03 +02:00
Jonathan Li
c09501ad9a gsdx:linux: Add GSDrawingContext.cpp to CMakeLists.txt
Fixes the missing symbol error.
2015-08-06 18:17:28 +01:00
avih
68a89bbac8 Merge pull request #741 from turtleli/wx3-regression-fixes
wxWidgets 3.0 fixes
2015-08-05 16:04:12 -07:00
Jonathan Li
cecdc64f51 Fix dialog screenshot function on Windows
wxWidgets 3.0 seems to have a different default device context alpha
channel handling on Windows, which makes the screenshot function
unusable.

As a incomplete fix, remove the alpha channel information from the final
image on Windows. Screenshots degrade slightly.
2015-08-05 22:59:00 +01:00
Jonathan Li
c62cbbfa97 Make GS Frame Panel black
People prefer it that way and it's an easy enough fix.
2015-08-05 22:59:00 +01:00
Jonathan Li
2ea51dd594 Fix wxCore30's rcdefs.h pathname
Visual Studio flags wxCore30 as being out of date because it can't find
the rcdefs.h header file. Use the arch dependent pathname so it is
located correctly.
2015-08-05 22:59:00 +01:00
Jonathan Li
fb14f81f64 Show full descriptions for Speedhacks checkboxes
The "Other Hacks" and "microVU Hacks" checkbox descriptions are
truncated in both Windows and Linux. Use sizer flags so the descriptions
show up properly.
2015-08-05 22:59:00 +01:00
Jonathan Li
02077821d4 Simplify and fix EE and VU slider behaviour
The custom scroll event handler increments/decrements the slider value
by one when a click event is detected. It also propagates the event to
the wxWidgets3.0 built in slider scroll event handler, which repeats the
same action. This causes the slider to add/subtract 2 whenever it is
clicked on Windows.

Remove the custom function.
2015-08-05 22:59:00 +01:00
Avi Halachmi (:avih)
d38d046f7a gui: EE and VU panels: restore defaults programatically
The code was restoring the defaults with hardcoded values. This patch
restores the values however they're defined as defaults for AppConfig.

The code still uses hardcode values to set the highlights (bold) of the
default radio button text - using SetDefaultItem.

Note that other than these two panels, the speedhacks panel is the only other
which has a restore-defaults button, and it already does so programatically.

It's probably not worth trying to unify these three restore-defaults button
into a single system.
2015-08-06 00:38:13 +03:00
Avi Halachmi (:avih)
adf01ec668 gui: EE panel: fix restore-default to also restore EE-cache
The EE/VU config panels use hardcoded values to restore defaults, and
this patch does the same for the EE-cache checkbox.

This fixes GH #737
2015-08-06 00:38:13 +03:00
Gregory Hainaut
39ce8835f7 gsdx:linux: use unordered hash
It seems a bit faster on 'perf' tool
2015-08-05 22:55:12 +02:00
Gregory Hainaut
921b22ac31 gsdx-ogl: drop useless parameter of OMSetDepthStencilState 2015-08-05 22:55:12 +02:00
Gregory Hainaut
b7e16b5989 gsdx-ogl: clean the blending management
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
2015-08-05 22:55:12 +02:00
Gregory Hainaut
717f0fcb4d gsdx-ogl: optimize fbmask setup 2015-08-05 22:55:12 +02:00
gabest11
49b3acea72 gsdx: texture size reduction in sw mode, fixes Stolen, less memory usage in general. 2015-08-05 19:11:41 +02:00
Gregory Hainaut
73e2ff6ff6 gsdx-ogl: change PrimitiveOverlap algo from O(n^2) to O(n)
+ only enable this optimization when it is useful (date or sw blending)

Less impact on the perf even for big vertex array
2015-08-05 17:59:55 +02:00
Kieran Hanrahan
a1a5b25b91 Update GSdx.fx
Update to 2.3 & resolve OGL.
2015-08-05 16:34:40 +01:00
Kieran Hanrahan
3a14a63b0f Update GSdx_FX_Settings.ini
Update to 2.3 and resolve OGL.
2015-08-05 16:33:51 +01:00
Miguel A. Colón Vélez
6462393aaf Introduce end-of-line normalization
Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com>
2015-08-04 23:52:48 +02:00
Miguel A. Colón Vélez
a42a236961 Gsdx: Move the stdext namespace declaration.
This will eventually lead to
error C2871: 'stdext' : a namespace with this name does not exist.
might as well fix it now.
2015-08-04 22:16:15 +02:00
Miguel A. Colón Vélez
30c6389ed9 VS2015: Fix compilation
Error   C2338   The C++ Standard forbids containers of const elements
because allocator<const T> is ill-formed. (compiling source file GS.cpp)
2015-08-04 22:16:04 +02:00
Miguel A. Colón Vélez
d45676b478 Merge local changes to xbyak 4.84 2015-08-04 22:15:52 +02:00
Miguel A. Colón Vélez
41094ac22e Update from xbyak 4.00 to 4.84. 2015-08-04 22:15:46 +02:00
Miguel A. Colón Vélez
e20768d257 VS2015: Fix w32pthreads and xpad 2015-08-04 22:15:36 +02:00
Gregory Hainaut
9d1674db99 gsdx-gui: remove useless linux ifdef 2015-08-04 22:08:55 +02:00
Gregory Hainaut
36554c3375 Merge branch 'hdr-colclip-32bits' 2015-08-04 21:55:40 +02:00
Gregory Hainaut
45bb27d6db gsdx-ogl: extend HDR colclip to 32 bits texture
Unfortunately 16 bits wasn't enough for Castlevania.
2015-08-04 21:54:27 +02:00
Gregory Hainaut
c6ff7531fb gsdx-ogl: performance boost on virtuafighter 2015-08-04 21:26:03 +02:00
Gregory Hainaut
d80aa0b0bd gsdx-ogl: remove 2 printfs
GL_INS is a better tracing solution
2015-08-04 20:47:02 +02:00
Gregory Hainaut
744f9ebc09 gsdx-ogl: rare corner case when both texture shuffle and date are enabled
In texture shuffle mode the texture data is either RG or BA. It means
that DATE must either checks MSB of G or A.

Close #693
2015-08-04 20:10:44 +02:00
Gregory Hainaut
6cb0443227 gsdx: disable depth rendering if rt == depth
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...
2015-08-04 19:39:29 +02:00
Gregory Hainaut
3784ea768f gsdx: check null pointer when doing a texture clear 2015-08-04 19:26:17 +02:00
gabest11
42f51591df gsdx: lupin 3 fix, texture addressing outside the limits, only for sw and opencl yet 2015-08-04 13:27:08 +02:00
gabest11
d631030608 gsdx: fixed some of the renames where it made no sense, also added a commend about lupin 3rd. 2015-08-04 03:36:42 +02:00
Gregory Hainaut
762930516a Merge branch 'JasonBrownDeveloper-master' 2015-08-03 19:37:12 +02:00
Maxxus
c0f85de17f onepad: Minimum code needed to get Dualshock 3 working on recent linux and evdev releases.
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.
2015-08-03 19:34:08 +02:00
gabest11
e010004f1f gsdx: _isnan was not reliable, rewrote it as GSVector4::replace_nan, it uses cmpps and the result as the mask to blend the original value and FLT_MAX. No jumps or function calls. 2015-08-03 14:35:47 +02:00
gabest11
85117ecbdd gsdx: simplified isnan test, it compiles to an inline sse instruction and a flag test, silent hill dump still looks fine. 2015-08-03 11:27:14 +02:00
Gregory Hainaut
6e1cd077a9 gsdx-debug: push ubo in a group 2015-08-03 08:46:25 +02:00
Gregory Hainaut
e972f4f4dd gsdx-ogl: extend device to support an offset for normal draw 2015-08-02 21:30:19 +02:00
Gregory Hainaut
cabd7409e5 gsdx-ogl: don't validate the pipeline
Too noisy in debugger trace. Never catch any errors anyway.
2015-08-02 21:30:19 +02:00
Gregory Hainaut
59cdf77784 gsdx-ogl: create a new function to set the blending state 2015-08-02 21:30:19 +02:00
Gregory Hainaut
1da611fb75 gsdx-ogl: clean PS selector 2015-08-02 21:30:19 +02:00
gabest11
542dd33169 Merge branch 'master' of https://github.com/pcsx2/pcsx2 2015-08-02 20:27:33 +02:00
gabest11
a1a842b07f gsdx: date/datm fix for 16-bit frame buffer in sw rendering mode 2015-08-02 20:21:49 +02:00
Gregory Hainaut
8424c18e9f Merge pull request #688 from PCSX2/hdr-colclip
Hdr colclip
2015-08-02 18:13:28 +02:00
Gregory Hainaut
1f402b1b56 gsdx-ogl: fix bad detection of overlapping
avoid rendering corruption with SW blending
2015-08-01 13:29:25 +02:00
Gregory Hainaut
ec007ac8d0 gsdx-ogl: support accurate blending without geometry shader
For the Mesa driver
2015-08-01 13:26:15 +02:00
Gregory Hainaut
4a3c145c72 gsdx-ogl: depth support: better support of 16 bits z buffer
Fix issue in socom2
2015-08-01 01:28:41 +02:00
Gregory Hainaut
eb0fa8c7dc gsdx-ogl: fix bad detection of overlapping
avoid rendering corruption with SW blending
2015-08-01 01:27:22 +02:00
Gregory Hainaut
8452d2ccfe gsdx-ogl: fbmask regression! don't use bit operation with integer 2015-07-31 21:10:58 +02:00
Gregory Hainaut
fff59f547d gsdx-ogl: fbmask regression! don't use bit operation with integer 2015-07-31 19:43:06 +02:00
refractionpcsx2
0c86dd5763 Merge pull request #687 from AdmiralCurtiss/memcard-type-detection-fix
Auto-detect memory card types instead of trusting the config ini.
2015-07-31 09:56:31 +01:00
Gregory Hainaut
a0edcb58af gsdx-ogl: extend cclip blending level with destination alpha blending
The purpose is to emulate correctly destination alpha factor

An alpha channel of 128 is 1.0 in the GS but only ~0.5 in the GPU

I think few draw call use destination alpha so impact on perf must remains small.
2015-07-31 09:45:28 +02:00
Gregory Hainaut
97b38d9e1b gsdx-ogl: directly set impossible mode in the blending table
Avoid to hack it in the creation

Allow in the future to reuse the table directly instead of converting
in a blend object
2015-07-31 09:45:28 +02:00
Gregory Hainaut
8554f32086 gsdx-ogl: clean the blend table
Remove old shader define
Prefix macro with BLEND_
Add some notes to explain the special symbol
2015-07-31 09:45:28 +02:00
Gregory Hainaut
cfd0fd6cc8 gsdx-ogl: remove old colclip algo 2015-07-31 09:45:28 +02:00
Gregory Hainaut
93c47feb7c gsdx-ogl: replace old colclip algo with the HDR algo
Similar speed but more accurate

Allow to clean the code
2015-07-31 09:45:28 +02:00
Gregory Hainaut
83f874db93 gsdx-ogl: remove bsel.ps
Just clear bsel.abe to disable blending
2015-07-31 09:45:28 +02:00
Gregory Hainaut
25298c70f7 gsdx-ogl: move blending management into a separate function 2015-07-31 09:45:28 +02:00
Gregory Hainaut
25bd5f5e85 gsdx-ogl: request texture barrier to emulate accurate date
Actually it can partially be done with GL_ARB_shader_image_load_store
extension. However all drivers that support shader_image have
texture barrier too.
2015-07-31 09:45:28 +02:00
Gregory Hainaut
2901e94ebc gsdx-ogl: always bind the RT as input texture
To avoid code duplication
2015-07-31 09:45:28 +02:00
Gregory Hainaut
1fe3e04ce3 gsdx-ogl: don't alias m_env/m_context variable
It is cumbersome to move code
2015-07-31 09:45:28 +02:00
Gregory Hainaut
8f27a5a92b gsdx-ogl: only enable fast accurate colclip in level3
Until we drop the old method
2015-07-31 09:45:05 +02:00
refractionpcsx2
a346ce7640 Vif: Assume weird numbers with interrupts in NOPs are okay in when transferring the DMA tag. Stops Tarzan hanging without killing Onimuisha Blade Warriors 2015-07-31 01:09:11 +01:00
Admiral H. Curtiss
1f6a1241f4 Remove memory card type from config ini.
No longer necessary with the auto-detect.
2015-07-31 01:12:46 +02:00
Admiral H. Curtiss
9efb8a341d MemoryCard: Auto-detect memory card type.
Should fix the issue discussed here:
http://forums.pcsx2.net/Thread-Memory-cards-not-showing
2015-07-31 01:06:31 +02:00
refractionpcsx2
71180504e9 GameDB: Add XGKick hack to gamedb for World Rally Championship 3 2015-07-30 19:42:09 +01:00
refractionpcsx2
def2d3f19b GameDB: Added more gamefix patches by Prafull 2015-07-30 19:40:06 +01:00
Gregory Hainaut
83dfc6b633 gsdx-ogl: clean a bit selector code
Use countof macro (avoid to duplicate the size)
Fix the size of array
Remove useless alpha_stencil case
2015-07-30 18:36:05 +02:00
Gregory Hainaut
e026f1bac6 gsdx-ogl: implement a fast accurate colclip algo
The idea is to use a floating texture to accumulate the data and
then do a final postprocessing pass to apply the modulo

v2:
* use bounding box to
* fix vertex corruption issue
* use negative number in shader which allow to use half float (+12
  fps@4x)
2015-07-30 18:34:52 +02:00
Gregory Hainaut
aa8f5848d1 gsdx-ogl: always issue a barrier when requested
Safer this way
2015-07-30 18:24:36 +02:00
refractionpcsx2
28fbae4791 gsdx-gui: Tidy up GUI options 2015-07-30 18:24:32 +02:00
Gregory Hainaut
88bd0996f5 gsdx-ogl: only print same tex/rt message when prims overlaps
Avoid most of the false positive
2015-07-30 18:24:32 +02:00
Akash
350e373e3f gsdx-gui: Remove Aggressive CRC hack.
The option is pretty much useless, CRC hack level controls the usage of hacks already.
2015-07-30 18:24:28 +02:00
Akash
68833e10d1 gsdx-gui: Accurate blending unit for Windows.
The following patch merges all the Accurate options related to the blending unit into a single one.
2015-07-30 18:24:19 +02:00
Gregory Hainaut
d191ae4aba glsl: use rounding in convert 4 shader
It will avoid texture rouding error with negative number
2015-07-30 18:22:59 +02:00
Gregory Hainaut
7b9fa8fbe5 gsdx-ogl: add an assertion that will save me 2015-07-30 18:22:59 +02:00
Gregory Hainaut
46a1525668 gsdx-ogl: support various texture format creation
Such as GL_RGBA32F/GL_RGBA16F/GL_RGBA16UI/GL_RGBA16I/GL_RGBA16

Not yet used
2015-07-30 18:22:59 +02:00
Gregory Hainaut
ee9edb0b19 gsdx-ogl: create a copy rect with conversion function
Previous CopyRect function does a memcopy without conversion.

This function will allow to use different format for input/output. Just a
possibility for the future
2015-07-30 18:22:59 +02:00
Gregory Hainaut
ae8df002af gsdx-ogl: optimize Cs * As + Cd and Cs * Af + Cd blending
Basically the code does the alpha multiplication in the shader therefore
the blend unit only does a pure addition. This way the multiplication is
accurate and accurate_blending doesn't requires a costly barrier.

This code also avoid variable duplication to make the code more separated.
Hopefully blending can be done in a separated function

It is preliminary work to support fast color clipping with HDR

v2: fix assertion compilation failure

v3: fix regression in not accurate mode

v3: Cs * As/Af is not an accumulation

Those cases don't need the Cd addition and were already optimized anyway

Fix a regression on GoW2
2015-07-30 18:22:59 +02:00
Gregory Hainaut
12fdc37599 gsdx-ogl: reorganize blending in the renderer
Do DATE algo selection before blending. This way we can detect bad
interaction.

Regroup all blending/colclip in a single block.  Avoid to check abe &&
rt multiple times.

v2: only enable sw blending when abe is true
2015-07-30 18:21:01 +02:00
Gregory Hainaut
caadc73e1b gsdx-ogl: add a new level for accurate blending
The updated medium level will run for all sprites. It helps sotc blooming effect and it remains
fast enough to be enabled by default (at least on 3D games)
The new high level will run for all sprites + color clipping
2015-07-30 18:21:01 +02:00
Gregory Hainaut
95c374bbcc glsl: Round 0.95+ to 1 for texel colors
It improves SotC blooming. Suikoden seems to be fine too.
2015-07-30 18:21:01 +02:00
Gregory Hainaut
01a1b1a5e6 gsdx-ogl: add the code to handle point and line in SW blending 2015-07-30 18:21:01 +02:00
Gregory Hainaut
a85894e159 gsdx-ogl: move texture shuffle and fbmask into a dedicated function
DrawPrims is really too big now
2015-07-30 18:21:01 +02:00
Gregory Hainaut
b632b2a478 gsdx-linux: add a new combo box to select the blend accuracy level 2015-07-30 18:21:00 +02:00
Gregory Hainaut
5c1b8986c6 gsdx-ogl: use SW blending when no barrier is required
Speed penality is small (only GPU) but it is more accurate
2015-07-30 18:21:00 +02:00
Gregory Hainaut
8c8fe633a5 gsdx-ogl: merge 3 accurate* option into a nice combobox
It is much easier to configure this way
2015-07-30 18:21:00 +02:00
Gregory Hainaut
8da63cf95a gsdx-ogl: try to enable sw blending for sprite rendering
The idea is that sprites are often use for post-processing effect (ofc except 2D games)

Most of the time post-processing supports SW blending with a small speed penality. SW
blending is more accurate so it is better to use it.
2015-07-30 18:21:00 +02:00
Gregory Hainaut
f4e881ad30 gsdx: always set texture shuffle flag
Avoid bad effects in 16 bits RT games
2015-07-30 09:15:04 +02:00
Gregory Hainaut
7aa36133de Merge pull request #657 from turtleli/wxwidgets3_switch
Windows: switch to wxWidgets 3.0
2015-07-29 14:16:02 +02:00
Gregory Hainaut
5c58bd2092 Merge pull request #682 from micove/Add_disable-build-date
Linux: Add DISABLE_BUILD_DATE and misc fixes
2015-07-29 11:45:32 +02:00
bositman
2af021129f Merge pull request #681 from Pistachioman/lilyext
Add default extension to lilypad's save/load config dialog - Prevents saving a file with no extension
2015-07-28 15:56:52 +03:00
Miguel A. Colón Vélez
2c05426db1 Only check for EGL if using EGL_API.
Missed this one.
2015-07-27 19:19:47 -04:00
Miguel A. Colón Vélez
41cc153bff Only check for the needed dependencies.
Helpful for dropping dependencies package dependencies.
- Git only needed if there is a .git folder
- bzip2 only needed by CDVDiso
- CG/GLEW was for zerogs and ZZogl
- jpeg was for ZZogl
.
I also added that EGL_API is also for GSdx in option comment.
2015-07-27 18:54:04 -04:00
Pistachioman
c6c7d99fd2 Add default extension to lilypad's save/load config dialog 2015-07-27 20:30:50 +02:00
Miguel A. Colón Vélez
e4ab71abf3 Add authors comment that suggest public-domain license.
Sourceforge was dead for more than a week therefore add the license
information. I could not find the original TGM source (dead link) so I'm not
even sure if this still applies or if the glsl was totally rewritten. None
of the glsl files have a copyright header so it's hard to tell.
2015-07-27 14:21:29 -04:00
Miguel A. Colón Vélez
6f681743ca Use set -e in the body of the script.
The script passes -e to the shell on the #! line rather than using set -e in
the body of the script. This is fine for normal operation, but if the script
is run by hand with sh /path/to/script (common in debugging), -e will not be
in effect. It's therefore better to use set -e in the body of the script.
2015-07-27 14:13:03 -04:00
Miguel A. Colón Vélez
83a4b37bcf Add an option to disable the inclusion of the build date.
Debian has a goal to make reproducible builds therefore make it an
option instead of distro specific.
.
I added an "OR openSusE" to not "break" the old openSUSE behavior but ideally
they should just use -DDISABLE_BUILD_DATE=TRUE instead.
.
The old -DopenSUSE is not used for anything else so I removed it.
2015-07-27 14:00:47 -04:00
ramapcsx2
000e11e270 Merge pull request #678 from Leucos8/master
Italian translation update
2015-07-27 11:35:13 +02:00
Leucos
14534fbcf8 Italian translation update
Added memory card conversion related strings.
Minor style changes.
2015-07-26 22:10:35 +02:00
avih
07648d9ea6 Merge pull request #675 from turtleli/fix-ctrl-and-shift-detection
windows: Fix detection of Ctrl and Shift key presses
2015-07-26 05:02:48 -07:00
Jonathan Li
83076af25a windows: Fix detection of Ctrl and Shift key presses
Credit for this fix goes to @poodle111

Commit 760de9915b broke the detection of
Ctrl and Shift key presses since it misses the VK_CONTROL and VK_SHIFT
virtual keys.
2015-07-26 12:31:17 +01:00
Gregory Hainaut
f2c77ffa08 gsdx:tc: detect texture shuffle in previous frame
GoW2 uses the effect at the start of a new frame and therefore need the
state of the previous frame. (Note 1 issue remains)

Ricky need to be tested.
2015-07-26 10:14:07 +02:00
Jonathan Li
f5f3bc4e60 wxWidgets3.0: Always include correct manifest
If pcsx2 is compiled for 32-bits and then compiled for 64-bits without
cleaning the build files, the wrong wx3.0 manifest will be included. The
same will happen vice versa.

Place the generated rcdefs.h file in a platform specific directory so
the correct manifest will always be used.
2015-07-25 17:29:59 +01:00
ramapcsx2
107a96c1bc Merge pull request #669 from turtleli/spu2-x-fix-dsound-guid
spu2-x: windows: Fix incorrect sscanf, remove unnecessary unicode to ascii conversion
2015-07-25 13:17:37 +02:00
Jonathan Li
8879866b32 wxWidgets3.0: use relative paths for wxConfig30
This lets wxWidgets3.0 build even when the full pathname has non ASCII
characters or spaces in it.

Note that pcsx2 and some of the plugins that rely on custom build
commands still fail.
2015-07-25 00:33:37 +01:00
Gregory Hainaut
94443afbfc i10n: update russian mo file 2015-07-24 19:26:43 +02:00
Gregory Hainaut
9ffb76798d cmake: fix an old regression with CMAKE_BUILD_STRIP option
Fix issue #673
2015-07-24 19:26:16 +02:00
refractionpcsx2
786944098a Merge pull request #671 from y-salnikov/update_russian_locale
Update russian locale
2015-07-23 23:27:25 +01:00
Y.Salnikov
2ea1f03b79 Update russian locale 2015-07-23 23:53:24 +03:00
Jonathan Li
25b9b24f77 spu2-x: windows: Fix incorrect use of scanf
Half width specifiers were not used, so scanf was writing ints into
bytes.

Note: Visual Studio 2013 doesn't support the hh format specifier.
2015-07-23 19:01:15 +01:00
Jonathan Li
150c53af0f spu2-x: windows: Remove Unicode to Ascii conversion
Use swscanf instead of sscanf to read wide characters directly
2015-07-23 18:58:24 +01:00
Gregory Hainaut
cb4af8fe83 gsdx-ogl: small optimization for the GPU
Gain: 1% at 4x on SotC (it partially compensates recent additions)

When the color is constant and equal to 128, the MODULATE mode is
equivalent to the DECAL mode. It saves 5 instructions on the FS.
2015-07-21 08:19:36 +02:00
Gregory Hainaut
7ca463bf75 gsdx: NaN is likely not well supported for S & T
Add also a comment to explain the NaN issue on Q
2015-07-21 08:19:36 +02:00
refractionpcsx2
539a1767a3 Merge pull request #359 from AdmiralCurtiss/memcard-folder-cache
Memory Card as folder support by AdmiralCurtiss
2015-07-20 23:15:59 +01:00
Admiral H. Curtiss
d331d59a9f MemoryCard: When converting a file to a folder, simulate the conversion process once before writing the data. This prevents half-converted/corrupted cards by ensuring we crash before any actual writes occur. 2015-07-21 00:08:09 +02:00
Gregory Hainaut
223b7daa1d gsdx-ogl: fix fbmask regression
I forget to remove an useless 255.0f factor
2015-07-19 23:55:27 +02:00
Gregory Hainaut
a54e636364 gsdx-linux: add a tooltip for the filtering option 2015-07-19 23:27:45 +02:00
Gregory Hainaut
5c740ff41e gsdx-ogl: wipeout AlphaStencil & Alpha hack
Accurate options do a better jobs. Technically it can still
be useful for old gpu/driver that doesn't support the GL4.5 extension.

On Windows, you can still rely on Dx

On linux, free driver support it (except Intel)
2015-07-19 22:43:48 +02:00
Gregory Hainaut
759e75091a gsdx-gui: yes openGL support correctly 8 bits texture 2015-07-19 17:29:25 +02:00
Gregory Hainaut
6719fc89a6 gsdx-sw: Nan is not well supported in Vertex
It fixes the bad light on Silent Hill with the SW renderer.

Full story
if Q is NaN, m_vt.m_eq.q becomes wrongly true
/Q will wrongly be optimized in the "Vertex Shader" of the SW

Note: Add an assert for the STQ handler

Code path is quite hot so no need to add extra check for nothing
2015-07-19 16:41:05 +02:00
Gregory Hainaut
7f76883b98 Merge pull request #658 from ssakash/patch-34
Add Accurate Frame Buffer mask for Windows [GUI] and remove some old options.
2015-07-19 09:07:13 +02:00
refractionpcsx2
063f42be81 Merge pull request #664 from josephgbr/master
Updated Brazilian Portuguese translation
2015-07-19 00:34:55 +01:00
Rafael Ferreira
66c84f769b Updated Brazilian Portuguese translation
Signed-off-by: Rafael Ferreira <rafael.f.f1@gmail.com>
2015-07-18 17:33:47 -03:00
Gregory Hainaut
38c086008d glsl: round blending as SW renderer
Better tone on God of War with ultra accurate mode
2015-07-18 17:16:46 +02:00
Gregory Hainaut
88cd333839 gsdx-ogl: don't enable both HW&SW blending 2015-07-18 16:15:52 +02:00
Gregory Hainaut
c4e165067d glsl: use signed integer when working with substraction...
It mostly fixes rendering of GoW with ultra blending

Color is still a bit wrong but rounding is likely incorrect
2015-07-18 14:41:03 +02:00
Gregory Hainaut
c701ab4368 glsl: don't use normalized value for color range
Globally shader uses less intruction (except blending part)

It would also allow to improve the rounding of color
2015-07-18 14:41:03 +02:00
Gregory Hainaut
57394a03e0 partially revert: glsl: disable computing of extra alpha coeff in SW blending
It generates undefined data in screen. Maybe blending isn't switch off properly.
I need to investigate it.
2015-07-18 14:41:03 +02:00
Gregory Hainaut
5f5266ba45 gsdx-ogl-debug: don't optimize alpha channel in dump
Allow to dump AEM part of the shader
2015-07-18 14:40:57 +02:00
Gregory Hainaut
036cb229a3 glsl: add various comment for future idea
For example GL4 GPU supports special bit operation
2015-07-18 14:40:57 +02:00
Gregory Hainaut
6c1c857024 gsdx-ogl-debug: properly detect start of instruction in dump 2015-07-18 14:40:46 +02:00
Akash
37897eb922 add accurate framebuffer mask for windows. 2015-07-18 11:24:00 +05:30
Akash
69ce2a1de6 remove stored_renderswitch since, console message is no longer needed. 2015-07-18 10:50:48 +05:30
Akash
2deb0f3e46 remove F9 switch log statement since, renderer change log statement is already present. 2015-07-18 10:50:47 +05:30
Akash
7c4f3d28ce remove is_gsopen stuffs since old GUI is deprecated. 2015-07-18 10:50:34 +05:30
Jonathan Li
1da4232138 Fix wxWidgets3.0 and libpng build file pathnames
This puts the wxWidgets3.0 and libpng generated library files into the
deps folder, and puts the other builds files in a subdirectory from
where the project files are located. This is consistent with all the
other 3rdparty projects.

The output libraries for Devel builds are also suffixed with -dev
instead of -dbg now.
2015-07-17 23:12:40 +01:00
Gregory Hainaut
698dda2310 gsdx-ogl: remove subroutine from the gui too 2015-07-17 22:28:59 +02:00
Gregory Hainaut
36e83b42ce glsl: round texture and fragment color as the SW renderer
GS uses integer value and does integer operation too.

This commit trunc the sampled texture, the interpoled fragment color
and the product of the 2.

It impacts negatively the perf of about 3/4% (GPU) but it fixes rendering on
suikoden and potentially some others games too.
2015-07-17 21:08:49 +02:00
Gregory Hainaut
5f247a6e16 glsl: rewrite tfx function to ease future update
No need to put lots of ifdef, compiler will optimize everything
It increases a bit the readability
2015-07-17 21:08:49 +02:00
Gregory Hainaut
ea9e608288 gsdx-ogl: fix texture palette mask 2015-07-17 21:08:49 +02:00
Gregory Hainaut
b4c04ed00a gsdx-ogl: wipeout subroutine code
Code was completey bitrotten
Code was a partial test (and yet 500 lines already)
Shader is more and more complex and multithreading support greatly
reduce the cost of shader switch
2015-07-17 21:08:49 +02:00
Gregory Hainaut
e3751f6cd9 glsl: disable computing of extra alpha coeff in SW blending
Hum, I'm curious of the impact to enable only this code when it is actually used.
2015-07-17 21:08:49 +02:00
Gregory Hainaut
784822a5c2 glsl: redo blending management to use A/B/C/D directly
1/ Code is much more readable
2/ It will allow to round differently the operation in the future
2015-07-17 21:08:49 +02:00
Gregory Hainaut
e245b27c97 gsdx-ogl-debug: allow to dump various ps shader
Nvidia allows to get the ASM of the shader of the compiled shader. It is useful
to check the performance.

It also allow me to compile most of shader code path for QA

Dump is enabled in linux replayer + debug_glsl_shader = 2
2015-07-17 21:08:48 +02:00
Gregory Hainaut
344030cbe4 Merge pull request #656 from turtleli/gsreplay-opengl-windows
GSdx: windows: Make GSReplay work with OpenGL renderers
2015-07-16 14:39:43 +02:00
Jonathan Li
6c300288f9 gsdx: windows: Make GSReplay work for OpenGL
On Windows, GSReplay does not work with the OpenGL hardware and software
renderer. Make it work.
2015-07-15 20:40:47 +01:00
Admiral H. Curtiss
39e1de4d13 MemoryCard: Add options to convert FolderMemoryCards to 16MB, 32MB, and 64MB FileMemoryCards. 2015-07-14 21:41:50 +02:00
Jonathan Li
837046218e windows: Don't log errors for PS2EsetEmuVersion
On wxWidgets3.0, using GetSymbol() on a nonexistent symbol causes error
messages to be logged. This causes all plugins except GSdx to output
error messages when an attempt to load the PS2EsetEmuVersion symbol fails.
Suppress the error message - it'll probably just cause unnecessary
confusion.
2015-07-13 21:19:13 +01:00
Jonathan Li
db6a32ac33 windows: switch to wxWidgets 3.0
This replaces wxWidgets 2.8 with wxWidgets 3.0 plus all the necessary
include/referencing to get PCSX2 to compile.

VS2012 change is untested.
2015-07-13 21:19:12 +01:00
Gregory Hainaut
6ed137dc9c gsdx-ogl: log openGL driver version 2015-07-13 12:35:55 +02:00
Gregory Hainaut
45e0cfae01 linux: add an example for the validation of tfx fs shader of GSdx 2015-07-13 12:06:32 +02:00
Gregory Hainaut
363a3100c0 linux: use latest profile on cg to validate shader
Otherwise it doesn't work with GSdx
2015-07-13 12:06:32 +02:00
refractionpcsx2
854403af81 Merge pull request #654 from TheLastRar/empty-ethernet-setting-crash
Dev9ghz: Fix crash when ethernet adapter is not selected
2015-07-12 22:34:04 +01:00
TheLastRar
ebafb24099 dev9ghz: proper casing 2015-07-12 18:38:23 +01:00
TheLastRar
820323bc1e dev9ghz: Check if user has selected an adapter
Avoid copying from an invalid pointer
2015-07-12 18:37:38 +01:00
Gregory Hainaut
c9d6ce3b63 Merge pull request #653 from PCSX2/texture-shuffle-again
gsdx: texture shuffle detection
2015-07-12 18:48:00 +02:00
Gregory Hainaut
8be32e4661 gsdx-tc: fix a memory leak when depth isn't fully supported
Fix issue #642
2015-07-12 17:57:42 +02:00
Gregory Hainaut
f6f28042bd gsdx: texture shuffle detection
Don't check rt 32 bits state, it give false positive on suikoden
2015-07-12 15:21:04 +02:00
Admiral H. Curtiss
6bd578ccbe FolderMemoryCard: Reduce unnecessary file I/O by only flushing files that have actually changed since the last known memory card state on the host file system.
This means that we are now no longer touching files that haven't technically been written to. Some games use timestamp information to automatically highlight the save that was last written to, so this should fix a small but annoying bug where it would highlight the wrong one.

Do note that while there is a much simpler check that looks like this:
	// Remove (== don't flush) all memory card pages that haven't actually changed.
	for ( auto oldIt = m_oldDataCache.begin(); oldIt != m_oldDataCache.end(); ++oldIt ) {
		auto newIt = m_cache.find( oldIt->first );
		assert( newIt != m_cache.end() ); // if this isn't true something broke somewhere, the two maps should always contain the same pages
		if ( memcmp( &oldIt->second.raw[0], &newIt->second.raw[0], PageSize ) == 0 ) {
			m_cache.erase( newIt );
		}
	}
	m_oldDataCache.clear();
It can fail in edge cases that don't actually seem too unlikely. Imagine a save being deleted, and then a new save from the same game but in a different slot being created quickly afterwards. It seems quite possible that the new save's file data then occupies the exact same pages as the old save's, and since it's from the same game it might be close enough to where a page sized section (juse 0x200 bytes!) matches the data from the old save that previously resided in that location -- which would cause this code to throw away and not flush this data! It's a shame too, since this variant would be a few ms faster as well, but I feel it's better to be safe than sorry here.
2015-07-12 14:38:21 +02:00
Admiral H. Curtiss
03a6be28c0 FolderMemoryCard: Write the SuperBlock as part of Flush() instead of when the card is Close()d.
This mainly means that the superblock is now no longer written every single time the memory card is closed, but only when it's changed (which should be exactly once, when the memory card is formatted). It also means that you can format a memory card and then have the emulator crash later without having to reformat the card next time.
2015-07-12 14:38:20 +02:00
Admiral H. Curtiss
3a55360572 FolderMemoryCard: Fix a bug where the cache wouldn't be populated properly on first write to any given page.
I'm kinda surprised this didn't horribly break things, honestly. I guess it's because memory card data is always written in blocks, but still.
2015-07-12 14:38:20 +02:00
Admiral H. Curtiss
8e92d25b75 FolderMemoryCard: Add support for deleting of files/folders.
We're not actually deleting files though, we just rename them to prepend _pcsx2_deleted_, in case something breaks or whatever, so the user can in an emergency just restore the save by removing that part of the filename.
2015-07-12 14:38:19 +02:00
Admiral H. Curtiss
798ec3eb9c FolderMemoryCard: Some code cleanup. Use more named constants, mark methods as const where appropriate, and some other minor things. 2015-07-12 14:38:18 +02:00
Admiral H. Curtiss
c0cc91fd0a FolderMemoryCard: Only add folders if all files and subfolders in it also fit into the remaining memory card space.
This avoids situations where, for example, it would only add the icon file but not the game data file because the memory card was near-full.
2015-07-12 14:38:18 +02:00
Admiral H. Curtiss
c4570750ea FolderMemoryCard: Put the initialization of the file entry flushing logic into its own method. 2015-07-12 14:38:17 +02:00
Admiral H. Curtiss
fbc8d30b67 FolderMemoryCard: Cleaned filenames should be used for directories, as well. 2015-07-12 14:38:16 +02:00
Admiral H. Curtiss
65058df3da Move the CopyDirectory() and RemoveDirectory() functions into FileUtils.cpp. 2015-07-12 14:38:16 +02:00
Admiral H. Curtiss
40e6a5c515 FolderMemoryCard: Don't assume that C limits are defined. 2015-07-12 14:38:15 +02:00
Admiral H. Curtiss
a886f6e7e1 Fix some gcc warnings. 2015-07-12 14:38:15 +02:00
Admiral H. Curtiss
eab49dbfa3 FolderMemoryCard: Reduce console logs. 2015-07-12 14:38:14 +02:00
Admiral H. Curtiss
c651d28cc0 Clear memory card ejection timeout when a game boots.
This eliminates prompts at the start of a game complaining about no
memory card being inserted.
I'm honestly not entirely sure if this is safe (is there some memory
card driver that could cache results between different executables?) but
if it isn't we'll see it soon enough!
2015-07-12 14:38:14 +02:00
Admiral H. Curtiss
e774011d71 FolderMemoryCard: Load the network configuration file regardless of filters. 2015-07-12 14:38:13 +02:00
Admiral H. Curtiss
af3dfd39b0 FolderMemoryCard: Create directories recursively. 2015-07-12 14:38:13 +02:00
Admiral H. Curtiss
0976e124e8 FolderMemoryCard: More robust way of checking validity of a subdirectory.
Fixes this memory card:
http://forums.pcsx2.net/Thread-New-feature-Needs-testing-Automatically-managed-Folder-Memory-Card-Public-Test?pid=463506#pid463506
Presumably related to something LaunchElf writes into the memory card
file entries.
2015-07-12 14:38:12 +02:00
Admiral H. Curtiss
50ad3a8bf5 FolderMemoryCard: Clean PS2 filenames that would be illegal in Windows and write the actual names into the metadata files.
This fixes issues with game such as Rayman Revolution, http://forums.pcsx2.net/Thread-New-feature-Needs-testing-Automatically-managed-Folder-Memory-Card-Public-Test?pid=463482#pid463482
2015-07-12 14:38:12 +02:00
Admiral H. Curtiss
92c794f03b FolderMemoryCard: Fix bug that could cause crashes on memory cards that have leftover data from older saves in their file entry clusters. 2015-07-12 14:38:11 +02:00
Admiral H. Curtiss
385bdfb869 FolderMemoryCard: Further optimize file access times.
* Reduce the amount of times path strings are constructed.
* Move file metadata writing to the file helper, which means it will only be written once per consecutive file access instead of on every file chunk.
2015-07-12 14:38:10 +02:00
Admiral H. Curtiss
80feb1087c FolderMemoryCard: Add a helper structure to quickly access a file entry from a file data FAT cluster. Speeds up file access, especially when a lot of files are loaded in the virtual memory card. 2015-07-12 14:38:10 +02:00
Admiral H. Curtiss
bee4f0578d GameIndex.dbf: Add Armored Core Memcard filters. 2015-07-12 14:38:09 +02:00
Admiral H. Curtiss
c3694c4ad1 FolderMemoryCard: Abort Flush operation when remnants of an incomplete save operation are found. 2015-07-12 14:38:08 +02:00
Admiral H. Curtiss
541a254c60 FolderMemoryCard: Clean up Flush logic. 2015-07-12 14:38:07 +02:00
Admiral H. Curtiss
f731e3dc1b FolderMemoryCard: On reads and writes to actual data, check if the relevant data is actually in use according to the FAT.
This allows us to skip a bunch of accesses trying to find a matching file or memory location, presumably without actual consequences. This isn't really gonna change much in actual game use, but does speed up conversions of FileMemoryCards.
2015-07-12 14:38:07 +02:00
Admiral H. Curtiss
41c3eacb6f FolderMemoryCard: Move file existence check into the helper class, so that it gets called much less often.
This *drastically* increases performance, bizarrely enough.
2015-07-12 14:38:06 +02:00
Admiral H. Curtiss
f73db1a572 FolderMemoryCard: Optimize file access by keeping a file open between consecutive reads/writes to the same file. 2015-07-12 14:38:05 +02:00
Admiral H. Curtiss
5f8391f9f1 FolderMemoryCard: Fix sneaky bug that could occur in directories with odd number of files.
It was possible for an invalid (because never written to, so filled with 0xFF) file entry to be recognized as valid in GetFileEntryPointer(), which cascaded up to it flushing file data as fileEntryDict data and thus losing the relevant file data page.

Not sure if the other two entry accesses changed here are affected as well but better be safe than sorry, I suppose.
2015-07-12 14:38:04 +02:00
Admiral H. Curtiss
7e194f1a26 MemoryCard: Add option to convert a memory card to another type in the Memory Card Manager. 2015-07-12 14:38:04 +02:00
Admiral H. Curtiss
d19facfb43 FolderMemoryCard: Add abililty to (re)set simulated memory card size.
This will probably only be used to reset a converted card back to 8MB.
Actually using a card as over 8MB is completely untested.
2015-07-12 14:37:58 +02:00
Admiral H. Curtiss
8029412fb7 FolderMemoryCard: Some code cleanup. 2015-07-12 14:37:58 +02:00
Admiral H. Curtiss
f40b679653 Add option to enable/disable the filtering of the FolderMemoryCard. 2015-07-12 14:37:56 +02:00
Admiral H. Curtiss
72dcb9b94c MemoryCardListPanel: Minor visual bugfix.
If you inserted a PSX memory card into a slot, then swapped that with a
PS2 one, the memory card manager still displayed that card as a PSX one
with "MBit" instead of "MiB" as the size unit. Fixed.
2015-07-12 14:37:56 +02:00
Admiral H. Curtiss
f32f42678c FolderMemoryCard: Filter only system data by default.
This reduces memory card initialization time.
Without this, it always indexes all files when the emulator boots, which
can take a few seconds if you have lots of files.
With this, the only file indexed is the PS2 "your system configuration"
file.

This has the side-effect of not being able to see save files in the PS2
BIOS unless you insert a game disc matching the files you want to see. I
don't think this is a big problem, but there should probably be a "don't
filter" option somewhere in case you want to manage files in the BIOS.
2015-07-12 14:37:55 +02:00
Admiral H. Curtiss
b4b55289d6 FolderMemoryCard: Remember filter so it can be reapplied when memory cards are changed while game is running. 2015-07-12 14:37:55 +02:00
Admiral H. Curtiss
02ae12c555 GameIndex.dbf: Add a the initial set of Memory Card Filters.
This informs PCSX2 which games want to access more than just their own save files so it can load them into the virtual folder memory card.
This includes:
- Multi-disc games which obviously need to access saves from the other disc(s).
- Games that allow importing data from prequels.
- Games that unlock bonuses if they find data from other games in the series, by the same developer, etc.

This is almost certainly not all games that would want to access other saves, but it should cover a lot them.
2015-07-12 14:37:54 +02:00
Admiral H. Curtiss
bcb71ae368 GameIndex.dbf: Fixed a few names, added a few missing games and multi-discs, added a few missing regions. 2015-07-12 14:37:53 +02:00
Admiral H. Curtiss
98012f82aa MemoryCard: Add support to override the memory card filter string via GameIndex.dbf. 2015-07-12 14:37:53 +02:00
Admiral H. Curtiss
2ee1cb81dd FolderMemoryCard: Allow multiple save names in the save file filtering.
Split multiple save names to be filtered with a "/", ie the filter "A/B" matches both save folders that contain "A" and save folders that contain "B".
2015-07-12 14:37:52 +02:00
Admiral H. Curtiss
880be6f602 FolderMemoryCard: Only load data relevant to game. Please read commit description!
Essentially, I'm telling the memory card to re-index itself with a
filter based on the game's disc serial every time a new executable boots
in the emulator.

This currently works for a lot of games, but fails in edge cases where
the game disc's serial does not match the game serial that is written to
the memory card as part of the save file's directory name. This affects
mostly (only?) games that have multiple discs. We could circumvent this
by adding a "save game serial" or something into the GameDatabase which
tells us what we should filter by for those cases.

Apart from this edge case, this appears to work surprisingly well. Try
it and see if you can find other issues!
2015-07-12 14:37:51 +02:00
Admiral H. Curtiss
139e28988d FolderMemoryCard: Store nonstandard file and folder metadata. Fixes issues with Star Ocean 3 battle trophies, and probably some other games. 2015-07-12 14:37:50 +02:00
Admiral H. Curtiss
f15c07653c MemoryCard: Add support for folder memcards in GUI and make both implementation function side-by-side. 2015-07-12 14:37:49 +02:00
Admiral H. Curtiss
1d46800888 MemoryCard: Full initial implementation of the FolderMemoryCard.
FileMemoryCard: Log reads and writes so I know what kind of commands I have to deal with.

FolderMemoryCard: Create basic class/method outline based on FileMemoryCard.

FolderMemoryCard: Add a FolderMemoryCardAggregator so I don't have to write every method in a way that has to handle more than one memory ca

Also shuffle around the location of code because C++ cares about stuff
needing to be defined before they're usable.

FolderMemoryCard: Implement Open().

FolderMemoryCard: Implement GetSizeInfo().

FolderMemoryCard: Implement some basic structure of Read()

FolderMemoryCard: Implement parts of Read() and Save().

Shouldn't it be Write() or Load()? Anyway, this doesn't work yet, but it
gets part of the formatting procedure done which is at least something!

FolderMemoryCard: Add method to calculate ECC.

FolderMemoryCard: Start implementing the FAT.

MemoryCard: More logging.

FolderMemoryCard: Formatting works now!

Formatted memory card isn't actually recognized as formatted yet because I don't store folder metadata yet, but we're getting there!

FolderMemoryCard: Recognize when it's trying to access a data cluster.

FolderMemoryCard: Add directory/file entry support.

On further inspection this might not a be a good way to handle erasing.

FolderMemoryCard: Method to get a file entry and file path from a file's data cluster.

FolderMemoryCard: wxDirName is garbage, let's just use wxFileName for the folder too...

FolderMemoryCard: Fix Erase method.

FolderMemoryCard: Start implementing file writes.

This is still quite broken but we're getting somewhere here!

FolderMemoryCard: Load the data from the host file system into the memory card on emulation start.

Also store superblock to host file system on end.

FolderMemoryCard: Fix a few warnings.

FolderMemoryCard: Implement file reads.

FolderMemoryCard: Proper ECC reads.

FolderMemoryCard: Reads to unmapped locations should return all 0xFF.

FolderMemoryCard: Some sort of working WriteToFile.

(Note: Doesn't always work depending on what order data gets written...)

FolderMemoryCard: Forgot a 'b' for reading files in binary mode. Whoops.

FolderMemoryCard: Load timestamps from the host filesystem.

FolderMemoryCard: r+b needs the file to exist so create if it doesn't.

FolderMemoryCard: Failsafe to allow non-sequential writes.

FolderMemoryCard: Use a cache for writes. Does not flush to host FS yet!

FolderMemoryCard: Flush the data written to the cache to the host file system on exit.

FolderMemoryCard: Since we have a cache now, remove code related to formatting, it's no longer needed.

FolderMemoryCard: More binary file mode mistakes...

FolderMemoryCard: Make it actually possible to disable/eject cards.

FileMemoryCard: Revert changes made for logging data.

FolderMemoryCard: Remove excessive logging.

MemoryCard: Note that the superblock struct is no longer unused.

FolderMemoryCard: A disabled card shouldn't try writing data on exit.

FolderMemoryCard: Log when flushing data.

FolderMemoryCard: Replace plain constants with const variables.

Should make it easier in the future to change the memory card size, if
needed.

FolderMemoryCard: Sort of handle the case when the total size of files in the memory card folder exceed the size of the card.

Not elegant but prevents ugly errors. The file that caused the card to
"overflow" will be seen as corrupted data by the PS2 browser.

FolderMemoryCard: Some sanity checks.

FolderMemoryCard: superBlock member really should have that m_ too to be consistent.

MemoryCard: Switch back to FileMemoryCard for merging.

FolderMemoryCard: Implement GetCRC() via a timestamp of the last memory card write.

Reasoning:
Regarding auto-ejecting on save load, I see that the current
implementation checks that by comparing memory card CRC and reinserting
if it mismatches. Since it's actually just about seeing if the memory
card state of the savestate and the current state match, my GetCRC() now
returns a millisecond timestamp of the last time the card was written
to. This should work out to the intended result, though I had to use
wxGetLocalTimeMillis() instead of wxGetUTCTimeMillis() since the latter
isn't available for some reason.

Fix GCC warnings and error.

MemoryCard: Switch implementations via a #define.

FolderMemoryCard: Add a NextFrame() method that should be called once per frame. Flushes written data to the host file system after a certain amout of frames have passed without any writes (currently 60).

MemoryCard: Add the NextFrame() method to the plugin API.

Counters: If the FolderMemoryCard is selected, inform it every frame in VSyncEnd() that a frame has passed.

VSyncEnd: Probably better to inform the memory card before the frame limiting.

Fix error when using wxWidgets >= 3.0.

FolderMemoryCard: Extract into its own .h/.cpp files.

FolderMemoryCard: Change cache to a map to reduce memory usage.

FolderMemoryCard: More gracefully handle lack of space when adding files.
2015-07-12 14:37:49 +02:00
refractionpcsx2
875be67a7e Merge pull request #619 from pgert/master
Improvement of the HD-fix for Drakan 2 PAL.
2015-07-12 00:22:08 +01:00
Gregory Hainaut
c660ea858b gsdx: move some CRC hacks to full level 2015-07-11 15:14:11 +02:00
Gregory Hainaut
5f8d3b9e4b gsdx-tc: remains in the memory
avoid a crash with kungfu panda
2015-07-11 14:35:35 +02:00
Gregory Hainaut
a4bad8fdbc gsdx-ogl: avoid a bad conflict between accurate option 2015-07-11 14:35:35 +02:00
Gregory Hainaut
15b934eb2a gsdx-ogl: remove useless colclip message 2015-07-11 14:35:35 +02:00
Gregory Hainaut
91fbe6f108 gsdx-ogl: add some code to fix black netting on some renderings
Code is not yet enabled because it requires extensive test

The idea is to replace point by a 1 pixels sprite with the help of
a geometry shader. In 4x, point will be replaced by a 4x4 sprite.
2015-07-11 14:35:35 +02:00
Gregory Hainaut
5e7ce63ed1 glsl: add a geometry shader to upscale GS_POINT
The purpose is to avoid upscaling issue on POINT rendering (black netting on some FMVs)
2015-07-11 14:35:34 +02:00
Gregory Hainaut
2ccf108534 gsdx-ogl: add back a selector for the Geometry Shader 2015-07-11 14:35:34 +02:00
Gregory Hainaut
b46f159ff2 Merge pull request #631 from turtleli/wxwidgets3_3rd_party_prep_v3
wxWidgets 3.0: Windows: Prepare 3rdparty files for switchover
2015-07-11 09:52:01 +02:00
Gregory Hainaut
67807908ca Merge pull request #641 from ssakash/patch-32
3rd party: update to latest version of Wglext.h and deprecate other glew files.
2015-07-11 09:49:14 +02:00
Gregory Hainaut
7f7f6c3b51 Merge pull request #640 from turtleli/gs-frame-title-fixes
GS frame title fixes
2015-07-11 09:47:27 +02:00
Gregory Hainaut
5ed45b6806 Merge pull request #644 from PCSX2/improve-texshuffle-detection
Improve texshuffle detection
2015-07-11 09:34:33 +02:00
Gregory Hainaut
ec61ad3667 gsdx-tc: Add some code for the future
Partially invalidate RT when there is a write in the middle of it (actually 2 pages below)

Code is not yet enabled because
1/ I want to stabilize latest update
2/ not sure of the impact of the code
3/ maybe it need a more generic version
2015-07-10 22:35:26 +02:00
Gregory Hainaut
5888913052 gsdx-debug: don't print any "notify" message
Too verbose
2015-07-10 22:35:26 +02:00
Gregory Hainaut
6f9a89dcf2 gsdx-debug: print memory usage of all textures pools
It is a bit crude but it allow to see the impact of code and options.
2015-07-10 22:35:26 +02:00
Gregory Hainaut
babb5480ce pcsx2: init some variables
Avoid gcc warning
2015-07-10 22:35:26 +02:00
ramapcsx2
a749367300 small tweak to cdvd read console logs. a little alignment > much more readable. 2015-07-10 21:08:55 +02:00
Gregory Hainaut
350db223d3 gsdx: only propagate texture shuffle detection if tex shuffle is detected 2015-07-10 14:06:39 +02:00
Gregory Hainaut
22f11958e9 gsdx: better detection of texture shuffle
Some effects were missed on Wallace & Gromit
2015-07-09 23:05:07 +02:00
Gregory Hainaut
ad86bb5faa gsdx-tc: clear 32 bits state after vsync
Avoid issue on game that uses only 16 bits RT
2015-07-09 23:03:55 +02:00
Akash
08d0946b78 3rd party: update to latest version of Wglext.h and deprecate other glew files. 2015-07-09 21:36:09 +05:30
Jonathan Li
bff1b2a3bf GSdx: Show plugin info in title bar when paused
When GSdx is paused by opening the config panel, GSdx does not pass any
info back to PCSX2. Pass the plugin name and renderer even when paused.
2015-07-09 16:11:26 +01:00
Jonathan Li
badfcb6e3f Fix uninitialised variable use in GS title bar
When the GS plugin is suspended and resumed, PCSX2 will set GS frame
title using an uninitialised array, making it prone to crashing in
those situations. Initialise the array.
2015-07-09 16:11:04 +01:00
Gregory Hainaut
4fcf460447 gsdx: fix DoC black screen video
The game also set both depth and rt buffer at the same location
but disable the depth test (ZTE is 0)
2015-07-09 16:20:43 +02:00
bositman
3debd3ae12 Merge pull request #637 from ssakash/patch-30
Fix a Function name typo for the Superman Returns CRC patch
2015-07-07 19:18:52 +03:00
Akash
a02a9aac8f Fix a Function name typo. 2015-07-07 21:26:04 +05:30
Gregory Hainaut
345efed473 Merge pull request #633 from ssakash/patch-22
Update the variable name and region of the CRC hack used for Superman
2015-07-07 15:27:08 +02:00
Gregory Hainaut
1d10383924 Merge pull request #632 from turtleli/wx3-windows-fixes
Fix plugin open error handling for wx3.0 on Windows
2015-07-07 15:25:27 +02:00
Akash
f39aa181cc Update the variable name to suit the game's original name and change to accurate region of the game. 2015-07-06 00:59:35 +05:30
Gregory Hainaut
986754bde7 glsl: don't declare gl_FragDepth
Fix compilation issue on Mesa driver

(hope it doesn't break Catalyst)
2015-07-05 18:12:36 +02:00
Gregory Hainaut
edc9d23566 gsdx: fix a crash with UserHacks_ColorDepthClearOverlap 2015-07-05 14:13:24 +02:00
Gregory Hainaut
e1144d7a18 gsdx:hack: add a CRC for SuperMan
Extracted from the GS dump
2015-07-05 14:11:35 +02:00
Gregory Hainaut
95e1cd9ea8 gsdx-tc: don't considerer frame as a 32 bits RT
Frame is always 32 bits but game can reuse it later as a 16 bits RT.

Fix half screen issue with Ricky Ponting Cricket

Unfortunately it triggers texture shuffle wrongly. I hope there is no
regression.
2015-07-04 11:00:32 +02:00
Gregory Hainaut
8640b44e02 gsdx-hack: implement a hack for SuperMan (need CRC to enable it)
Fix depth issue.

First issue: RT and Depth are located at the same address.
=> solution, just lookup the depth (done for any games)

Second issue: Instead to draw a X,Y rectangle, they draw a 32 pix, 4096 pix
rectangle with a FBW of 1.
=> solution, don't bother just write the depth directly

Please someone add some CRC to enable the code
2015-07-04 10:59:21 +02:00
Gregory Hainaut
0a07762f6b gsdx-tc: only track 32 bits fmt if the texture is not a palette fmt
Fix a regression on ricky ponting cricket (texture shuffle was triggered without any valid reason)
2015-07-03 23:04:48 +02:00
Gregory Hainaut
b9bc5b5c60 gsdx: add UserHacks_ColorDepthClearOverlap to test some new code
debug only
2015-07-03 22:13:35 +02:00
Gregory Hainaut
621d1d93db gsdx-linux: drop the logz option
logz will only enabled if GL_ARB_clip_control is not found.

Note: logz will likely break depth support. Be sure to use a recent driver
2015-07-03 21:29:49 +02:00
Gregory Hainaut
82ed6eac13 gsdx-linux: remove alpha hack from the GUI
Normally you don't need it anymore on OpenGL :)

You can still use this option from the ini file for debug purpose
2015-07-03 21:24:17 +02:00
Gregory Hainaut
abec4bd760 gsdx-ogl: don't enable aout when using accurate fbmask 2015-07-03 21:21:56 +02:00
Gregory Hainaut
d71b2c1ded gsdx: update accurate fbmask tooltip 2015-07-03 21:21:08 +02:00
Gregory Hainaut
4dbe71cba8 gsdx-ogl: disable SW blending when running DATE GL42
// GL42 interact very badly with sw blending. GL42 uses the primitiveID to find the primitive
// that write the bad alpha value. Sw blending will force the draw to run primitive by primitive
// (therefore primitiveID will be constant to 1)
2015-07-03 20:34:52 +02:00
Gregory Hainaut
705c88f193 gsdx-ogl: disable blending when cleaning integer texture
Avoid a warning message on Nvidia
2015-07-03 20:26:56 +02:00
Gregory Hainaut
c6f026ee68 gsdx-tc: keep 32 bits status when converting from/to depth
Partially fix conan effect
2015-07-03 19:02:44 +02:00
Jonathan Li
bb4a155c73 configure wxWidgets 3.0, update .gitignore
Configures the settings in include/wx/msw/setup.h.
Removes icons from include/wx/msw/wx.rc.
Deletes include/wx/msw/rcdefs.h (autogenerated by build process).

Updates .gitignore by including wxWidgets3.0 build files and adds a
missing '/' to build.
2015-07-03 10:05:59 +01:00
Jonathan Li
c3755b82a4 wxWidgets3.0: setup VS2012 project files
Same as previous commit, but with VS2012 and no extra property sheet.
2015-07-03 10:05:59 +01:00
Jonathan Li
1bada25a79 wxWidgets3.0: setup VS2013 project files
This configure the VS2013 files so that the now external libpng and
libjpeg libraries are used, and to place some of the common stuff into a
property sheet.

For deleted files, I've chosen to exclude from build instead of removing
them from the project file. It's less work to re-add them if they're
required at a later stage.
2015-07-03 10:05:58 +01:00
Jonathan Li
253f635f56 libpng: setup Visual Studio project files
This also moves scripts/pnglibconf.h.prebuilt to pnglibconf.h
2015-07-03 10:05:58 +01:00
Jonathan Li
2ab97aaa49 libpng: upgrade from 1.6.2 to 1.6.17
This upgrades the customised 1.6.2 wxWidgets3.0 version to 1.6.17 from
the zip version. CMakeLists.txt and the contrib directory have been
removed.
2015-07-03 10:05:57 +01:00
Jonathan Li
f1547c14e0 wxWidgets3.0: rename Visual Studio project files
This renames the project files for consistency with the names of the
other project files.
2015-07-03 10:05:56 +01:00
Jonathan Li
9a9e93da83 wxWidgets3.0: upgrade from 3.0.1 to 3.0.2 2015-07-03 10:05:56 +01:00
Jonathan Li
24d5e59c32 wxWidgets3.0: trim files and rename directory
Delete files and directories that won't be used, and rename the
wxWidgets 3.0 directory to reduce confusion when doing maintenance
version upgrades.
2015-07-03 10:05:55 +01:00
Jonathan Li
2e791c762b wxWidgets3.0: move libpng out, delete libjpeg
Move libpng out of wxWidgets 3.0 so it's available to other projects.
Delete libjpeg since there's a newer copy already available in 3rdparty
(still outdated though).
2015-07-03 10:05:43 +01:00
Jonathan Li
29ccbfe140 Fix plugin error handling for wx3.0 on Windows
This prevents a PCSX2 lock up that requires Task Manager to kill. It
seems the messagebox intercepts the GSframe's close event, hides itself
and then leaves you with no way of ending PCSX2 normally. So close the
GS frame before the message box appears.
2015-07-02 23:01:43 +01:00
Gregory Hainaut
0c12f232ca gsdx-ogl: don't write depth in first step of DATE 42
Fix shadows in Fifa
2015-07-02 21:08:47 +02:00
refractionpcsx2
193f47ebb1 Merge pull request #616 from ssakash/patch-22
swap value functions for Round sprite hack.
2015-07-02 19:33:03 +01:00
Gregory Hainaut
28815db7cc gsdx: fix depth option 2015-07-02 19:13:38 +02:00
Akash
6f515b220e update the description text 2015-07-02 01:39:55 +05:30
Gregory Hainaut
de644c5437 Merge pull request #628 from PCSX2/gsdx-depth-and-16-bits-support
Gsdx 1.0
2015-07-01 20:50:09 +02:00
Gregory Hainaut
cd8e31d85f gsdx-ogl: always copy date to offset 0,0
Fix snow engine game on driver that don't support yet GL_ARB_copy_image
(Mesa drivers)
2015-07-01 18:27:20 +02:00
Gregory Hainaut
831c24de51 gsdx-dx: only enable new code when CRC is below FULL level
Code is not ready. It allow to test the new code without a massive
regression
2015-07-01 09:36:54 +02:00
Gregory Hainaut
074881228d gsdx:comment: small explanation of the half offset hack 2015-07-01 09:36:54 +02:00
Gregory Hainaut
76f96ddbb6 gsdx-tooltip: MSAA is not implemented on OpenGL 2015-07-01 09:36:54 +02:00
Gregory Hainaut
50c9988018 gsdx-ogl: disable all accurate options when not supported + No Intel support on windows 2015-07-01 09:36:54 +02:00
Gregory Hainaut
a9f49ab9ab glsl: fix rounding error for shadow computation
Better shadow on Castlevania/Nemo (others :) )
2015-07-01 09:36:54 +02:00
Gregory Hainaut
d46e41533d gsdx: remove various CRC of the openGL level
It is mostly the texture shuffle effect which is now emulated correctly on openGL

They remain in the Dx level as speedhack in particular for
    * Castlevania;
    * GodOfWar;
    * StarOcean3;
    * ValkyrieProfile2;
    * RadiataStories;

Remove old commented hack: Drakengard2, ArctheLad, ReZ

Separate hacks that are only enabled in aggressive mode
2015-07-01 09:36:54 +02:00
Gregory Hainaut
be1403cdc2 gsdx-ogl: support texture shuffling on !FST
Mostly fix "Finding Nemo"

It remains a shadows issue when you enable accurate_fbmask and depth
2015-07-01 09:36:54 +02:00
Gregory Hainaut
beafbd9768 gsdx: add a warning for the future 2015-07-01 09:36:54 +02:00
Gregory Hainaut
6121677aa1 gsdx-tc: use a single shader pass to convert texture in 8 bits format
It might save a couple of fps

Add a define to test the perf if we keep only the blue channel. It brokes
the code in Prince Of Persia that use the Red/Green channel... Maybe the
speed hack :( Or find a way to replace all if with a lookup table

Note: it is only supported on OpenGL currently
2015-07-01 09:36:54 +02:00
Gregory Hainaut
2ecca529d1 gsdx-tc: log dirty target 2015-07-01 09:36:54 +02:00
Gregory Hainaut
e2727f10ba glsl: fix for AMD
I hope :)
2015-07-01 09:36:54 +02:00
Gregory Hainaut
2af7dcbda2 gsdx-tc: GPU accelerate 8 bits texture when upscaling is enabled
Code unscale the texture to ease the conversion. Quality is awful (same as before)
but I'm not sure we can support an upscaled texture

Maybe the quality loss is due to the reduction without mipmap

Maybe the best solution will be to add an hack to extract the blue channel
(with texture swizzle), and uses a "full page/screen" spirte instead.
(it would be faster too)

Note: won't be compatible with MSAA (but gl doesn't support it anyway)
2015-07-01 09:36:54 +02:00
Gregory Hainaut
6ca7a802bf gsdx-tc: add a big comment to explain the scaling of src in TC 2015-07-01 09:36:54 +02:00
Gregory Hainaut
d29e375f72 gsdx-tc: GPU accelerate 8 bits texture conversion
Only native is supported currently
2015-07-01 09:36:54 +02:00
Gregory Hainaut
a8bcc760b4 gsdx-tc: only clean RT in openGL
It is a debug feature for myself
2015-07-01 09:36:54 +02:00
Gregory Hainaut
3f6edc39cf gsdx-linux-gui: update option
Add mipmap for SW
Add tc depth for HW

Remove nvidia MT, always on
2015-07-01 09:36:54 +02:00
Gregory Hainaut
db5468afcf glsl: fix shadow on Shin Megami Tensei Nocturne 2015-07-01 09:36:54 +02:00
Gregory Hainaut
61a717db14 gsdx-tc: clean the RT in debug build
// In theory new textures contain invalidated data. Still in theory a new target
// must contains the content of the GS memory.
// In practice, TC will wrongly invalidate some RT. For example due to write on the alpha
// channel but colors is still valid. Unfortunately TC doesn't support the upload of data
// in target.
//
// Cleaning the code here will likely break several games. However it might reduce
// the noise in draw call debugging. It is the main reason to enable it on debug build.
//
// From a performance point of view, it might cost a little on big upscaling
// but normally few RT are miss so it must remain reasonable.
2015-07-01 09:36:53 +02:00
Gregory Hainaut
99b03b4632 gsdx-debug: log all write (texture) from the EE
It is verbose but it might help to understand the invalidation of texture
2015-07-01 09:36:53 +02:00
Gregory Hainaut
e66aac8ab7 gsdx-hw: add an hidden option to preload the final frame with GS mem data
Game can directly uploads a background or the full image in
"CTRC" buffer. Previous code was a full black screen.

It will also avoid various black screen issue in gs dump.

hidden option: preload_frame_with_gs_data

Note: impact on upscaling was not tested and it's likely broken
2015-07-01 09:36:53 +02:00
Gregory Hainaut
a751db5f2b gsdx-ogl: merge 2 log (too verbose otherwise) 2015-07-01 09:36:53 +02:00
Gregory Hainaut
85543db094 gsdx-tc: trace the alpha channel update in TC
Improve the rendering in MGS3 (even if the game is still broken
due to others TC issues)

// Typical bug (MGS3 blue cloud):
// 1/ RT used as 32 bits => alpha channel written
// 2/ RT used as 24 bits => no update of alpha channel
// 3/ Lookup of texture that used alpha channel as index, HasSharedBits will return false
//    because of the previous draw call format
//
// Solution: consider the RT as 32 bits if the alpha was used in the past
2015-07-01 09:36:53 +02:00
Gregory Hainaut
4a65e5e723 gsdx-tc: don't try to read a 0 pixels texture
"Regression" introduced in 8 bits RT support

The case appears when
1/ address of RT is the same as input texture
2/ input format is 8 bits
3/ previous lookup of RT was miss
2015-07-01 09:36:53 +02:00
Gregory Hainaut
a588f61a8a gsdx: add an assert for unsupported case 2015-07-01 09:36:53 +02:00
Gregory Hainaut
9802ba6621 gsdx-tc: add support of pseudo 8 bits RT conversion
Code is obviously slow but at least it works.

It fixes the blur effect of VP2
2015-07-01 09:36:53 +02:00
Gregory Hainaut
77e718c61f gsdx: disable linear interpolation when converting texture in texture cache
It avoid various upscaling glitches on GS post-processing effect

// 1/ Palette is used to interpret the alpha channel of the RT as an index.
// Star Ocean 3 uses it to emulate a stencil buffer.
// 2/ Z formats are a bad idea to interpolate (discontinuties).
// 3/ 16 bits buffer is used to move data from a channel to another.
//
// I keep linear filtering for standard color even if I'm not sure that it is
// working correctly.
// Indeed, texture is reduced so you need to read all covered pixels (9 in 3x)
// to correctly interpolate the value. Linear interpolation is likely acceptable
// only in 2x scaling
//
// Src texture will still be bilinear interpolated so I'm really not sure
// that we need to do it here too.
//
// Future note: instead to do
// RT 2048x2048 -> T 1024x1024 -> RT 2048x2048
// We can maybe sample directly a bigger texture
// RT 2048x2048 -> T 2048x2048 -> RT 2048x2048
// Pro: better quality. Copy instead of StretchRect (must be faster)
// Cons: consume more memory
//
// In distant future: investigate to reuse the RT directly without any
// copy. Likely a speed boost and memory usage reduction.
2015-07-01 09:36:53 +02:00
Gregory Hainaut
ae3b768de9 bump gsdx version to 1.0.0 2015-07-01 09:36:53 +02:00
Gregory Hainaut
839003467e gsdx-ogl: add support of partial frame buffer masking
It might help to fix a bit the color on a couple of games

accurate_fbmask = 1

Code uses GL4.5 extensions. So far it seems the effect is ony used a couple
of time and often in non-overlapping primitive. Speed impact will likely remain small
2015-07-01 09:36:53 +02:00
Gregory Hainaut
87f54ae0ff gsdx: report error on unsupported case in texture cache
It seems to impacts lots of games that still have issue (VP2, MTG3, PoP)

The PSMT32 format is read a PSMT8. I think we need to convert it as PSMT8H (i.e.
unpack it to have only an alpha channel)
2015-07-01 09:36:53 +02:00
Gregory Hainaut
82818dab3c gsdx-ogl: make some room in AlphaCoefficient variable
The idea will be to use the remaining int to store the FB mask
2015-07-01 09:36:53 +02:00
Gregory Hainaut
3b127f663b gsdx-tc: trace the texture format to detect texture shuffling
It fixes games that uses 16 bits RT (like snow engine games)
2015-07-01 09:36:53 +02:00
Gregory Hainaut
33c9e9da0a gsdx: new generic OI hack
To clear a (W, H) RT/Depth, GS can only send a (W , H/2) primitive with
a Z (or RT) pointer in the middle of the buffer

Top-half will be cleared by the color (or the depth).
Bottom-half will be cleared by the depth (or the color).

Code isn't enabled yet but it was tested with success on GoW2.
2015-07-01 09:36:35 +02:00
Gregory Hainaut
42e911c78f gsdx-ogl: mask alpha channel in depth conversion
Might not work if depth is recasted as a rt (we lost the alpha channel)
2015-07-01 09:30:20 +02:00
Gregory Hainaut
05c72980fc gsdx: avoid to detect PSMT8H as 16 bits 2015-07-01 09:30:20 +02:00
Gregory Hainaut
b62a2d6a3c gsdx-debug: dump texture in 32 bits when a shuffing effect is detected
Otherwise it is unreadable
2015-07-01 09:30:20 +02:00
Gregory Hainaut
6b5a3dedd9 gsdx-debug: add the format in texture cache logging 2015-07-01 09:30:20 +02:00
refractionpcsx2
955fc3aa35 GSdx-DX: Mirror round value change from OGL 2015-07-01 09:30:20 +02:00
refractionpcsx2
af09d7e063 GSdx-DX: Modified shader slightly as some bits were incorrect. 2015-07-01 09:30:20 +02:00
Gregory Hainaut
7ee3dbd615 gsdx-tc: use the virtual function to check the state
This ways it will be disabled for dx
2015-07-01 09:30:20 +02:00
refractionpcsx2
de189b67a2 GSdx: Add option to toggle Texture Cache Depth support.
- Forced off for DX currently to save fallover.
2015-07-01 09:30:20 +02:00
refractionpcsx2
2dc4e2a04c GSdx: Gave accurate blend option an extra state, can now do super accurate blending from the GUI 2015-07-01 09:30:20 +02:00
Gregory Hainaut
c925b1d135 gsdx-tc: support GS mem to depth buffer transfer
Please test SMT games

(issue #572)
2015-07-01 09:30:20 +02:00
refractionpcsx2
4bc8bfc23e GSdx-DX: Rough port of texture switching from OGL 2015-07-01 09:30:20 +02:00
Gregory Hainaut
58ce7d4bb8 gsdx-ogl: emulate texture shuffle
GS doesn't supports texture shuffle/swizzle so it is emulated in a
complex way.

The idea is to read/write the 32 bits color format as a 16 bit format.
This way, RG (16 lsb bits) or BA (16 msb bits) can be read or written with
square texture that targets pixels 1-8 or pixels 8-16.
However shuffle is limited. For example you can copy the green channel
to either the alpha channel or another green channel.

Note: Partial masking of channel is not yet implemented

V2: improve logging
V3: better support of green channel in shader
V4: improve detection of destination (issue due to rounding)
2015-07-01 09:30:20 +02:00
Gregory Hainaut
2d812deb84 gsdx-tc: Depth and Target are interchangeable on the GS !!!
Extend the texture cache to search Color target in Depth target
2015-07-01 09:30:20 +02:00
Gregory Hainaut
76160505f7 gsdx-tc: add an option to avoid blow up dx :p
texture_cache_depth = 1 (default for openGL)
2015-07-01 09:30:20 +02:00
Gregory Hainaut
74d84aafb5 gsdx-tc: allow to search the depth in the old target list
Yes it is possible on PS2 world
2015-07-01 09:30:20 +02:00
Gregory Hainaut
b59a347ad7 gsdx-tc: allow to use depth buffer as input texture 2015-07-01 09:30:20 +02:00
Gregory Hainaut
49516cbbca gsdx-tc: allow to invalidate the depth/target if it is used as target/depth
It is requires when game will uses sometimes an address as a RT sometimes as a depth
2015-07-01 09:30:20 +02:00
Gregory Hainaut
35081f922a gsdx: GS kinds of support draw without framebuffer
Gow uses 24 bits buffer, so only color is updated but blending is configured as Cd
so it is a NOP

In this case, we don't lookup the target in the texture cache. It reduces the complexity
to handle depth which can be located at same address as RT

Note: please test DX renderer
2015-07-01 09:30:20 +02:00
Gregory Hainaut
e3adf823b3 Merge pull request #625 from turtleli/onepad-fix
linux: onepad: Prevent dereference of deleted pointer
2015-06-29 23:47:44 +02:00
Jonathan Li
b96609cb51 onepad: fix possible dereference of deleted pointer
onepad will dereference conf after it has been deleted if a PADinit,
PADshutdown, PADinit sequence takes place.
2015-06-29 20:53:00 +01:00
refractionpcsx2
c659b1aa18 Merge pull request #617 from ssakash/patch-26
Console log message for current renderer.
2015-06-28 13:24:09 +01:00
refractionpcsx2
c753f0d206 VIF-MFIFO: Fix for stalls on wait instructions, fixes Stuart Little 3
- VIF Waits for Path3 to flush, but it was firing before it had finished.
-Condition is much cleaner and less hacky now.
2015-06-27 22:47:44 +01:00
ramapcsx2
15944feea1 Merge pull request #620 from turtleli/ui-fixes-again
More gui fixes ( Close console using X, Plugin/BIOS error dialog)
2015-06-27 19:21:50 +02:00
Jonathan Li
f9ea013b60 gui: Fix/improve plugin/BIOS error dialog handling
If the user encounters a plugin/BIOS error and the plugin/BIOS dialog is
already open, make the dialog switch to the panel that corresponds with
the error.

Also, fix the open dialog detection and provide a slightly different
messagebox if the plugin/BIOS dialog is already open - for these cases it
won't say "Click Ok to go to the x configuration panel" anymore.
2015-06-27 13:37:30 +01:00
Jonathan Li
0b42db11bd gui: Fix Console close behaviour
When the Console is closed (except through Misc -> Show Console), PCSX2
does not remember that you closed the Console and will reopen it the next
time. You also have to press Show Console twice if you want to reopen
the Console after closing it.

This is caused by the Console looking for its "parent" main emulator
window, when secretly, they're siblings :)

Make the console properly register when it is closed.
2015-06-27 13:37:13 +01:00
pgert
2e4c3c9a17 Improved the HD-fix for Drakan 2 PAL. 2015-06-27 13:56:04 +02:00
bositman
59a66f87c3 Merge pull request #611 from turtleli/fix-toggling
Fix renderer toggling behavior and other related stuff
2015-06-26 16:34:02 +03:00
Gregory Hainaut
f4c22ce932 Merge pull request #612 from turtleli/ui-event-handling-fixes
gui: Dialog handling fixes and cleanup
2015-06-26 15:23:50 +02:00
Gregory Hainaut
0c2dcf26f2 Merge pull request #598 from turtleli/wxwidgets3_prep
Changes to make transition to wxWidgets3.0 on Windows easier
2015-06-26 15:18:13 +02:00
Jonathan Li
acc6ad59ba GSdx: Use correct renderer after config change
Rework the renderer selection logic to reload the saved renderer after
it's been changed in the config panel and to properly detect whether a
renderer toggle has been requested.
2015-06-26 00:50:07 +01:00
Jonathan Li
bfa46b7f54 Fix when the toggling message appears
Make the toggling message appear only when F9 is actually pressed.
2015-06-26 00:49:30 +01:00
Jonathan Li
9a171a5928 gui: Make Msgbox more consistent
Just use ShowModal. That will invoke pxMessageDialog on the main thread
anyway.
2015-06-25 16:53:10 +01:00
Jonathan Li
2a4bd85f53 gui: Fix looping dialog event handling
The dialog event handling is a bit messed up. An ok/cancel event sends a
close event, which sends a cancel event and repeats. This would actually
be an infinite loop if wxWidgets didn't detect a loop.

Rework the event handling to avoid the loop and to remember the
positions of modal dialogs as well.
2015-06-25 16:46:20 +01:00
Akash
4b472bb461 Console log message for current renderer. 2015-06-25 20:15:45 +05:30
Jonathan Li
d9447de492 linux: Fix close button on minimisable modal dialogs
Keep Windows platform specific fixes ifdef'd to Windows only.
2015-06-25 15:45:45 +01:00
Jonathan Li
d6d4a1a983 linux: wx3.0: fix broken messagebox handling
Do not do additional processing on an event after EndModal is called.

This fixes a message box bug on Linux wx3.0 builds. Without this fix,
Release and Devel builds emit cancel signals even if 'Ok' or other
buttons are pressed, and Debug builds trip an assertion with the message
"EndModal called twice or ShowModal not called."
2015-06-25 15:26:55 +01:00
Akash
1d4dff9e42 Remove break statement (return already ends the function execution) 2015-06-25 19:48:22 +05:30
Gregory Hainaut
f3c0c1bb88 gsdx-ogl: TexParamami is provided in core 2015-06-25 10:25:57 +02:00
refractionpcsx2
42b1f81b8e dev9ghzdrk: I've got a good idea, lets not match the host mac ;) 2015-06-24 23:42:28 +01:00
refractionpcsx2
cc6ebff48e dev9ghzdrk: Update the virtual_mac too (bridged?) Won't hurt either way! 2015-06-24 22:14:50 +01:00
Gregory Hainaut
8393ba56d6 gsdx-ogl: rework palette texture handling
Redirect the red channel to alpha channel for 8 bits texture.

It avoid special management in the shader
2015-06-24 19:50:09 +02:00
Gregory Hainaut
cd4c8b5ce4 gsdx-debug: resolve alpha equation in the dump file 2015-06-24 19:42:53 +02:00
refractionpcsx2
819133ee45 dev9ghzdrk: Make the MAC truely unique, fixes issue #552
-Version bump to reflect the awesomeness
-Put most of the mac variables in one place (not that they do much)
2015-06-24 01:36:01 +01:00
refractionpcsx2
ee9b1caaa4 GSdx-hw: Custom res native mixup stuff, best fix this one too. 2015-06-23 19:43:04 +01:00
Akash
85c4184ea5 swap value functions for Round sprite hack. 2015-06-23 20:07:46 +05:30
refractionpcsx2
ad71ca4cc8 GSdx-hw: Make sure custom resolution doesn't affect Native Resolution 2015-06-22 17:23:47 +01:00
bositman
eb0f6eb953 Merge pull request #607 from TheLastRar/dev9settings
dev9ghz: Use .ini for saving settings and delete old registry keys
2015-06-22 17:35:37 +03:00
TheLastRar
dcd477f2b6 dev9ghz: Look in registry for settings first
If settings found in the registry, create ini, fill with settings and
then delete the settings stored in the registry.

If no settings found in registry, load from ini.
2015-06-22 15:13:18 +01:00
Jonathan Li
98a7058794 Remove 'Disable vsync in software rendering' code
PCSX2 doesn't know whether it is in hardware or software mode. So this
code does not work if the user is using software rendering mode without
F9 toggling.

Don't disable vsync if the user toggles rendering mode.
2015-06-21 20:39:31 +01:00
Gregory Hainaut
7135867119 gsdx: very old typo on option name
Windows uses Renderer with an uppercase R
2015-06-20 16:18:10 +02:00
Jonathan Li
e0da81a44e Reworked missing BIOS handling
When booting a game, a missing BIOS (and possibly other BIOS errors)
will crash or lockup PCSX2 (except for a Windows wxWidgets 2.8 build,
I have no idea why). The messagebox that appears is also badly
formatted.

Use the event queue to handle the error instead of dealing it with
immediately and fix the appearance of the messagebox.

This also deletes the BiosSelectorDialog code since it isn't used
anymore and fixes a condition where, on plugin load failure, the
component selector dialog may open up at the wrong page.
2015-06-20 13:46:18 +01:00
Jonathan Li
3e69113f48 Fix logging in wxWidgets 3.0
wxWidgets 3.0 requires DoLogRecord, instead of DoLog, to be overridden.
2015-06-19 22:14:49 +01:00
Jonathan Li
8de94a3714 Fix string handling on Windows wxWidgets 3.0 2015-06-19 22:14:49 +01:00
Jonathan Li
cde4670cbd Include rpcrt4.lib as pcsx2 linker dependency 2015-06-19 22:14:48 +01:00
Jonathan Li
fbf71218f1 Remove wxWidgets linker dependencies in property sheet
The wxWidgets projects have already been specified as references for
both the SPU2-X and pcsx2 project, so there is no need to also specify
the static libraries as additional linker dependencies.
2015-06-19 22:14:47 +01:00
Jonathan Li
283d4fa57c Use wc_str for Windows only code
This fixes the build for wxWidgets 3.0. The paths are Windows specific,
so c_str and WX_STR already evaluate to a wide string in wxWidgets 2.8.
2015-06-19 22:14:47 +01:00
Jonathan Li
2a7d7b54d3 Fix wxWidgets 3.0 Windows command line help hack
wxWidgets 3.0 now calls Output() instead of Printf() for wxMessageOutput
derived classes. Fix the command line help hack so it works for that.
Also use wxString instead of FastFormatUnicode, it's simply not needed
here.
2015-06-19 22:14:46 +01:00
Jonathan Li
760de9915b Add Virtual Key to WX Key Translator
wxCharCodeMSWToWX() has been removed from wxWidgets 3.0 and the
replacement does not have the same behaviour. Add a replacement function
to translate Windows VK_* keycodes to WXK_ keycodes.
2015-06-19 22:14:46 +01:00
TheLastRar
0be0f13acf dev9ghz: delete leftover registry keys 2015-06-19 15:46:51 +01:00
TheLastRar
0d04ee440d dev9ghz: fix a typo... 2015-06-19 15:39:49 +01:00
Gregory Hainaut
cfff229977 Merge pull request #603 from turtleli/fix-change-language
Fix language panel glitch on Windows
2015-06-19 15:03:27 +02:00
Gregory Hainaut
b44bccec6a gsdx: fix previous commit with a scaling factor 2015-06-18 23:02:40 +02:00
Jonathan Li
ac99735b5b Revert "pcsx2:gui:wx3: wrong order of language in wizard"
This reverts commit 8afd2edd1d and removes
the leading space from "System Default".
2015-06-18 21:05:22 +01:00
Gregory Hainaut
5bc8f046b2 gsdx: fix snow engine issue in native resolution 2015-06-18 21:21:25 +02:00
Gregory Hainaut
d8cf4f83d0 Merge pull request #608 from karasuhebi/master
Changes in title bar: DX -> D3D (plus a grammar fix)
2015-06-18 19:49:57 +02:00
Karasuhebi
4d1ca4bb76 Changes in title bar: DX -> D3D
Changed the name of the Direct3D renderers so they would match the way
they are named in GSdx's Plugin Settings window. Also changed a printf
to say OpenCL instead of opencl.
2015-06-18 13:00:29 -04:00
Gregory Hainaut
ab6f26ff4d Merge pull request #606 from turtleli/gsdx-title-renderer
GSdx: Add renderer type to title bar
2015-06-18 09:49:26 +02:00
refractionpcsx2
f5e8503fa5 GSdx: Didn't need to change this :P 2015-06-17 22:41:16 +01:00
refractionpcsx2
c31c04d3db GSdx: Fix CRC hacks not re-initialising after option change 2015-06-17 22:25:43 +01:00
refractionpcsx2
0b5e0df35d Epic fail Visual Studio! 2015-06-17 22:11:06 +01:00
refractionpcsx2
fc24f039a8 GSdx: Add CRC Management to Windows Dialog.
- Clean up tooltip
- Remove Auto Skip Depth and Disable CRC checkboxes
2015-06-17 22:06:18 +01:00
Jonathan Li
e182251fbc GSdx: Add renderer type to title bar 2015-06-17 21:59:05 +01:00
Gregory Hainaut
1d84af573d ofc I didn't test previous commit ater the merge... 2015-06-17 21:55:37 +02:00
Gregory Hainaut
b2f8fe3593 gsdx: drop the auto skip depth hack
Just use 1 in skip draw if you want to use it

openGL code will soon be fixed to support depth correctly (and I hope dx in the future)

Conflicts:
	plugins/GSdx/GSState.cpp
	plugins/GSdx/GSState.h
2015-06-17 21:53:08 +02:00
TheLastRar
5f068ec46a dev9ghz: Use .ini for saving settings
Import settings from the registry if needed.
2015-06-17 19:24:48 +01:00
Gregory Hainaut
263583ebcc Revert "gsdx-ogl: enable again geometry shader on Mesa"
This partially reverts commit e774fecb77.

Fix issue #605
2015-06-16 18:33:22 +02:00
Gregory Hainaut
c1d39a5f57 gsdx-ogl: drop UserHacks_DateGL4
Initial goal was to avoid slowdown in buggy driver
2015-06-16 09:57:45 +02:00
Jonathan Li
29463b9e52 Fix language panel glitch on Windows
On Windows, the languages displayed in the dropdown box of the language
panel selector are not in alphabetical order. This is caused by the
CBS_SORT window style, which is set by wxCB_SORT, having a ridiculous
sorting order. Remove the option to fix the language order and sort a
minor UI glitch.
2015-06-14 17:11:50 +01:00
Gregory Hainaut
62beb3aaf4 gsdx: don't do bad stuff if aggressive hack isn't enabled 2015-06-14 10:27:02 +02:00
Gregory Hainaut
f765a195e2 gsdx: Don't set CRC function pointer when disabled
Less costly than an extra check for each draw calls
2015-06-14 10:27:02 +02:00
Gregory Hainaut
1699289162 gsdx: move 4 hacks from level2 to level3
remains tons of them :(
2015-06-14 10:27:02 +02:00
Gregory Hainaut
1be8d07f85 gsdx: auto CRC management
Old way various check boxes to configure the plugin

New way an unified drop down list

* Level 0 (dev only) => disable (mostly) all hacks and auto skip depth.
* Level 1 (dev only ) => enable oi/oo/cu hacks, others remains disabled
* Level 2 (GL) => enable most hacks except a couple of one that were fixed on openGL (speed impact)
* Level 3 (DX) => enable all hacks
* Level 4 => enable also aggresive CRC

Note: windows gui must be updated, and it will be nice to create a global tooltip
2015-06-14 10:27:02 +02:00
Gregory Hainaut
c6220bf836 gsdx-debug: print an error on unsupported draw call
Typically GTA
2015-06-14 10:27:02 +02:00
Jonathan Li
5cab4f8b35 Fix includes for Windows wxWidgets 3.0 build
wxWidgets 3.0 and w32pthreads both define mode_t on Windows, causing a
redefinition error. The w32pthreads mode_t doesn't get used, so I've
chosen the wxWidgets definition.

Also add <algorithm> (required by min and max) which is no longer
implicitly included on Windows, and wx/crt.h, required by wxVsnprintf in
wxWidgets 3.0
2015-06-12 18:29:09 +01:00
Jonathan Li
b6375686ff Use standard allocator for pxEventList/wxEventList
wxWidgets3.0 does not have the WXObjectAllocator anymore, so remove it.
2015-06-12 18:29:09 +01:00
bositman
93168069db Merge pull request #601 from TheLastRar/dev9logging
Dev9ghz: Respect user Log dir setting, use PluginLog. Fixes init crashes
2015-06-12 12:08:08 +03:00
TheLastRar
d0af2033e9 Dev9ghz: Respect user Log dir setting, use PluginLog
for logging as it checks if log file was created/opened successfully
Enable full logging in debug builds.
2015-06-11 23:18:25 +01:00
Gregory Hainaut
c11ac928ba Merge pull request #599 from ssakash/patch-12
inclusion of jap version of dr2 in gscrc.cpp
2015-06-11 09:45:41 +02:00
Gregory Hainaut
237ffcf796 gsdx-ogl: Make GL_ARB_draw_buffers_blend optinal for limited DX10 drivers 2015-06-10 22:55:27 +02:00
Akash
343ecca6ba crc hack 2015-06-10 20:13:27 +05:30
refractionpcsx2
72b828ef0d Finish previous revert as TortoiseGit failed epicly at it. 2015-06-10 10:11:06 +01:00
Gregory Hainaut
cbcb7962ce Merge pull request #593 from turtleli/gsdx-cleanup-and-fixes
Gsdx cleanup and fixes
2015-06-10 08:14:44 +02:00
refractionpcsx2
809ccc2479 Revert "Merge branch 'master' of https://github.com/PCSX2/pcsx2"
This reverts commit bbf4b58306, reversing
changes made to 5f201e21ee.
2015-06-09 23:55:46 +01:00
bositman
bbf4b58306 Merge branch 'master' of https://github.com/PCSX2/pcsx2 2015-06-10 01:40:52 +03:00
Jonathan Li
b1acc08c58 GSdx: Linux: Fix wording 2015-06-09 19:30:16 +01:00
Gregory Hainaut
206d2008f3 Merge pull request #582 from PCSX2/external-shader-opengl
external glsl: use define macro for matrix constructor
2015-06-09 19:57:33 +02:00
Gregory Hainaut
d71be88f6a Merge branch 'xsacha-clz' 2015-06-09 19:56:37 +02:00
Gregory Hainaut
d608d97ab7 common: add new file in project and fix condition ordering 2015-06-09 19:56:05 +02:00
Gregory Hainaut
ed9dbd9fae Merge branch 'clz' of git://github.com/xsacha/pcsx2 into xsacha-clz 2015-06-09 19:51:58 +02:00
TheLastRar
3636ebda3c Use CorePlugins to load plugins during FT Config 2015-06-09 19:46:22 +02:00
TheLastRar
430f2159ff SetEmuVersion, pass actual PCSX2 version 2015-06-09 19:46:22 +02:00
TheLastRar
51671e9391 Fix for old GSDX config GUI showing.
during 1st time config.
2015-06-09 19:46:22 +02:00
bositman
5f201e21ee Merge branch 'Alt-FTWizard-GS-Fix' of https://github.com/TheLastRar/PCSX2-Dev9-irq-thread-safer 2015-06-09 16:27:40 +03:00
Gregory Hainaut
4e82073bfc gsdx-ogl: improve setting bilinear of palette
Instead to disable it, uses GS settings
2015-06-09 09:53:50 +02:00
i30817
4e7e7f2dd5 Nocturne, DDS1 and DDS2 CRC hacks to remove motion blur and smudge filter
Signed-off-by: i30817 <i30817@gmail.com>
2015-06-09 00:25:33 +02:00
Gregory Hainaut
2503d9698c gsdx-ogl: re enable bilinear fitlering on palette for paltex mode
However keep it disabled for StarOcean 3 use cases
2015-06-08 21:01:18 +02:00
refractionpcsx2
ce5ccf8a4b Merge pull request #592 from AmbientMalice/master
GameDB: Fix Cold Winter Graphics (vu clamp extra)
2015-06-08 12:20:43 +01:00
Ambient_Malice
f180b2731a Fix Cold Winter Graphics
Game still doesn't look quite right in hardware renderer (too bright)
but the hideous graphics errors are fixed by changing clamp mode. This
game is considered something of a "hidden FPS gem", so it's nice to
think people will be able to play it on PCSX2 now.
2015-06-08 20:03:58 +10:00
Gregory Hainaut
649b46bdfe Merge pull request #591 from Azelphur/master
Fix PCSX2-linux.sh argument passing
2015-06-07 23:15:42 +02:00
Azelphur
548396b3e5 Fix PCSX2-linux.sh argument passing
$@ should be wrapped in quotes, otherwise arguments with spaces do not work eg currently you cannot run any game that has spaces in the filename with this script, this patch fixes that.
2015-06-07 22:13:23 +01:00
refractionpcsx2
2f20e6da65 microVU: Fixed up Cond Branch tBit + eBit. True Crime and DT Racer both work properly now.
- I had the wrong comparison in there, doh!
- tBit was jumping to the wrong place, not sure what games use it though
2015-06-07 20:21:53 +01:00
refractionpcsx2
95c2622b7f Gsdx: Typo'd! 2015-06-07 18:31:51 +01:00
refractionpcsx2
b5171dfe5d Gsdx: De-crapify Native resolution, potential fix for custom resolutions. 2015-06-07 16:57:55 +01:00
refractionpcsx2
0946958acf Gsdx: Height change on Gregory's recommendation :) 2015-06-07 16:12:14 +01:00
Gregory Hainaut
c3c29945b2 gsdx-ogl: only set a cst blend factor when Ad is used
Fix GT4 and potentially FFX
2015-06-07 16:10:59 +02:00
Gregory Hainaut
5daf7aa98f gsdx-debug: keep s_n/pop in sync 2015-06-07 12:39:48 +02:00
Gregory Hainaut
5bf5b5bca4 gsdx-ogl: extend StretchRect to write in depth texture
It will allow to convert color texture to depth texture
2015-06-07 12:39:23 +02:00
Gregory Hainaut
0518aaedc9 gsdx-ogl: unattach palette to avoid noise in debug 2015-06-07 12:39:15 +02:00
Gregory Hainaut
23f8203a22 gsdx-ogl: add some shaders to convert depth <-> color
I'm afraid of rounding error
2015-06-07 12:39:00 +02:00
Gregory Hainaut
a5fe8478ae Merge pull request #575 from PCSX2/gsdx-half-screen-snow-engine-v2
gsdx-texture-cache: Improve fix for snow engine game
2015-06-07 10:18:56 +02:00
Gregory Hainaut
1bd15a0d2b glsl: fix bad copy/past
Thanks  @turtleli
2015-06-07 10:02:39 +02:00
refractionpcsx2
0a467291f9 Gsdx: Height thing didn't work so well, using old buffer width test again 2015-06-07 03:50:34 +01:00
refractionpcsx2
1e83145c0c microVU: Fixed bug in ebit conditional branches (DT Racer) 2015-06-07 03:50:34 +01:00
refractionpcsx2
7ff36afd35 microVU: Improved existing flag hack slightly 2015-06-07 03:50:33 +01:00
refractionpcsx2
51fbb2c313 Put PC references in to COP2 flag warning 2015-06-07 03:50:33 +01:00
Gregory Hainaut
0e3349f953 Merge pull request #590 from PCSX2/OpenGL-printf-corrections-removed-shadow-hearts-crc
OpenGL printf wording corrections, removed Shadow Hearts CRC
2015-06-06 21:56:07 +02:00
bositman
1de58349c5 Bleh 2015-06-06 22:39:34 +03:00
bositman
8d61ab2af2 OpenGL printf wording corrections, removed Shadow Hearts CRC (not used anymore in GSstate)
Some minor grammar fixes to OpenGL prints and removed Shadow Hearts CRC
which has been left behind
2015-06-06 22:28:59 +03:00
refractionpcsx2
1fa13163e4 GSDX: Fix for games which change height but keep the same buffer width
- Fix for games that specify a double height, like Pool Paradise
2015-06-06 20:24:10 +01:00
TheLastRar
93a9ba8b6f Use CorePlugins to load plugins during FT Config 2015-06-06 12:09:19 +01:00
TheLastRar
b7ad408773 SetEmuVersion, pass actual PCSX2 version 2015-06-06 11:17:42 +01:00
Gregory Hainaut
c3dc51826f Merge pull request #541 from TheLastRar/master
DEV9ghzdrk - thread safer calls to DEV9irq
2015-06-06 10:47:32 +02:00
Gregory Hainaut
97467f9e30 Merge pull request #579 from PCSX2/drop-vs2010-support
Drop vs2010 support
2015-06-06 10:47:16 +02:00
Gregory Hainaut
68e44fd354 gsdx: reload the state when GSconfigure is called
It fixes the reloading of openGL option and it avoids
issue during pause/resume.

Fix issue #584
2015-06-06 08:51:53 +02:00
refractionpcsx2
8361369008 Re-add OpenCL project files, remove VS2010 Solution. 2015-06-06 00:49:09 +01:00
TheLastRar
4577f2f0a5 Fix for old GSDX config GUI showing.
during 1st time config.
2015-06-06 00:42:53 +01:00
refractionpcsx2
151fe43551 Vif Unpacks: After further tests on the PS2, think i have these down.
-Corrections to V3-16, the rest was right (woohoo!)
2015-06-06 00:05:52 +01:00
Gregory Hainaut
ce2b87343b fix linux compilation sigh... 2015-06-06 00:25:26 +02:00
Gregory Hainaut
7e662c50d4 Revert "gsdx: always restore the full gs state object (s_gs)"
This reverts commit 2ea049b5a5.
2015-06-06 00:22:15 +02:00
Gregory Hainaut
091f0d5ee9 Merge pull request #585 from turtleli/fix-broken-aligned-malloc
Fix AlignedMalloc on Windows
2015-06-05 23:34:26 +02:00
Jonathan Li
467e40fa81 Fix AlignedMalloc on Windows 2015-06-05 21:55:17 +01:00
Gregory Hainaut
a2a9b6252a common: fix compilation 2015-06-05 21:18:21 +02:00
Gregory Hainaut
4feeaac7d1 Merge branch 'alignment' of git://github.com/xsacha/pcsx2 into xsacha-alignment
Gregory: Get all changes but keep C11 code path which will be the future
 (if someone can find info on Visual Studio support)
* Keep the old posix api to use address sanitizer on gcc 4.9

Conflicts:
	common/build/Utilities/utilities.vcxproj.filters
	common/build/Utilities/utilities_vs2012.vcxproj.filters
	common/build/Utilities/utilities_vs2013.vcxproj.filters
	common/include/Utilities/MemcpyFast.h
	common/include/Utilities/StringHelpers.h
	common/src/Utilities/AlignedMalloc.cpp
	common/src/Utilities/vssprintf.cpp
	plugins/GSdx/stdafx.cpp
2015-06-05 20:31:14 +02:00
Gregory Hainaut
e774fecb77 gsdx-ogl: enable again geometry shader on Mesa
Please use a recent Mesa version (10.5 if possible)
2015-06-05 18:59:10 +02:00
Gregory Hainaut
868d82a22b Merge pull request #574 from AdmiralCurtiss/gui-hotkeys-in-menu
Show default keyboard shortcuts in the menu next to Save and Load State.
2015-06-05 18:49:28 +02:00
Gregory Hainaut
6c8f7a0147 Merge pull request #580 from PCSX2/issue-565-option
gsdx: always restore the full gs state object (s_gs)
2015-06-05 17:51:02 +02:00
refractionpcsx2
46b0a790d4 Vif: Fix up V2-32 and V3-32 Indeterminate Data on MTVU
- MTVU didn't do this correctly as it relied on vif packet size to check alignment, which it doesn't know.
- Packet sent to MTVU was too small for V3-32 to work properly, rounded up to nearest QW
- V2-32 fixed up on interpreter which was just wrong, can't fix V3-32 in it's current setup, but who cares ;)

These could still be wrong, but I can't confirm this until i run larger tests on my PS2
2015-06-05 16:24:03 +01:00
Gregory Hainaut
b49d65295f Merge pull request #457 from PCSX2/clean-gcc-flags
cmake: use O2 instead of every compiler flags
2015-06-05 16:26:42 +02:00
Gregory Hainaut
7d124e6a83 gsdx-texture-cache: Improve fix for snow engine game
Instead to hardcode the half-buffer size to 0x140, the new code
compute it.

To avoid regression, I limit the code to big target (>= 1024 pixels)
2015-06-05 09:06:12 +02:00
refractionpcsx2
65b83a36a7 GSDX: Removed some printf's I left in. 2015-06-05 00:13:21 +01:00
refractionpcsx2
91f775f3f0 GSDX: Fixed up some of the scaling height settings
-Last commit broke Snowblind games again
-Width now based on output circuit
-Try to use the smallest possible while being at least the size of the screen
2015-06-05 00:12:15 +01:00
Gregory Hainaut
6f4ec98bc3 gsdx: try to reduce the size of target as much as possible
I suspect too consume too much memory (issue #576)
2015-06-04 22:15:52 +02:00
Gregory Hainaut
f8f6117ea9 gsdx-debug: allow to track texture move
Very painful for the cache and the performance
2015-06-04 22:10:04 +02:00
Gregory Hainaut
880900d306 external glsl: use define macro for matrix constructor
This way, matrix can be filled by column in glsl and by row in hlsl
2015-06-04 21:03:59 +02:00
Gregory Hainaut
979ea92754 gsdx: make png++ optional
Some distributions (Fedora) doesn't have a png++ package...
2015-06-04 20:22:05 +02:00
Gregory Hainaut
bd2c04a0ec ooups bad copy/past 2015-06-04 19:58:58 +02:00
Gregory Hainaut
cf6eae7bab debian: drop very old conflict/replace 2015-06-04 19:35:41 +02:00
Gregory Hainaut
2ea049b5a5 gsdx: always restore the full gs state object (s_gs)
It will force a reload of opengl option
2015-06-04 18:29:31 +02:00
Gregory Hainaut
c2e851b3a5 gsdx-ogl: don't use slow SW blend for nothing
When A == B, coeff is 0 so <= 1
When C == 2, just check the value of coeff

Barely faster in accurate_blend = 2
2015-06-04 18:18:47 +02:00
Gregory Hainaut
dd5868f9ba Also remove file of 3rdparty 2015-06-04 08:56:19 +02:00
Gregory Hainaut
ba5b367ae8 drop support of Visual Studio 2010
* Severals PR uses C++11 features
* 2015 will soon be released
* Win 10 will soon be released

Time to upgrade
2015-06-04 08:55:22 +02:00
Gregory Hainaut
85266abd71 gsdx-ogl: use a 8MB vbo/ibo
Dirge of Cerberus draw 143,360 vertices in a single draw!

It is likely to emulate a particle effects

Hopefully improve issue #573
2015-06-04 08:28:40 +02:00
bositman
e34477a497 Merge pull request #547 from pgert/master
GSdx > HW-hacks > Rewording comments on duplicate CRC's and minor cleanup
2015-06-03 15:58:28 +03:00
Gregory Hainaut
0d5d94f56e Merge pull request #570 from ssakash/patch-3
Three new Opengl settings for Windows [GUI]
2015-06-03 14:01:39 +02:00
Gregory Hainaut
3dd3bf6e2b gsdx-ogl: new hidden option accurate_blend = 2
Debug option to emulate all blending draw call in the shader

Of course it is slow but it is very accurate
2015-06-03 09:56:07 +02:00
Gregory Hainaut
cd6c93cd9e gsdx: silly mistake 2015-06-03 09:31:52 +02:00
Admiral H. Curtiss
c9e9df95ac Show default keyboard shortcuts in the menu next to Save State and Load State.
I can't figure out how to get the keycodes that have been modified by PCSX2_keys.ini, but this should give a decent base. I think you would just need to call AppendKeycodeNamesToMenuOptions again after GlobalAccels has been updated correctly, if I'm understanding this right, but I couldn't get it to work.
2015-06-03 01:02:16 +02:00
Akash
f2d193edcf Add three new Opengl options. 2015-06-02 16:02:56 +05:30
Gregory Hainaut
995ae51bf4 gsdx-ogl: disable a log message
Too verbose and code was fixed anyway
2015-06-02 09:28:35 +02:00
Gregory Hainaut
9fe13f7a6b gsdx linux: fix a memory leak
Not important but pollute the valgrind log
2015-06-02 09:28:35 +02:00
refractionpcsx2
b906217504 GameDB: Update some patches by prafull 2015-06-02 01:10:32 +01:00
refraction
4914620178 GSDX: Fix for 6x Native, fixed GH3 in native mode taking up quarter of the screen after the snowblind changes 2015-06-01 19:04:39 +01:00
Gregory Hainaut
2cbde89084 Merge pull request #555 from PCSX2/real-fb-format
GSdx: better framebuffer format
2015-06-01 11:48:07 +02:00
Gregory Hainaut
f81cf360bc Merge pull request #545 from PCSX2/gsdx-half-screen-snow-engine
Gsdx half screen (most of) snow engine games
2015-06-01 11:47:40 +02:00
Gregory Hainaut
d793ef85df Merge pull request #358 from PCSX2/baseblock-minor-clean
core: use memcpy and reserve function
2015-06-01 11:18:03 +02:00
Gregory Hainaut
9fa473a57d gsdx-ogl: glDebugMessageCallback is optional
Not even used in release build
2015-05-31 17:55:34 +02:00
Gregory Hainaut
9d69ff1f91 gsdx-debug: create the savef option
The idea is to easily extract bad frame from gs dump and to compare them
with the sw renderer.

Here the summary of the options:
savet => dump all input textures
save  => dump the render target
savez => dump the depth buffer
savef => dump the frame
2015-05-31 17:38:52 +02:00
Gregory Hainaut
d301848848 gsdx-ogl: fix paltex on opengl
RT uses as palette must use the alpha channel

Palette texture uses the red channel
2015-05-30 19:01:09 +02:00
Gregory Hainaut
2f2ae2bc89 gsdx-ogl: enable gl tracing on windows
Trace info is enabled in dbg/dev build for the opengl renderer

Info is stored in GSdx_opengl_debug.txt when debug_opengl option is 1
2015-05-30 09:58:47 +02:00
Gregory Hainaut
009dd103ae gsdx-ogl: protect the trace with if statement
And mark the function as optional
2015-05-30 09:58:46 +02:00
Gregory Hainaut
a639634769 gsdx-ogl: actually code use 4.0 GL_ARB_draw_buffers_blend
It is used for glBlendEquationSeparateiARB && gl_BlendFuncSeparateiARB

The 3.0 function could work too. It just need to be added
2015-05-30 09:58:46 +02:00
Gregory Hainaut
92d68b70d3 gsdx-ogl: add a performance note for later
The idea will be to replace StretchRect for standard case with a framebuffer
blit. Potentially it toggles less gl state.

Worth a test on Star Ocean 3 that uses a lots this function for stencil emulation
2015-05-30 09:58:46 +02:00
refraction
426fcf3afc Reverted microVU flag hack, it did nothing it wasn't already doing. 2015-05-29 22:56:53 +01:00
Gregory Hainaut
01e4a5148d gsdx-ogl: avoid crash in debug/dev build
Don't be silly, don't put gl trace in EE thread.
2015-05-29 16:50:27 +02:00
Gregory Hainaut
0cb6c37f14 gsdx-tc: add an explanation of the magic number 0x140 2015-05-29 12:27:05 +02:00
refraction
97b237712c gsdx: detect RT size based on fb size and gs output configuration
* It is required for snowbling games
* Targets of Texture cache are dropped.
2015-05-29 12:26:44 +02:00
Gregory Hainaut
02274601b3 gsdx-ogl: always copy texture into 0,0 2015-05-29 12:18:54 +02:00
Gregory Hainaut
e5326d1bd2 gsdx-tc: allow to reuse the right part of large RT as source 2015-05-29 12:18:54 +02:00
Gregory Hainaut
7ac533a4d1 gsdx-tc: invalidate half-RT src
snow engines uses the RT as 2 half RT.
2015-05-29 12:18:54 +02:00
Gregory Hainaut
da0b77e09b gsdx-ogl: new logo
Thanks bmate for the logo.

Close issue #192
2015-05-29 11:05:52 +02:00
refraction
ef420e41fe microVU: Nothing to see here
Left an if statement in which shouldn't have been there, whoops.
2015-05-28 21:46:17 +01:00
refraction
8f54da5fd3 GSDX: Removal of Nvidia hack.
- Hack no longer required as an option as a safe and simple workaround has been discovered which seems to work without modifying any vertices.
2015-05-28 21:41:02 +01:00
refraction
910dcfafdd microVU hack: Forgot tooltip update 2015-05-28 21:34:03 +01:00
refraction
5d00c00826 GSDX: Fixed UserHacks_AutoSkipDrawDepth dialog creation on windows.
- CheckDlgButton was just wrong
- Changed tag to say "Auto-skip depth" as you could only see "Auto-skip draw" which was highly ambiguous on GSDX!
2015-05-28 21:21:19 +01:00
refraction
d8343cea2a microVU: New improved flag speedhack.
- Now does Mac Flags as well pretty safely
- Speedup is anywhere from nothing to ~30fps (latter is DQ8 + MTVU)
2015-05-28 21:13:48 +01:00
TheLastRar
66b08c0b2f Use Mutex to control writes to the RX_Frame counter
A user on http://obsrv.org had an issue with freezing, unfreezing than
dying on other players screen, but can continue playing anyway. This
comment didn't end up fixing the issue of becoming a ghost, but he
didn't freeze.
2015-05-28 20:22:38 +01:00
Gregory Hainaut
31ffdd8c53 Merge pull request #559 from ssakash/patch-5
Auto depth skip hack initialization.[GUI]
2015-05-28 19:21:45 +02:00
Gregory Hainaut
cbca0692ed Merge branch 'ssakasht push origin master-patch-3' 2015-05-28 18:31:35 +02:00
Gregory Hainaut
8e32d71c07 Merge branch 'patch-3' of git://github.com/ssakash/pcsx2 into ssakash-patch-3 2015-05-28 18:30:49 +02:00
Akash
5f7e09268c change "D3D Internal Resolution" to "Internal Resolution" 2015-05-28 16:33:16 +05:30
Akash
bf743fec17 add logo for Opengl renderer. 2015-05-28 01:34:51 +05:30
Gregory Hainaut
83afc0622c Merge branch 'Sarania-update-manual-gamefix-text' 2015-05-27 18:55:53 +02:00
Gregory Hainaut
f1b5948fae Merge branch 'update-manual-gamefix-text' of git://github.com/Sarania/pcsx2 into Sarania-update-manual-gamefix-text 2015-05-27 18:53:40 +02:00
Gregory Hainaut
87bcb465c6 common: fix gcc 5.0 issue
Don't use const for variable object

Close issue #560
2015-05-27 18:20:06 +02:00
Blyss Sarania
db37d37ed9 Update manual game fix panel text
Add some text telling users that the game fixes do not speed up games.
We have many users who have followed a
Youtube guide enabling all these and breaking their games. Hopefully
this will mitigate that.
2015-05-26 17:25:31 -05:00
Gregory Hainaut
c43ddaec4f gsdx: add Castlevania hack explanation 2015-05-26 17:03:13 +02:00
Gregory Hainaut
419dfe0544 glsl: redo color/alpha management correction
Please test it!

GS supports 3 formats for the output:

32 bits: normal case
=> no change

24 bits: like 32 bits but without alpha channel
=> mask alpha channel (ie don't write it anymore)
=> Always uses 1.0f as blending coefficient

16 bits: RGB5A1, emulated by a 32 bits openGL texture. I think it will be more correct to use
a real 16 bits GL texture. Unfortunately it would cost several (slow) target conversions.
Anyway as a current solution
=>  apply a mask of 0xF8 on color when SW blending is used (improve Castlevania shadow)
unfortunately normal blending mode still uses the full range of colors!

This commit also corrects a couple of blending factor. 128/255 is equivalent to 1.0f in PS2, whereas GPU uses 1.0f. So the blending factor must be 255/128 instead of 2

Note: disable CRC hack and enable accurate_colclip to see Castlevania shadow ^^
(issue #380).
Note2: SW renderer is darker on Castlevania. I don't know why maybe linked to the 16 bits format poorly emulated
2015-05-26 16:49:43 +02:00
Akash
ef3247c233 Update copyright license 2015-05-26 19:15:30 +05:30
Akash
99f9407c24 Auto depth skip hack initialization. 2015-05-26 19:13:56 +05:30
Gregory Hainaut
9ee3a173d0 gsdx-ogl: use a local ALPHA register
It would allow to easy tune the parameter to support 24 bits format
2015-05-26 15:36:48 +02:00
Gregory Hainaut
d31bd97d59 gsdx-ogl: add a variable to select FB output
Either 32bits/24bits/16bits
2015-05-26 14:59:07 +02:00
Gregory Hainaut
93c0d5a268 gsdx-ogl: add an error message when a RT is reused with a format cast
For example a 32 bits RT could be used as a 16 bits RT.

It is likely the source of various bug in HW renderer
2015-05-26 11:16:49 +02:00
Gregory Hainaut
6326f72ed4 debian: bump wx to 3.0 + add libpng 2015-05-26 11:15:13 +02:00
Gregory Hainaut
a3bbe68d56 gsdx: throw an exception when we miss a mandatory gl feature
Gracefully quits when driver is not supported
(like nvidia legacy driver for GTX260)

Please test the impact on windows
2015-05-26 11:03:59 +02:00
Gregory Hainaut
3be5a6036b gsdx-ogl: remove assertion + debug message
opengl use a different object to compute the vertex count
2015-05-26 11:03:59 +02:00
refraction
b84a462798 Unreachable code message was annoying me. 2015-05-26 00:30:12 +01:00
avih
ff7aeb7808 Merge pull request #553 from AdmiralCurtiss/game-database-writer-fix
Fix off-by-one error in the Game Database Editor (unused legacy code).
2015-05-25 18:40:26 +03:00
Admiral H. Curtiss
e31a2c0733 AppGameDatabase: Fix off-by-one error when writing changes in the Game Database dialog.
Did no one ever use this feature? If git blame is accurate this has been
in the codebase since 2011...
2015-05-25 15:22:23 +02:00
Gregory Hainaut
2704a65f57 gsdx: add some info for Star Ocean3/Valkyrie Profile 2/Radiata Stories
Feel free to test those games with CRC disabled on the openGL renderer (native resolution)
2015-05-25 12:37:48 +02:00
Gregory Hainaut
580d177951 gsdx: improve commit 11708486d8
This time linear filtering is disabled only for the bad draw call
(RT used as a palette texture).
2015-05-25 09:46:51 +02:00
Gregory Hainaut
99d7434671 gsdx-ogl: disable SSO on nouveau 2015-05-24 19:24:10 +02:00
Gregory Hainaut
11708486d8 gsdx: allow to control the filtering of texture cache
When the RT is used as an input texture, we need to rescale it.

Previous behavior was to always uses a linear filtering (more smooth).
Unfortunately it broke some games that expected an exact value like Star Ocean 3

This commit will disable the linear filtering in normal filtering mode (filter = 0
or filter = 2)

This way, shadow of Star Ocean 3 will appear correctly in upscaling (not
100% perfect but can't do better)

Note: SO3 only requires a nearest sampling of the alpha channel but
I don't know the behavior for others games.
2015-05-24 18:59:27 +02:00
Gregory Hainaut
b0af54d33e gsdx-ogl: better support of palette
The purpose of the code is to support alpha channel
of RT uses as an index for a palette texure.

I'm afraid that code will likely break pure palette texture. Only used
if paltex is enabled

It fixes missing shadow in Star Ocean 3 (issue #374) in Native resolution
with filter = 0  (no filtering) or = 2 (normal fitering)

Rendering explanation:
The game emulates a stencil buffer with the alpha channel

The alpha channel of the RT can contains a palette texture index (format 4HH)
The idea is to have a gradient of value in the palette (16/32/48/...).
This way you can implement a +16/-16 and even wrap the alpha value every time
you hit the pixel.

Bilinear filtering breaks the rendering because it interpolates between counts
so you doesn't have the exact count

Upscaling breaks the rendering because the RT is reused as an input texture. It means
that we need to scale it down which again create some interpolations.
2015-05-24 18:07:16 +02:00
Gregory Hainaut
951a1fed94 gsdx-hack: enable auto skip of depth texture for God of War
Rendering is quite complex to emulate on the GPU due to several limitation.
Until we find a solution let's enable the old solution

You could find a description of the rendering here:
http://forums.pcsx2.net/Thread-God-of-War-Red-line-rendering-explained
2015-05-24 13:43:36 +02:00
Gregory Hainaut
a70c3bf5de glsl: correct the alternate implementation of ps_main1
Still not yet enabled by default

Potentially it can be optimized with the dot product but special care
need to be taken to ensure float accuracy.

Bonus: it could work on old GPU (aka DX9)
2015-05-24 13:43:36 +02:00
Gregory Hainaut
c82fd94c6c gsdx-debug: use GL_INS instead of printf 2015-05-24 13:43:36 +02:00
Gregory Hainaut
c01686d252 gsdx-png: add a fixme message for 16 bits by channel image 2015-05-24 12:51:20 +02:00
Gregory Hainaut
7f614401a6 gsdx-ogl: set accurate_blend as default
Rendering is better and I think speed impact remains small.
2015-05-23 15:10:04 +02:00
Gregory Hainaut
c507e816c2 gsdx-ogl: oups forget a break 2015-05-23 13:06:23 +02:00
Gregory Hainaut
b884e0c0c0 gsdx-debug: improve debug experience
* Dump context before the increase of s_n
  => aligned with the global call number
* Don't print colclip not supported when it is optimized away
* dettach the input texture when it is useless
  => avoid to show a wrong texture in the debugger
2015-05-23 12:23:05 +02:00
Gregory Hainaut
f665180d11 gsdx-debug: use hex number for texture pointer
Easier to grep
2015-05-23 12:20:26 +02:00
Gregory Hainaut
7609fdc576 gsdx: rename too much sr to sRect 2015-05-21 09:48:15 +02:00
Gregory Hainaut
b52ee6f1f6 gsdx-linux-gui: add an option for accurate color clipping
Note: it is only for debug purpose

Sotc testcase 187 fps => 125 fps (2x scaling)
2015-05-20 09:42:22 +02:00
Gregory Hainaut
183af4ece6 gsdx-ogl: don't enable SW blending when there is no blending
Mostly to avoid useless message
2015-05-20 09:36:01 +02:00
Gregory Hainaut
3d35e4f8ec gsdx-ogl: implement all blends mode in shader
+ 250 lines !!!
2015-05-20 09:11:36 +02:00
Gregory Hainaut
2d54d59add gsdx-ogl: update assertion ps sel is 8B now 2015-05-20 08:40:08 +02:00
Gregory Hainaut
d3d5a436ea gsdx-ogl: add code to read back depth texture 2015-05-20 08:07:40 +02:00
Gregory Hainaut
a4c74ef872 gsdx-ogl: disable GL_DITHER
I really don't know the impact but it is not supported with integer texture.
2015-05-20 08:05:27 +02:00
Gregory Hainaut
8d3e3e6c5b gsdx-ogl: more blend rework to support accurate_colclip
So far few blending equations are implemented in PS. It is only
for test the behavior on GoW
2015-05-20 08:00:40 +02:00
Gregory Hainaut
c5341a2711 gsdx-ogl: update blending management
This way it will allow to implement all blendings operartion in FS.

Of course it will be slow, but it would be nice for debug and quickly check
game error rendering.
2015-05-20 00:12:52 +02:00
Gregory Hainaut
358e0d445b gsdx-ogl: add a shader to convert depth texture into uint 2015-05-19 18:56:32 +02:00
Gregory Hainaut
18a6403852 common-wx3: fix nasty bug between overload function of pxOnAssert 2015-05-19 17:40:38 +02:00
Gregory Hainaut
ac38ebbf29 Merge pull request #546 from ssakash/patch-3
enables Anisotropic filtering option for OGL (HW mode) [Windows UI]
2015-05-19 15:20:12 +02:00
Gregory Hainaut
ec45090358 glsl: implement an alternative of convert 1 shader
Code not yet enabled. Quick test show no heavy regression but I need
to carefully validate it.
2015-05-19 13:14:18 +02:00
Gregory Hainaut
a12acc0d24 gsdx-ogl: clean a bit Texture Cache OGL
Add a placeholder for depth format but nothing done yet.
2015-05-19 13:14:18 +02:00
Gregory Hainaut
1837001e75 gsdx: extend CopyOffscreen with a new shader parameter
Currently we're trying to infer the conversion shader based on the output format

It only works if the input data is RGBA8. It might not be true in the future
2015-05-19 13:14:18 +02:00
Gregory Hainaut
9554b5dd56 gsdx-lzma: drop CONCAT flag
I have some issue with it. Unlikely to use multi-stream gs anyway
2015-05-19 13:14:18 +02:00
Gregory Hainaut
fa761a129d gsdx-linux: add an option to enable/disable recording
Avoid to kill the computer/application if the user press F12 by accident
2015-05-19 13:14:18 +02:00
Gregory Hainaut
4c7b151851 debian: drop libglew dependency
It was only required for zzogl
2015-05-19 13:14:18 +02:00
Gregory Hainaut
1518a57284 Merge pull request #548 from nE0sIghT/fix-desktop
Fix .desktop file
2015-05-19 12:57:24 +02:00
nE0sIghT
19febdad06 Changed executable to "env __GL_THREADED_OPTIMIZATIONS=1 PCSX2" 2015-05-18 22:03:28 +03:00
nE0sIghT
19391b71cc Changed icon name in PCSX2.desktop to uppercase 2015-05-18 22:03:01 +03:00
Gregory Hainaut
34202933da GSdx-linux-recorder: add various option to control it 2015-05-18 19:57:21 +02:00
Gregory Hainaut
388f46b577 gsdx-png: use array interface instead of set_pixel
Doc says it is "non-checking equivalent of set_pixel". Still slow as ass

At least syntax is nicer
2015-05-18 17:25:14 +02:00
Gregory Hainaut
a4d6722b26 gsdx-thread: add a CAPACITY parameter to GSJobQueue 2015-05-18 17:08:18 +02:00
Gregory Hainaut
e7665ee7dd gsdx-linux-recorder: upgrade code to use n threads
Unfortunately it requires too much memory (easily 6GB)
2015-05-18 16:56:44 +02:00
Gregory Hainaut
cff168e002 gsdx-linux-recorder: implement multithread to save the image
Currently only a dedicated thread. It is still too slow!
2015-05-18 16:56:44 +02:00
Gregory Hainaut
012f1b4f05 gsdx-thread: remove deprecated boost code 2015-05-18 16:55:49 +02:00
Gregory Hainaut
19d9349b0b gsdx-debug: remove old assert 2015-05-18 16:45:38 +02:00
pgert
c9508298b4 Update GSCrc.cpp 2015-05-18 16:37:28 +02:00
Akash
70b8772bb4 enables Anisotropic filtering option for Opengl (Hardware mode) [Windows UI] 2015-05-18 19:16:22 +05:30
Gregory Hainaut
503459798a gsdx-linux: add a basic implementation to record the gameplay as png file
The idea was to merge them later with ffmpeg or other external tool

It kinds of work but current fps is around 2 !!! So not really usable

The speed issue is related to PNG.

So either the code to store pixels data must be optimized. Or maybe it misses some MT loves :)
2015-05-18 11:56:20 +02:00
Gregory Hainaut
2783da4a22 gsdx-ogl: use a local buffer to store offscreen texture
It will allow to read texture in // (and potentially could be useful
for recording)
2015-05-18 11:29:04 +02:00
Gregory Hainaut
79a9254894 gsdx-ogl: print some error messages if extenal shader is wrongly configured 2015-05-18 10:56:32 +02:00
Gregory Hainaut
f2e8785cb0 forget 2 files + upgrade googledoc path to github path 2015-05-18 10:14:19 +02:00
Gregory Hainaut
8d6d8067fd linux: rename everything. It is PCSX2 is uppercase letter
Sorry for all maintainers that will need to upgrade their packages
2015-05-18 10:04:23 +02:00
Gregory Hainaut
5bd724e651 PCSX2-linux.sh: update the script due to the renaming 2015-05-18 09:55:17 +02:00
Gregory Hainaut
432a73e039 Rename the linux launcher script 2015-05-18 09:51:09 +02:00
Gregory Hainaut
bf0213ca47 linux: rename pcsx2-* exe file to PCSX2
Alwawys the same name and uppercase
It was useful on the past to reduce compilation time but there is
less plugins now and ccache just does the job fine.
2015-05-18 09:49:59 +02:00
Gregory Hainaut
4787565e14 linux: reduce complexity of launch_pcsx2_linux.sh script
Don't screw up the shell context so no need to restore it. As a bonus, it supports
interruption(kill/abort) properly
2015-05-18 09:26:34 +02:00
Gregory Hainaut
540717b295 gsdx-ogl: don't force logz only on debug build 2015-05-18 07:24:26 +02:00
Gregory Hainaut
eb59f8b72c i10n: update tr_TR (turkish) 2015-05-18 07:23:28 +02:00
Gregory Hainaut
5c046180a1 cmake: properly add detection of lzma
Code is 100% optional.

Code will allow be enabled if lzma-dev is installed at compile time
2015-05-17 22:08:10 +02:00
Gregory Hainaut
98dde32dc0 gsdx-replayer-linux: use new code to allow loading of .gs.xz dump
A bit slower at startup but it saves a lots of disk space!

Reduce the size of my gs collection of 11GB :)
2015-05-17 22:08:10 +02:00
Gregory Hainaut
e93f780268 gsdx-replayer-linux: separate a bit parsing and executing code
It would ease the porting of the code to read xz file
2015-05-17 22:08:10 +02:00
Gregory Hainaut
86e3c18c33 gsdx-linux: add code to read xz file
Linux only to avoid the extra dependency on windows
2015-05-17 22:08:10 +02:00
Gregory Hainaut
5cfb496700 gsdx-ogl: only open debug file once 2015-05-17 14:43:56 +02:00
Gregory Hainaut
7979dec5b0 gsdx-ogl: optimize colclip 0
Currently colclip uses 2 passes to wrap the output of blending unit

However some blending mode are only a plain copy (of 0 or Cs or Cd).
So no overflow of [0:255], no need to wrap it

Note: I saw those cases in GoW.
2015-05-17 13:05:08 +02:00
Gregory Hainaut
6ced837360 gsdx-debug: add some PERF info in trace
The idea is to detect easily effect that are known to be slow on opengl
2015-05-17 13:05:08 +02:00
Gregory Hainaut
818412ba26 gsdx-debug: fix a crash in trace 2015-05-17 13:05:08 +02:00
Gregory Hainaut
b1ea081fc3 gsdx-debug: improve tracing interface
Basically move the format and c_str() in the macro
2015-05-17 13:05:08 +02:00
Gregory Hainaut
b8aa5f8f80 gsdx-debug: more trace for the texture cache 2015-05-17 13:05:08 +02:00
Avi Halachmi (:avih)
3bd3ba4faf gui: speedhacks: disable restore-defaults when Presets is used
The Restore-Defaults button and the Presets checkbox are inherently conflicting
since both of them apply (different) sets of values to the speed hacks, however
the Preset also applies values to other panels.

Now the relation between the Defaults button and Preset is consistent with
other panels (EE/VU) where Defaults already got disabled when Presets is used.

Before this patch (and also before the previous one which fixed the locking),
clicking restore-defaults while Presets was checked resulted in incorrect state
where Preset is checked but the speed hacks are both unlocked and also didn't
necessarily match the selected preset. Now this can't happen.
2015-05-16 23:42:43 +03:00
Avi Halachmi (:avih)
bbf7153acd gui: fix: Apply on disabled speedhacks now locks the panel
When speed hacks are disabled, clicking Apply should keep the panel grayed-out,
but it didn't before (though it was still correctly locked/unmodifyable).
With this patch it also looks correctly grayed out.

It's not clear if it's a wxWidgets issue or pcsx2 issue since with wxWidgets 3
there doesn't seem to be an issue (see posts at issue #543).

Regardless, this patch makes a cleaner separation between widgets values
([un]checked etc) and widgets states - lock(grayed-out)/unlocked.

The patch only modifies when widgets are grayed and should not affect the actual
values (therefore should not change the behavior other than visuals), but do
keep an eye for weird behavior since this is sensitive code.

Should fix #543
2015-05-16 22:32:53 +03:00
Gregory Hainaut
8a73849531 gsdx-ogl: enable multithread driver by default for nvidia
+ add a linux gui option to disable it (for test purpose)
2015-05-16 15:22:20 +02:00
Gregory Hainaut
c567198967 gsdx-ogl: replaced draw_count by s_n
This way error message is aligned with everything else :)

It is not perfect (normally it must be done in start of main draw)
2015-05-16 13:59:13 +02:00
Gregory Hainaut
62e0e6a067 gsdx: remove deprecated code
Core was fixed to call GSFifo in the good thread
2015-05-16 13:52:16 +02:00
Gregory Hainaut
2165c68938 oups forget a couple of break 2015-05-16 13:26:55 +02:00
Gregory Hainaut
02b478dfbc gsdx: plug the new PNG wrapper
Drop various duplicated code :)
2015-05-16 12:47:28 +02:00
Gregory Hainaut
8cd533304c gsdx: new dependency on linux => png++
Note: it is only header file that wrap the standard png (which was
already mandatory for wx/sdl)
2015-05-16 12:47:28 +02:00
Gregory Hainaut
cab59587e8 gsdx: add a PNG wrapper
Normally it supports all formats but I didn't have luck with 16 bits depth gray
2015-05-16 12:32:05 +02:00
Gregory Hainaut
3f278382a1 gsdx-debug: dump all drawing register
Thanks PERL
2015-05-16 11:16:33 +02:00
Gregory Hainaut
8341055f3e gsdx-ogl: don't enable ogl_texture_storage on catalyst 2015-05-16 00:31:25 +02:00
Gregory Hainaut
a2d605be0b gsdx: copy past mistake
Let's always increment the s_n counter
2015-05-16 00:31:25 +02:00
Gregory Hainaut
cfddcb7a93 gsdx-ogl: typo 2015-05-16 00:31:25 +02:00
Gregory Hainaut
0f01ba4c46 gsdx-ogl: mega boost
Enable Nvidia multi thread driver optimization
Enable ogl_texture_storage by default (requires for the speed boost
, later the option will be removed)
2015-05-16 00:31:25 +02:00
Gregory Hainaut
a1bfb237e6 Partially Revert "gsdx-ogl: drop support of GL_ARB_clear_texture extension"
This reverts commit 03e72781aa.

Let's add back the clean texture pointer

I want to test it on
1/ DSA
2/ MT driver
2015-05-16 00:31:25 +02:00
refraction
534fa65ecf Fix for VS2013 microVU debug logging 2015-05-15 20:22:03 +01:00
Gregory Hainaut
28bb64aae8 gsdx: sed/dr/dRect/ 2015-05-15 20:49:32 +02:00
Gregory Hainaut
445c28fe97 gsdx: sed/sr/sRect/ 2015-05-15 20:47:14 +02:00
Gregory Hainaut
d566bb2a23 gsdx: sed /st/sTex/ 2015-05-15 20:45:31 +02:00
Gregory Hainaut
6a9e425308 gsdx: sed /dt/dTex/ 2015-05-15 20:44:15 +02:00
Gregory Hainaut
d870188d21 gsdx: sed/o/off/ 2015-05-15 20:40:09 +02:00
Gregory Hainaut
27d485a940 drop a file that was wrongly commited 2015-05-15 20:34:09 +02:00
Gregory Hainaut
6166c95325 gsdx-ogl: protect PBO with fence
Safer and doesn't impact perf too much.
2015-05-15 18:32:47 +02:00
Gregory Hainaut
a5e424512c gsdx-ogl: really avoid consecutive clean 2015-05-15 16:00:46 +02:00
Gregory Hainaut
84c3592fbe gsdx-debug: more debug message/group 2015-05-15 16:00:45 +02:00
Gregory Hainaut
08291aed0c gsdx-ogl: color state impact the clean command 2015-05-15 15:25:45 +02:00
Gregory Hainaut
613e215c73 gsdx-ogl: add some note for the persistent buffer + add a flush
Persistent is slower (at least on my gs dump) because data is put
in  host instead of the video memory

I don't understand why upload the data directly to the video memory
is faster
2015-05-15 15:25:45 +02:00
Gregory Hainaut
5628bfb20c gsdx-ogl: drop old code
I have group so it doesn't pollute anymore gl trace
2015-05-15 15:25:45 +02:00
Gregory Hainaut
7f2bbdceb9 Merge pull request #542 from PCSX2/gsdx-issue-539
gsdx-recorder: use recursive mutex
2015-05-14 19:38:44 +02:00
Gregory Hainaut
88a714327a linux-zzogl: don't build anymore zzogl by default
Sadly, no time to maintain it neither to improve it.

Note: I think new openGL 4.x feature would make the plugin faster

Anyway, now GSdx-ogl is probably better than zzogl
2015-05-14 17:38:42 +02:00
TheLastRar
ff4cf51494 use volatile 2015-05-14 13:23:09 +01:00
Gregory Hainaut
6d8695127f gsdx-recorder: use recursive mutex 2015-05-14 11:56:07 +02:00
TheLastRar
a0ec633c46 Provide a DEV9async and use it to call irq 2015-05-13 10:04:04 +01:00
Gregory Hainaut
bd96a73580 gsdx-debug: trace texture cache hit/miss/removal
Actually only a small part but I think it is enough to help debugging
tc issue.
Only enable it on debug because it is quite verbose
2015-05-13 09:01:04 +02:00
Gregory Hainaut
5e9a3a424e Merge pull request #479 from PCSX2/gsdx-texture-cache
gsdx: value was wrongly overwritten
2015-05-13 08:08:46 +02:00
Gregory Hainaut
b7a9465963 gsdx-ogl: update the device to use the new texture flags
Hopefully it will increase a bit the speed
2015-05-12 18:18:20 +02:00
Gregory Hainaut
3e784d57e8 gsdx-ogl: add some flags to trace texture state
goal1: avoid 2 consecutives clean of the render target
goal2: only invalidate texture correctly
2015-05-12 18:03:06 +02:00
Gregory Hainaut
2e34d48e97 gsdx-ogl: add a virtual GetID method for texture
Much more readable
2015-05-12 17:41:41 +02:00
Gregory Hainaut
e0012811ae gsdx-debug: more debug info in gl trace 2015-05-12 12:36:34 +02:00
Gregory Hainaut
4e222f18cd gsdx-ogl: it was a bad idea to use DSA on fb
Actually I'm not sure we can mix both dsa/standard approach
2015-05-11 18:04:16 +02:00
Gregory Hainaut
f37f3cb3cf gsdx-ogl: improve texture uploading
Initially we copy pitch by line in the PBO and tell the dma to only
use the first valid byte.

Now, we only copy useful data to the PBO. It reduce the copy and PBO memory requirement.

It seems a bit faster on native resolution
2015-05-11 16:32:13 +02:00
Gregory Hainaut
4e2e9aa56c gsdx-ogl: always read the first attachment of the fbo 2015-05-11 16:28:34 +02:00
Gregory Hainaut
cb6e8a7d6a gsdx-linux: Don't enable EGL by default
I was hoping that EGL become a standard much more faster. Currently it is an useless dep
so let's disable it by default.
2015-05-11 15:33:40 +02:00
Gregory Hainaut
643b1647c4 gsdx-gui-linux: add some tooltips for the hw options 2015-05-11 14:12:41 +02:00
Gregory Hainaut
921fa3bab8 gsdx-ogl/linux: drop fba option
It is useless as DX11
2015-05-11 13:57:26 +02:00
Gregory Hainaut
f0de7d6386 gsdx-debug: add 2 extra frames in GS dump
Initially I was afraid of the size increase but it can be
higly compressed.

Sometimes image was computed inside a RT but never outputed to
the screen which remains black. It is annoying to see the glitches
2015-05-11 13:45:24 +02:00
Gregory Hainaut
b3d8981a22 gsdx: link replayer to png to avoid link failure 2015-05-11 13:24:40 +02:00
Gregory Hainaut
eff4ac3e4a gsdx-ogl: update UBO hint
On Nvidia, DYNAMIC is a bit faster.
2015-05-11 12:35:41 +02:00
Gregory Hainaut
59f7e4d2dc Revert "gsdx linux: drop aligned stack option"
This reverts commit 2dcffe7fa4.
2015-05-11 12:15:38 +02:00
Gregory Hainaut
d77e252873 debian: update the readme
In short, if you use Mesa, install the latest version :)
2015-05-11 12:00:51 +02:00
Gregory Hainaut
2dcffe7fa4 gsdx linux: drop aligned stack option
I think the bug was related to a wrong declaration of exported function without stdcall
2015-05-11 11:35:34 +02:00
Gregory Hainaut
286fe4db8c cmake/gsdx: check png++ is installed to support png image
Otherwise fallback to bmp file
2015-05-11 11:32:13 +02:00
Gregory Hainaut
797e3d81da cmake: CheckLib allow to search only include
Some libraries doesn't have any .so file
2015-05-11 11:28:09 +02:00
Gregory Hainaut
30e3956ea7 gsdx-ogl: avoid issue with apitrace
The tool doesn't support NaN value so be sure the buffer is correctly initialized
2015-05-11 11:19:18 +02:00
Gregory Hainaut
1523b9534f gsdx-debug: compact the code 2015-05-11 11:19:00 +02:00
Gregory Hainaut
51ed3e63e9 glsl: oups forget to remove a line 2015-05-10 10:39:23 +02:00
Gregory Hainaut
5565544ba6 gsdx-ogl: DATE with texture barrier
Much faster for small batch that write the alpha value. Code can
be enabled with accurate_date option.

Here a summary of all DATE possibilities:
1/ no overlap of primitive
    => texture barrier (pro no setup of stencil and single draw)

2/ alpha written
    => small batch => texture barrier (primitive by primitive). Done in N-primitive draw calls.
    (based on GL_ARB_texture_barrier)

    => bigger batch => compute the first good primitive, slow but only 2 draw calls.
    (based on GL_ARB_shader_image_load_store)

    => Otherwise there is the UserHacks_AlphaStencil but it is a hack!

3/ alpha written
    => full setup of stencil ( 2 draw calls)
2015-05-09 19:54:01 +02:00
Gregory Hainaut
b89f0cfa4c Merge pull request #533 from PCSX2/gsdx-impossible-blend
Gsdx impossible blend support on openGL
2015-05-09 19:49:18 +02:00
Gregory Hainaut
390811f414 gsdx-debug: Dump in PNG on linux & dbg/dev build
Keep BMP for standard user of release build
2015-05-09 18:41:17 +02:00
Gregory Hainaut
3c7a3a3d83 gsdx-ogl: disable accurate option if driver doesn't support it 2015-05-09 18:41:17 +02:00
Gregory Hainaut
7fac25edb0 glsl: add shader implementation of impossible blend
Issue: I don't know if destination alpha value must be multiplied by 2.0f
2015-05-09 15:02:34 +02:00
Gregory Hainaut
f029e4763f gsdx-ogl: add the alpha value in a constant buffer 2015-05-09 15:02:34 +02:00
Gregory Hainaut
472608b879 gsdx-ogl: add accurate blending implementation 2015-05-09 15:02:13 +02:00
Gregory Hainaut
1e8aea033c gsdx-ogl: add a wrapper to control the drawing of primitives
No barrier => draw all primitives
Barrier but without overlap => draw all primitives
Barrier with overlap => draw primitive by primitve

It will ease the implementation of accurate blending and why not date too
2015-05-09 15:01:39 +02:00
Gregory Hainaut
625d65d4b4 gsdx-ogl: encode the bogus id as shader parameter 2015-05-09 14:55:44 +02:00
Gregory Hainaut
bc5de8df6b gsdx-ogl: disable FF blend when blend is done in shader 2015-05-08 20:28:50 +02:00
Gregory Hainaut
380e420cdd gsdx-ogl: add a blend parameter to shader 2015-05-08 20:28:50 +02:00
Gregory Hainaut
9023f5f0db glsl: drop useless ifndef
I often mix them with the real value...
.
2015-05-08 19:28:17 +02:00
Gregory Hainaut
8e1db43431 gsdx-debug: debug stuff 2015-05-08 19:28:17 +02:00
Gregory Hainaut
3c66da4d82 gsdx: remove old code 2015-05-08 19:28:16 +02:00
Gregory Hainaut
1addae1993 gsdx-ogl: don't use extra shader for sprite hack
Atst == 2 && sprite_hack is equivalent to Atst == 1

It frees a bit in the shader selector, and reduces shader combinations.
2015-05-08 19:28:16 +02:00
Gregory Hainaut
b490085214 gsdx-ogl: add 2 options in the GUI to ease testing
accurate_date => use an emulated stencil to compute destination alpha
    test (could be slow)

accurate_blend => do nothing (future)
2015-05-08 19:28:16 +02:00
Gregory Hainaut
4c91bab00e gsdx: fix compilation error on release build 2015-05-08 19:28:00 +02:00
Gregory Hainaut
6d31124d3a gsdx-debug: only enabled advance gl debugging on linux
It will avoid some crash on windows for driver that doesn't support
the extension.

Make debug support mandatory for debug build on linux.
2015-05-08 09:54:34 +02:00
Gregory Hainaut
e87d129b09 gsdx-ogl: more verbose debug 2015-05-08 01:01:01 +02:00
Gregory Hainaut
d6448183d7 gsdx-ogl-debug: insert error message in GL stream
This way, you can see your message in the GL debugger
2015-05-08 00:16:31 +02:00
Gregory Hainaut
544a923e32 gsdx: Add an option to control auto skip of depth texture
Default is 1 if the user enable hack.

It fixes GTA sun effect and likely others bugs.

Please someone add a windows GUI option.
2015-05-07 23:54:22 +02:00
Gregory Hainaut
51a67029cf gsdx-ogl: add an option to print gl error messages 2015-05-07 23:54:22 +02:00
Gregory Hainaut
7518b2ef21 gsdx-gui-linux: add debug option in the gui
* Only for debug/dev build
* look awful (expand/fill) but otherwise it is nice for the debug ;)
2015-05-07 23:54:22 +02:00
Gregory Hainaut
d20501739f Merge pull request #528 from ssakash/patch-1
sync with GSdx.ini variable.(fix earlier typo)
2015-05-07 22:15:41 +02:00
Gregory Hainaut
fda746ff93 gsdx-gui-linux: support 3 states hack options
Based on a Combo Box on linux. As good as 3 states check buttons
2015-05-07 22:13:49 +02:00
Gregory Hainaut
d69ffa9b8b gsdx-gui-linux: move remaining table filling into small functions 2015-05-07 22:13:49 +02:00
Gregory Hainaut
b39b9c9f55 gsdx-gui-linux: use callback everywhere
Note: texture offset doesn't work nicely (you need to press enter
to validate the change)
2015-05-07 22:13:49 +02:00
Gregory Hainaut
d428e0d19d gsdx-gui-linux: move table filling into separate function
It is much easier to read this way. I need to use callback for the remaining
object before I can move everything out of main function.
2015-05-07 22:13:49 +02:00
Gregory Hainaut
917a6c28e5 gsdx-gui-linux: factorize code
* Use wrapper and callback for Check Button/Spin Button/Combo Box
* Use TheApp.m_gs vector to create combo box

Remove nearly 100 lines of code ^^
2015-05-07 22:13:49 +02:00
Gregory Hainaut
ba21879059 gsdx-ogl: 1x aniso <=> off 2015-05-07 22:13:49 +02:00
Gregory Hainaut
e6560f348e gsdx: add vector option for linux & openGL 2015-05-07 22:13:49 +02:00
avih
c02eadab3f Merge pull request #531 from PCSX2-underground/ssakash-log-F9
console: use correct message for hw/sw rendering switch
2015-05-07 21:45:16 +03:00
Gregory Hainaut
8f1d00292b gsdx-ogl: allow to control vsync on Windows
Issue #529

Completely untested
2015-05-07 18:41:10 +02:00
Gregory Hainaut
6095f40baf gsdx-ogl: add the number of free bit in selector structs 2015-05-07 18:41:10 +02:00
Akash
c4b96c3c53 console: use correct message for hw/sw rendering switch 2015-05-07 21:41:38 +05:30
pgert
9a083d5506 gsdx: crc hacks: few new crcs, few crcs region changes
Signed-off-by: Avi Halachmi (:avih) <avihpit@yahoo.com>
2015-05-07 15:57:50 +03:00
Gregory Hainaut
97fad356b8 gsdx-ogl: fix debug build for AMD/Intel HW 2015-05-06 19:09:13 +02:00
Gregory Hainaut
cc4713d379 gsdx-debug: extend ogl debug capabilities
Group opengl calls into a nice name.

Apitrace shows them in a tree format that support folding. Previously it
was a long flat list (10K-40K of lines by frame)

I align the call number with the internal s_n variable. This way it is
easy to map GSdx dump output with the GL debugger :)
2015-05-06 19:09:13 +02:00
Gregory Hainaut
530e4ce776 gsdx-ogl: drop hack that rescale primitive (to avoid upscale glitch)
Rendering is bad. It renders sprites at native resolution.
2015-05-06 19:09:13 +02:00
Gregory Hainaut
6d65867b26 gsdx-ogl: comment point_sampler
It is not enabled on the shader so I will reuse the bit
2015-05-06 19:09:12 +02:00
Gregory Hainaut
3fcac07120 gsdx-ogl: print some message when blending is not properly supported 2015-05-06 19:09:12 +02:00
Gregory Hainaut
6fca3b421d gsdx-debug: dump register context in a .txt file
+ Realign s_n number if frame is skipped

This way it is easier to understand current draw. It also eases
comparaison between SW/HW.
2015-05-06 19:09:12 +02:00
Akash
24e37d2dea sync with GSdx.ini variable.(fix earlier typo)
fixed the description for round offset hack.

fixed the new description for round offset hack.
2015-05-05 23:01:46 +05:30
Gregory Hainaut
5d4bc5c8fe Merge pull request #516 from PCSX2-underground/master
round offset UI initialization
2015-05-05 17:48:53 +02:00
Gregory Hainaut
5f5b901bca gsdx-ogl: alpha bending equation/function are constant
Drop useless variables/state checking
2015-05-05 11:20:25 +02:00
Gregory Hainaut
8032e2c369 gsdx-ogl: separate color mask state from the blending state
Unlike DX they're uncorrelated.
2015-05-05 10:26:01 +02:00
Akash
302ce51efe round offset UI explanation
initialization of IDC_ROUND_SPRITE

set&get config for round offset.

three state checkbox for the hack.

define IDC for round offset.

Linux (GUI) refresh.

typo
2015-05-05 00:29:00 +05:30
Gregory Hainaut
7bfee7e377 gsdx-debug: stop the dump after a limited number of draw call
Otherwise it fills your disk in a short time with useless data.
2015-05-03 16:46:48 +02:00
Gregory Hainaut
c1ddad2d25 gsdx-linux: Refresh the GUI
* Use table everywhere (better alignment)
* Factorize Box/Frame creation
* Factorize table insertion
* Add Anisotropic Filtering support
2015-05-03 16:36:48 +02:00
Gregory Hainaut
ae70344fbc gsdx-ogl: fix 2 passes DATE with GL42 (override_GL_ARB_shader_image_load_store = 1)
It fixes shadows issue with Persona 3
2015-05-02 16:56:18 +02:00
Gregory Hainaut
14a1925de0 gsdx ogl: date texture is signed to use i variant 2015-05-02 16:53:34 +02:00
Gregory Hainaut
f37ef105c5 gsdx-ogl: add support for anisotropy
Close feature request #447
2015-05-02 10:54:58 +02:00
Gregory Hainaut
b1ec8a5a42 gsdx-ogl: detect support of GL_EXT_texture_filter_anisotropic 2015-05-02 10:53:19 +02:00
Gregory Hainaut
73d04e33e9 gsdx ogl: clean various comment and old code 2015-05-01 20:04:23 +02:00
Gregory Hainaut
335695bd0e purge GLES from GSdx !
mobile will use vulkan (or any new API) anyway
2015-05-01 20:02:17 +02:00
Gregory Hainaut
e17ba1c143 gsdx ogl: disable logz when ARB_clip_control is supported
Basically any recent drivers but Catalyst...
2015-05-01 15:01:08 +02:00
Gregory Hainaut
2ff3d17f67 gsdx-ogl: don't create override option for mandatory extension
Ini is alredy big enough
2015-05-01 14:18:05 +02:00
Gregory Hainaut
a0c17ae0a4 gsdx: use vertex storage by default
It is faster on games that draw lots of primitives and in low upscaling.
2015-05-01 14:05:45 +02:00
Gregory Hainaut
004fa7aea4 gsdx debug: allow to dump alpha channel as a gray texture
I would love to find an image viewer that allow to mask channel of the image
2015-05-01 13:38:58 +02:00
Gregory Hainaut
c8a3db114c gsdx debug: create savet option
0: don't dump input texture
1: dump input texture

Now, you can do a first pass with only RT. When you find the wrong call, you can redump the input texture of the bad draw.
2015-05-01 13:35:21 +02:00
Gregory Hainaut
f96a653d05 gsdx-ogl: GSVertexArrayOGL uses ASSERT with condition
Remove useless indentation too
2015-05-01 12:16:26 +02:00
Gregory Hainaut
71c26a829e gsdx-ogl: forget to remove this useless call
It is done once in Device Creation instead of per stencil object
2015-05-01 12:10:03 +02:00
Gregory Hainaut
c76e66f8d2 gsdx-ogl: fix read back of render target
Initial code use a PBO to do asynchronous transfer. It is silly because
GSdx doesn't use this free time. So let's use a sync read. Same speed but
no PBO to manage.
2015-05-01 01:26:44 +02:00
Gregory Hainaut
de52ce956a gsdx linux: update gui
Clear texture was dropped but texture_barrier was added
2015-05-01 01:00:11 +02:00
Gregory Hainaut
7367b22e03 gsdx-ogl: reduce toggling of scissor state for DATE 2015-05-01 00:59:49 +02:00
Gregory Hainaut
71e517108d gsdx-ogl: fix colclip
Sotc shadow and likely various games :)

Thanks to pseudo
2015-04-30 23:08:05 +02:00
Gregory Hainaut
25997647f2 gsdx-ogl: add ENABLE_OGL_PNG_OPAQUE to dump texture without alpha
Alpha is nice but fully transparent texture suck

The best will be an image viewer that can toggle the alpha channel
2015-04-30 23:06:54 +02:00
Gregory Hainaut
39a5d4c839 gsdx: add PNG support for SW renderer
Easier to compare
2015-04-30 20:13:24 +02:00
Gregory Hainaut
b65a62096f gsdx-ogl: drop support of ENABLE_OGL_DEBUG
Stencil can be read by GL debugger due to correct mask configuration
2015-04-30 20:02:51 +02:00
Gregory Hainaut
8a52fdab57 gsdx-ogl: allow to dump texture as png file
-- slower (but that a debug feature)
++ smaller (40x-50x)
++ native support of alpha

Require libpng++ and the define ENABLE_OGL_PNG

Note: depth is not supported yet.
2015-04-30 20:02:50 +02:00
Gregory Hainaut
ee19a2789c gsdx: move invalidation from GSDevice to GSTexture
Much cleaner this way
2015-04-30 19:55:57 +02:00
Gregory Hainaut
2bd9043657 gsdx-ogl: improve debug of stencil
Note: ENABLE_OGL_STENCIL_DEBUG could be dropped now that I can read the stencil properly
2015-04-30 19:55:57 +02:00
Gregory Hainaut
7887d7b5a5 gsdx-ogl: use less verbose code 2015-04-30 19:55:41 +02:00
Gregory Hainaut
f0181d98fd gsdx-ogl: save the texture state 2015-04-30 09:57:30 +02:00
Gregory Hainaut
0ab0c6cfba gsdx: verbose debug option
Print opengl error message on stderr

Rename Debug.txt into GSdx_opengl_debug.txt
2015-04-27 19:30:03 +02:00
Gregory Hainaut
eaa0dae305 glsl: drop invariant qualifier
Fix issue #510 and potentially it allows the compiler to  better optimize the code
2015-04-27 18:52:55 +02:00
Gregory Hainaut
46ff4dc3d3 gsdx-ogl: hardware unit only support normalization of 4 bytes...
(At least on recent AMD GPU)
2015-04-27 18:51:59 +02:00
Gregory Hainaut
301fe869c7 glsl: improve the logz handling
This way only 0 and 1 will conflict
2015-04-26 17:51:33 +02:00
Gregory Hainaut
768ae342c3 gsdx: move buffer check after allocation 2015-04-26 17:51:06 +02:00
Gregory Hainaut
346ef1eec2 gsdx-ogl: ouch! Properly check the creation of vertex buffers 2015-04-26 11:01:55 +02:00
Gregory Hainaut
6a3250cad2 gsdx-ogl: fix logz management (FFXII)
The issue is that z+1 overflow if z is UINT max
log2(z) overflow if z is 0

So let's use an or 1 to avoid both overflow
2015-04-25 20:23:26 +02:00
Gregory Hainaut
ee244071fa gsdx-ogl: use 64 bits counter + fix division factor
I also added a counter of the real size of the texture.

I have a bad overhead for pbo transfer
2015-04-25 14:18:21 +02:00
Gregory Hainaut
00e62919c5 gsdx-ogl: use countof macro instead to hardcode the size 2015-04-25 13:06:02 +02:00
Gregory Hainaut
47a0026b60 gsdx-ogl: print the bandwidth of uniform 2015-04-25 13:00:03 +02:00
Gregory Hainaut
f2f59544d2 gsdx-ogl: early bind vertex array object
Creation of buffer will generate a bind in BufferStorage mode. It is just to be safe.
2015-04-25 12:50:12 +02:00
Gregory Hainaut
15ae9996bb glsl: format white space + comment 2015-04-25 12:50:12 +02:00
Gregory Hainaut
757726bb91 gsdx-ogl: allow to invalidate the texture
It just a hint to the driver to avoid any useless transfer

I don't expect any change but it is free so why not ;)
2015-04-25 12:50:12 +02:00
Gregory Hainaut
75817bb27b gsdx-ogl: add a quick and dirty DSA layer emulation
The global idea is to use
1/ bind in tight loop
2/ DSA otherwise (to avoid any binding in tight loop)
2015-04-25 12:50:11 +02:00
Gregory Hainaut
eb257d9295 gsdx-ogl: add dsa function place holder 2015-04-25 12:50:11 +02:00
Gregory Hainaut
baf84b98c4 gsdx-ogl: add override_GL_ARB_texture_barrier option
To ease regression test.
2015-04-25 09:59:25 +02:00
Gregory Hainaut
b12eb45bb7 gsdx-ogl: try to avoid crash on fglrx windows 2015-04-25 09:50:19 +02:00
Gregory Hainaut
f0182f9a66 windows requires APIENTRY (=> stdcall) 2015-04-25 01:32:09 +02:00
Gregory Hainaut
7b0775d887 gsdx-ogl: add some fences to protect the upload of vbo buffer
This way ogl_vertex_storage must be safer to activate

And it brings a nice performance boost (game with lots of primitives and
reasonable upscaling)

SotC testcase 4x: 61fps => 78fps
2015-04-24 23:15:19 +02:00
Gregory Hainaut
36514bd95f glsl: fog is a single byte
Give a chance to the driver to optimize if possible
2015-04-24 21:37:37 +02:00
Gregory Hainaut
c207632e49 gsdx-ogl: improve date performance for GL45
If there is no overlap, it is allowed to directly read from the render target.

On SotC testcase with 6x scaling: 30fps -> 40fps

Note: it requires GL_ARB_texture_barrier extension so be sure to have a recent driver

Note2: it requires a lots of testing too

Open question: in case of complex date (written alpha)
Will it be faster to split the draw call into multiple call with no
primitive overlap
2015-04-24 21:12:33 +02:00
Gregory Hainaut
795ae50ecd gsdx-ogl: fix the recently broken advance date feature
Now it is really working with a 2 stages shaders but it is still slow.
2015-04-24 20:13:38 +02:00
Gregory Hainaut
672e3f9533 gsdx-ogl: use DSA for texture management
Yeah code is much nicer :)
2015-04-24 19:34:17 +02:00
Gregory Hainaut
6d31d1e0d0 gsdx-ogl: add a layer to emulate DSA for texture
Framebuffer function will be nice too
2015-04-24 19:32:00 +02:00
Gregory Hainaut
f71eb171cf gsdx-ogl: add glTextureBarrier function pointer
Could be useful
2015-04-24 18:35:01 +02:00
Gregory Hainaut
6e386df535 gsdx-ogl: avoid to clean fully texture in DATE
Is is useless and it has a small impact on performance for big upscale
2015-04-24 18:32:08 +02:00
Gregory Hainaut
03e72781aa gsdx-ogl: drop support of GL_ARB_clear_texture extension
Extension is a bit slower.

We use it to clear the RT but we generally use it right away so
we don't avoid the FB attachment.
2015-04-24 18:15:58 +02:00
Gregory Hainaut
89d5e5637c glsl: use an explicit cast insead of notEqual function
If the compiler didn't optimize the code, it will be a bit faster
2015-04-24 18:01:25 +02:00
Gregory Hainaut
56836561f4 glsl: replace runtime condition by preprocessor condition
It might be an easier work for the compiler

I didn't replace all occurences to keep readability
2015-04-24 17:51:29 +02:00
Gregory Hainaut
4bb8d15228 gsdx: be more verbose on title and bandwidth debug 2015-04-24 17:13:56 +02:00
Gregory Hainaut
258b73409c gsdx-ogl: update flags for buffer storage
Fix issue with Mesa driver
2015-04-23 21:10:43 +02:00
Gregory Hainaut
f6652e9a50 gsdx-ogl: disable slow and buggy code until I found a better solution
ogl_texture_storage 1 creates texture corruption.

Advance date is too slow, code need to be updated (properly) to uses 2 passes only not 3
Maybe one could be enough (sometimes)
2015-04-22 09:33:41 +02:00
Gregory Hainaut
b32f808fd4 gsdx-ogl: increase the number of pbo
It would cost 16MB of extra storage on the GPU but it might
reduce conflict of texture upload.
2015-04-22 00:40:38 +02:00
Gregory Hainaut
bd6ea17bdc gsdx-ogl: speed improvement for DATE
DATE is implemented in 2 ways.
1/ with stencil
2/ purely in FS (sw)

I kept method 1 to reduce the work on method 2. It sucks for performance.
So it would be either 1 or 2.

Note: DATE has a big impact on higher upscaling
Note2: you can disable the 2nd method with this configuration parameter

override_GL_ARB_shader_image_load_store = 0
2015-04-22 00:36:34 +02:00
Gregory Hainaut
15dcf07b3b revert previous commit
Not better, worst slower.

I'm afraid I will need proper fencing
2015-04-22 00:32:46 +02:00
Gregory Hainaut
8386b427ea gsdx ogl: restore GL_MAP_COHERENT_BIT for texture upload
I hope to fix the texture upload corruption
I hope that impact on perf will remain small
2015-04-21 23:34:26 +02:00
Gregory Hainaut
19eb1f00d1 gsdx ogl: flush vbo range instead of barrier
For testing purpose. I don't know which one is better.

It seems flushing have less fps fluctuation than barrier.
2015-04-21 21:44:50 +02:00
Gregory Hainaut
ce98276322 gsdx-ogl: improve speed of vertex streaming
Note yet enabled because I'm afraid of data corruption but feel free to test it

The option:
ogl_vertex_storage = 1

Performance note (warm cache+gs replay on colin3)
60 fps -> 76 fps
2015-04-20 09:38:03 +02:00
Gregory Hainaut
62489f42f1 gsdx-ogl: add an optimization note for later
Only 1 byte of fog is useful
2015-04-20 07:18:09 +02:00
Gregory Hainaut
6d253c0b8f glsl: fix debugging of tex coordinate in apitrace 2015-04-20 07:18:08 +02:00
Gregory Hainaut
31f8c065db gsdx-ogl: implement a new hack UserHacks_UnscaleSprite for opengl
UserHacks_UnscaleSprite = 1 will unscale flat sprites
UserHacks_UnscaleSprite = 2 will unscale all  sprites (don't work well so far)

The idea of the hack is to redo the interpolation of texture coordinate
based on the non-upscaled pixel position.

It avoids various glitches but sprites aren't upscaled anymore (so no
more anti-aliasing, potentially a coefficient can be added).
2015-04-20 07:18:08 +02:00
Gregory Hainaut
6124eb844e gsdx-ogl: only compile useful VS
logz is a constant
wildhack is only compatbile with TME/FST

Compilation goes down from 64 to 20 vertex shaders.
2015-04-20 07:17:58 +02:00
Gregory Hainaut
16e6d0d305 glsl: move shader into a separate directory
Only keep glsl_source.h for clarity
2015-04-19 18:49:02 +02:00
Gregory Hainaut
55fdf26898 glsl: remove the older file tfx.glsl 2015-04-19 18:49:02 +02:00
Gregory Hainaut
15264c6c63 glsl: split the main shader
* separate VS/GS and FS
* separate subroutine part of the FS

It already complex enough without subroutine stuff. Besides I'm not sure
we will keep subroutine on the future.
2015-04-19 18:49:02 +02:00
Gregory Hainaut
6fc9afb175 Merge pull request #507 from PCSX2/stdcall-for-plugin
Stdcall for plugin
2015-04-19 18:48:32 +02:00
Gregory Hainaut
1d70865f09 Merge branch 'gsdx-boost-queue' 2015-04-17 19:13:32 +02:00
Gregory Hainaut
e605ed1d09 gsdx-queue: add a comment for the future 2015-04-17 19:12:36 +02:00
Gregory Hainaut
fa243afbab gsdx SW: enable new queue && C++11 on linux/MSVC 2012+ 2015-04-17 19:12:36 +02:00
Gregory Hainaut
d91e989abb gsdx-queue: pass shared_ptr by reference
It avoids atomic +1/-1 of the reference counter

The counter is still incremented when the ptr is copyed into the queue
2015-04-17 19:12:36 +02:00
Gregory Hainaut
84b33d2ddb gsdx-queue: plug the new queue as a drop-off replacement of previous boost queue 2015-04-17 19:12:36 +02:00
Gregory Hainaut
90794c302a gsdx-queue: import spsc_queue of boost
I remove 80% of the file to only keep the ring buffer core

Same speed as boost but without the boost dependency
2015-04-17 19:12:36 +02:00
Gregory Hainaut
c9194301a0 gsdx-queue: (linux) add a GUI option to select the queue 2015-04-17 19:12:33 +02:00
Gregory Hainaut
0aac47ca59 gsdx-queue: add a new option "spin_thread" to select the queue behavior at runtime
If someone has a more elegant solution, feel free to share it

spin_thread = 0
spin_thread = 1 // the faster but GS thread will never stop, very bad for laptop
2015-04-17 19:03:21 +02:00
Gregory Hainaut
9682061472 gsdx-queue:add a new job dispatcher queue based on boost and C++11
It is faster on linux, it requires less code, and it is "portable"

It requires boost (only hpp files) + MSVC 2013 (for atomic) (seem doable by 2012 too)

Actually there are several queues that either use spinlock or full sleep
2015-04-17 19:03:21 +02:00
Gregory Hainaut
a75d78bd7e gsdx: use standard lock_guard instead of GSAutoLock 2015-04-17 19:03:21 +02:00
Gregory Hainaut
9ad5933120 gsdx: Use composition insead of inheritance to support lock
To ease update to C++11
2015-04-17 19:03:21 +02:00
Gregory Hainaut
8deee6afbc gsdx: include some C++11 define for later 2015-04-17 19:03:21 +02:00
Gregory Hainaut
9ce7f515bc cdvdiso: add stdcall convention 2015-04-17 18:34:05 +02:00
Gregory Hainaut
1cb047687f common: use stdcall convention too
(Likely used by others null plugins)
2015-04-17 18:33:26 +02:00
Gregory Hainaut
5c8ea74cb9 null plugins: add stdcall convention 2015-04-17 18:33:10 +02:00
Gregory Hainaut
75a3abc225 lilypad: add stdcall convention 2015-04-17 18:32:39 +02:00
Gregory Hainaut
8e3dab7e11 zzogl: add stdcall convention 2015-04-17 18:32:10 +02:00
Gregory Hainaut
e16cb9a00e onepad: add stdcall convention 2015-04-17 18:31:44 +02:00
Gregory Hainaut
c456764342 spu2x: declare exported function as stdcall
* Fix a stack buffer overflow on address sanitizer
* Might explain an old clang crash
2015-04-17 18:24:23 +02:00
Gregory Hainaut
545c1d387c gsdx: add an include for MSVC 2015-04-16 22:28:09 +02:00
Gregory Hainaut
aff999cf69 gsdx linux: refresh the gui
* Use tooltip for hack
* Update string of previous hack
* Remove unused hack

Note: hack_sprite_check requires 3 states (and potentially others hack too) but
I don't know how to do it. It likely requires a "scale button"
2015-04-16 19:28:55 +02:00
Gregory Hainaut
85cbe285f0 gsdx dialog: move hack info into a separate file
This way it can be reused on linux.
2015-04-16 19:26:33 +02:00
Gregory Hainaut
670bcc1818 gsdx hack: use a dumb implementation for UserHacks_round_sprite_offset = 2
It works as bad as a "clever" implementation.

It seems to be enough for games such as venus/taisho-monoke/FFX

Note: it might creates glitches. Code will never be nice, so it is just
a trade-off
2015-04-16 19:26:33 +02:00
Gregory Hainaut
41e5be0673 gsdx hack: limit range of UserHacks_align_sprite_X
Just an extra check to avoid an overlap (avoid white line in tekken)
2015-04-16 19:26:33 +02:00
Avi Halachmi (:avih)
2c3b3eafbe first time wizard "overwrite": obey default console sources
this is actually not a FTW issue but rather a console sources issue.

the console log sources are not c++ classes and therefore don't get initialized
other than when [attempting to] loading them from the ini file (where if the ini
doesn't exist then they get their default values). however, during first time
wizard, when choosing "overwrite", the console sources are saved without ever
getting loaded and so end up without the default values applied (so all sources
as disabled).

this patch makes sure that if we're saving the conlog sources before ever
attempting to load them, they'll get saved with the correct default values.
2015-04-16 13:19:03 +03:00
avih
ce8626150e Merge pull request #505 from unknownbrackets/cso
Small optimization to CSO support, add notes
2015-04-15 22:26:17 +03:00
Unknown W. Brackets
7b1214849a Add disabled code to use a cache for cso reading.
It doesn't seem like the cache is worth it, unfortunately.
2015-04-15 10:27:59 -07:00
Unknown W. Brackets
427fa039ba Note why multiple blocks aren't optimized in CSO. 2015-04-15 09:47:20 -07:00
Unknown W. Brackets
49cfc3424b Keep around z_stream between decompression passes.
Slightly more efficient to avoid reallocating the state for each block.
2015-04-15 09:03:00 -07:00
avih
080459e7f4 Merge pull request #504 from unknownbrackets/cso
Add support for loading CSO-compressed ISOs
2015-04-15 18:44:00 +03:00
Unknown W. Brackets
17a58103e2 Move shared file access to compressed utils. 2015-04-15 08:30:19 -07:00
Unknown W. Brackets
8e89418f45 Prefix some defines in GzippedFileReader. 2015-04-15 08:25:32 -07:00
Gregory Hainaut
e8698a9c0c gsdx hack: hole in vertex position also appears in !FST projection
Fix various black vertical line regression with UserHacks_align_sprite_X
2015-04-15 09:40:06 +02:00
Gregory Hainaut
65a84b9f64 gsdx hack: drop previous filtering hack
superseeded by UserHacks_round_sprite_offset
2015-04-15 09:26:01 +02:00
Unknown W. Brackets
5bfd4c7bf8 Refactor ISO creation to avoid duplicate code. 2015-04-14 19:24:22 -07:00
Unknown W. Brackets
334f648eaa Separate compressed file types into separate files.
Cleaner this way.
2015-04-14 19:24:21 -07:00
Unknown W. Brackets
4ffbd3765b Add a link to a description of the CSO format. 2015-04-14 17:46:44 -07:00
Unknown W. Brackets
8edffd32c8 Add support for loading CSO-compressed ISOs. 2015-04-14 10:14:06 -07:00
Gregory Hainaut
2da4a5e6bc gsdx hack: use a 0 offset instead of -1
-1 is annoying because minimum value is 0. Instead to add more logic,
let's try to use 0 which seems to be good enough (fix regressions on DQ8/AT)

Unfortunately it causes a mini regression on taisho-mononoke. Rotation of sprite is done with 2 triangles.
Potentially previous value wrongly recover this section.
2015-04-14 18:39:26 +02:00
Gregory Hainaut
cde72300a5 gsdx hack: Correct formulae for reversed texture
It fixes issues on Ace Combat UI
2015-04-13 22:14:36 +02:00
Gregory Hainaut
418f2e69a8 gsdx-ogl: implement the wildhack on the GPU
Likely much faster for opengl and much easier to implement

Note: hopefully UserHacks_round_sprite_offset will replace it
2015-04-13 22:14:36 +02:00
Gregory Hainaut
50bac01d89 gsdx hack: disable upscaling hack at native resolution 2015-04-13 22:14:36 +02:00
Gregory Hainaut
815c99b6e4 gsdx-hack: remove an extra offset + duplicate linear computing
Initially code aligned texture on pixel boundary + 1/16th. It seems to work without it.
2015-04-13 22:14:36 +02:00
Gregory Hainaut
399ddbd74a gsdx hack: reduce complexity of alpha* function
It will help the compiler to make a couple of optimizations (and it will help
a futur porting to GSVector)
2015-04-13 22:14:36 +02:00
Gregory Hainaut
1d0deb5ffe gsdx hack: move round sprite offset into a separate function
Use a boolean template to separate the linear case. I'm afraid it will
cost extra computation but 90% of sprites use nearest.
2015-04-13 22:14:36 +02:00
avih
46aecb3748 Merge pull request #503 from karasuhebi/master
Added a comment to PCSX2_keys.ini.default about F11
2015-04-13 22:06:31 +03:00
Karasuhebi
5c263ff84c Removed comment symbol for Sys_FreezeGS = F11 2015-04-13 13:28:44 -04:00
Karasuhebi
e397fe105e Added a comment to PCSX2_keys.ini.default about F11
Added a comment to PCSX2_keys.ini.default about FreezeGS being
deprecated as to avoid user confusion when pressing F11 and nothing
happens.
2015-04-13 13:17:27 -04:00
Gregory Hainaut
1aebca3740 gsdx hack: m_userhacks_round_sprite_offset take precedence over m_userhacks_stretch_sprite
m_userhacks_stretch_sprite is only kept for debugging. Let's avoid bad mixing by users
2015-04-12 11:05:23 +02:00
Gregory Hainaut
c4fef0256e gsdx hack: Better rounding fix letter in ace combat and line in tekken
Tekken is broken with setting UserHacks_round_sprite_offset = 2 use 1 instead.
=> game use upscaling internaly so my rounding of coordinate break everything

Yakuza uses float coordinate but this hack only correct the integer coordinate
=> the solution will be to add a dedicated hack for this game.

Colin3 got a regression but I don't know when...
2015-04-12 10:31:04 +02:00
Gregory Hainaut
06ee41957e Merge pull request #478 from PCSX2/linux-mtvu-crash-after-shutdown
MTVU: fix linux crash after a shutdown
2015-04-11 13:15:34 +02:00
Gregory Hainaut
781c1df5d0 Merge pull request #486 from PCSX2/c++11-vssappendf
C++11 vssappendf
2015-04-11 13:15:25 +02:00
Gregory Hainaut
7e89247bf4 gsdx hack: don't add extra correct for zero length texture
Otherwise t1-t0 is 16 instead of 0
2015-04-11 10:54:30 +02:00
Gregory Hainaut
d2156c86eb gsdx: improve previous hack for bilinear sprite
PS2 uses a -0.5 offset before sampling so texels must be rounded to half-pixel boundary

If fixes glitches on Venus and taisho-mononoke

Note: I didn't fixed yet texture render in reverse because I don't have any test for it.
2015-04-10 09:42:39 +02:00
Gregory Hainaut
f5eeb2024e gsdx: anti-glitches v3: Tester wanted
UserHacks_round_sprite_offset = 1 <= enable correction of flat sprites
UserHacks_round_sprite_offset = 2 <= enable correction of all sprites (better on a couple of dump but not sure of the consequence)

I completely redo the algorithm. This time I do the projection and
interpolation of the 2 extrem vertex. This way I can compute the min/max
valid texture coordinate.

It gives stronger guarantee that texture sampling will be done inside the texture.

However it might have a performance impact, likely reasonable because it
is limited to sprite vertex.

A big thanks you to all people that provide me GS dump and test reports.
2015-04-09 19:51:50 +02:00
Gregory Hainaut
05eb1641f2 gsdx: add glsl debug capabilities
Useful to debug bad texture sampling
2015-04-08 10:15:25 +02:00
Gregory Hainaut
98d8ad7484 gsdx: new anti-glitches upscaling hack: UserHacks_round_sprite_offset
It is replacement of the previous hack (UserHacks_stretch_sprite). Don't enable both in the same time!

The idea of the hack is to move the sprite to the pixel boundary. It
avoids most of rounding issue. It also rescales verticaly the sprite (avoid horizontal line on ace combat).
I don't like this rescaling maybe we can limit it to only 1 pixels.

On my limited testcase, results are much better with any upscaling factor.

I still have a bad line in Kingdom heart. If you have issue with others
game please provide us a GS dump.
2015-04-07 19:18:24 +02:00
avih
3077de3637 Merge pull request #496 from 3descx9/master
crc hack for Ponkotsu Roman Daikatsugeki: Bumpy Trot ( Steambot Chronicles JP)
2015-04-07 12:04:25 +03:00
ssakash
defb57178f crc hack for Ponkotsu Roman Daikatsugeki: Bumpy Trot ( Steambot Chronicles JP) 2015-04-07 14:14:26 +05:30
avih
a5ac81b593 Merge pull request #495 from Sarania/GSdx-new-hacks-tickbox-FIX-ERROR
GSdx: Hacks UI: Add missing BREAK that I left out
2015-04-06 22:44:41 +03:00
Blyss Sarania
506648bd6b GSdx: Hacks UI: Add missing BREAK that I left out 2015-04-06 14:39:51 -05:00
avih
91f0730373 Merge pull request #493 from Sarania/GSdx-new-hacks-tickbox
GSdx: UI for hacks: stretch sprites and align sprites
2015-04-06 21:56:21 +03:00
Blyss Sarania
c6fb098703 Add two new tick boxes and associated description
For Gregory's two new awesome hacks

Also make new hacks obey "Enable HW Hacks"
2015-04-06 13:48:59 -05:00
avih
d989dea64a Merge pull request #490 from ssakash/patch4
GameIndex.dbf: few compatibility updates
2015-04-06 17:39:57 +03:00
Avi Halachmi (:avih)
9a7d83989b use tabs instead of few spaces at the previous screensaver commit 2015-04-05 20:02:15 +03:00
Avi Halachmi (:avih)
8a5c8ab91c fix: disable screen saver (pcsx2_ui.ini - DisableScreenSaver)
there was already code for this, but it was broken due to:
- the message is WM_SYSCOMMAND and wParam is SC_SCREENSAVE etc.
- GSPanel doesn't get WM_SYSCOMMAND - GSFrame does.
- also disabled screen saver while paused if not set to hide the GS window.
- it's an ugly hack where windows keeps trying to activate the screen saver
  every few seconds but such code prevents it (Lilypad has the same hack).

the new code uses windows API which was designed for this.

the screen saver is now disabled while the window is focused and the emulation
is running. it's on by defauly and without GUI - the same as with normal games.

this patch addresses Windows only, but adds a placeholder for future
implementations for other platforms.
2015-04-05 19:50:31 +03:00
Gregory Hainaut
3c84e6848b gsdx: don't enable previous hack if m_upscale_multiplier <= 1 2015-04-04 01:21:46 +02:00
Gregory Hainaut
183b5d4def gsdx: improve UserHacks_align_sprite_X hack for ace combat
Game uses 1x1 texture sampling. In this condition we don't care
if texture is correctly aligned.
2015-04-03 23:00:54 +02:00
Gregory Hainaut
53ab390e72 gsdx linux: add a nice gui option for previous hack
I also added two nice tooltips :)
2015-04-03 21:25:34 +02:00
Gregory Hainaut
fbaa84e691 gsdx: anti-vertical-line hack UserHacks_align_sprite_X
This ack realign sprite to full pixel coordinate

It solves vertical line in ace combat/tekken/colin mac rally
2015-04-03 21:02:25 +02:00
Gregory Hainaut
e40a26be19 gsdx: add some helper to debug openGL renderer 2015-04-03 20:28:44 +02:00
Gregory Hainaut
5269e54f02 gsdx: tune previous hack
Only disable bilinear on the sprite that were forced by the user.
If the PS2 requires a bilinear filtering, there is likely a big enough texture
2015-04-03 20:09:02 +02:00
Gregory Hainaut
bb728ea186 gsdx linux: filtering label was in wrong oder
The standard mode is 2
2015-04-03 20:07:50 +02:00
Gregory Hainaut
d4b7410e3e gsdx linux: add a checkbox to enable easily previous hack 2015-04-03 18:33:05 +02:00
Gregory Hainaut
e1a5736583 gsdx: anti-upscale-glitch hack UserHacks_SkipDraw
2x upscaling is pixel perfects. Bigger upscaling is better but not yet perfect

Feedbacks are welcomes (note it doesn't solve all upscaling issue, only wrong texture sampling)

For the history:
If you have a texture of [0;16[ texels and draws a primitive [0;16[

The formulae to sample last pixels of texture is
0.5 + (16*s-1)/(16*s) * 16
Native (s==1): 15.5 (good)
2x     (s==2): 16 (bad, outside of the texture)
4x     (s==4): 16.25 (bad, really outside of the texure))
2015-04-03 18:33:05 +02:00
Gregory Hainaut
22710d9b44 lilyPad: fix the linux crash if ini doesn't exist
All credits go to Arcum42
2015-04-03 18:33:05 +02:00
ssakash
22baaf228a update compatibility changes for games. 2015-04-03 03:26:48 +05:30
ramapcsx2
55ee181092 Merge pull request #489 from Sarania/fix-gamefix-typo
Fix a typo in manual gamefixes
2015-04-02 20:27:40 +02:00
Blyss Sarania
2ac30e7bde Fix a typo in manual gamefixes
Change "a FMV" to "an FMV"
2015-04-01 15:51:29 -05:00
Avi Halachmi (:avih)
45e2fd9204 crc hack for Raw Danger! (Zettai Zetsumei Toshi 2 US)
thanks to ssakash for the patch
2015-03-29 15:41:06 +03:00
Gregory Hainaut
fd71fc4fc9 common: drop useless printf function + reimplement vssappend with C++11
Performance is not important here. I'm not sure Windows could handle VLA
* new/delete can still be used otherwise.
* Put an assert(0) because debugger surely don't use string bigger than
  128 bytes.

code is much more compact 20 lines vs 700 lines ...
2015-03-23 23:14:54 +01:00
Gregory Hainaut
b2efa85a3f pcsx2: debugger: use standard sprintf function
ssprintf is nice but it doesn't worth it
2015-03-23 23:08:55 +01:00
Gregory Hainaut
45930ecbf3 gsdx: value was wrongly overwritten
Need a lots of tests to ensure at least no regression on cache behavior

Issue #332
2015-03-17 09:39:50 +01:00
Gregory Hainaut
b20deb0752 MTVU: fix linux crash after a shutdown
* Lock during the reset
* Purge the ring before memory unallocation

Close issue #474
2015-03-17 09:33:20 +01:00
Kieran Hanrahan
0fbe94eb41 GSfx FX 2.3 preview
Where to begin o.o I'd be here all night marking off all of the changes from the previous version.

Basic rundown;

I've reworked, and rewrote most of it, and seperated effects that I had embedded in others. I've added some new effects, improved the options, and their descriptions.

Completely rewrote the color processing logic. Rewrote and improved the logic of many other of the effects. Expanded, and improved the options, and descriptions. etc, etc.

Current effects include;
* FXAA 3.11
-
* Bilinear Texture Filtering
* Bicubic Texture Filtering
* Gaussian Texture Filtering
* Bicubic Scaling
* Lanczos Scaling
-
* Blended Bloom (6 different blend types)
* HDR Scene Tone Mapping (4 different operator types)
* Color Correction (5 colorspace types)
* Cross Processing (3 conversion types)
* Post-Complement Colour Grading
* Gamma Correction Curve
* Pixel Vibrance Adjustment
* Texture Unsharp Mask
* Contrast Enhancement
* Px Cel Shading
* Paint Shading
-
* Sub-pixel Dithering
* Scanline Emulation
* Vignette Effect
* Pixel Border

With a plethora of options for them.

Enjoy =)
2015-03-13 19:01:09 +00:00
Kieran Hanrahan
9521b0021b GSdx FX 2.30 preview 2015-03-13 18:48:40 +00:00
ramapcsx2
5ed3f5f1a4 -Fix title from 1.0.0 to 1.2.0
-Replaced googlecode link with Github
-Updated hotkeys section with more hotkeys (taken from our wiki, thanks
people!)

Thanks to karasuhebi from our forum for bringing this to my attention!
2015-03-03 09:54:39 +01:00
Gregory Hainaut
3b5367c5b7 Merge pull request #452 from turtleli/fix-linux-build-avx2-with-tsx-disabled
GSdx: Linux: Fix build failure on AVX2 processor with disabled TSX, enable SSE4.2, SSE4.1, SSSE3 builds
2015-03-01 17:53:21 +01:00
Jonathan Li
1222bcbf6e GSdx: Comment out TransactionScope code
The TransactionScope class is compiled but never used. Comment it out
for now.
2015-03-01 16:40:48 +00:00
Gregory Hainaut
c1604c4b38 gsdx🧵 only keep std::mutex/std::condition_variable
Keep pthread for thread until std::thread is really working
2015-03-01 17:29:40 +01:00
3kinox
7f1e907616 + Correct faulty behaviour of std thread by using native posix handle.
+ This is not yet perfect. Really, this standard seems like a load of crap to me in fact...
At least it works now. Should test again when gcc 5 & new c++ libs gets out.. Until then, it will do.
2015-03-01 17:29:39 +01:00
Gregory Hainaut
b68270ded1 Merge pull request #448 from PCSX2/lilypad-linux-port
Lilypad linux port
Basic support of Keyboard and Joystick

No gui to configure anything. Not well tested yet.
2015-03-01 16:52:23 +01:00
Gregory Hainaut
05eff696d3 Merge branch 'Leucos8-master' 2015-03-01 16:49:37 +01:00
Leucos
4587a1e64e IT_it translation update 2015-03-01 16:44:59 +01:00
Jonathan Li
13c0e6f5ef GSdx: Explain TransactionScope changes 2015-02-28 14:21:44 +00:00
3kinox
4211d51f07 64 bits: solve various of type problems 2015-02-27 22:07:13 +01:00
Gregory Hainaut
283f5236a5 Merge branch 'xsacha-icore-cleanup'
From PR #266

I drop sVU modification because sVU will be dropped (ifdef out) on the future
2015-02-27 21:24:58 +01:00
Sacha
4bb41bc267 pcsx2: More cleanup of iCore.
Greg: Drop Svu changes, Svu will be dropped in the future anyway
2015-02-27 21:20:11 +01:00
Sacha
b2738fdd5b Remove 3dnow (unused, obsolete).
Greg: merge the removal of EMMS stuff
2015-02-27 21:12:34 +01:00
Gregory Hainaut
f254d44030 CDVDlinuz: fix gtk header include
It doesn't fix GTK3 build but it allows to see the real error now.
2015-02-27 10:11:38 +01:00
Gregory Hainaut
fb100e05f2 cmake: improve previous commit
Avoid to set -m32 two times

Fix issue #463
2015-02-27 10:02:38 +01:00
Gregory Hainaut
b5612ec622 cmake: always set -m32 for 32 bits build
It fixes cross-compilition issue when users/env set CC/CXX variables
2015-02-22 22:17:38 +01:00
Avi Halachmi (:avih)
6b48784709 gzip iso: reduce seek time on fragmented files by OS prefetch on win32
ask the OS to asynchronously fetch the next chunk from disk before we actually
use it. We then cancel this request and ignore the data before the next extract
but it's very likely that when extract tries to read from disk the data will
already be cached by the OS.

This frequently allows to overcome HDD seek time (mostly due to fragmentation)
of the compressed file.
2015-02-22 16:53:51 +02:00
Avi Halachmi (:avih)
5e88afe978 patches: print the actual patch lines only in verbose mode 2015-02-22 16:53:49 +02:00
Jonathan Li
329953ebc3 GSdx: Linux: Enable SSE4.2, SSE4.1 and SSE3 builds 2015-02-22 11:18:23 +00:00
turtleli
9b572d2d47 GSdx: Linux: Fix AVX2 CPU build with TSX disabled
On Linux, CPUs with AVX2 instruction sets that have TSX disabled (by
microcode update or otherwise) fail to build GSdx. The __RTM__ macro is
undefined, with leads to the TSX RTM instruction set (_xbegin, _xend,
_xabort, etc.) being unavailable.

Modify the preprocessor check so that the RTM instructions are only used
if available.
2015-02-22 11:18:23 +00:00
Avi Halachmi (:avih)
56b2c009cd patches: unify patch application verbosity
PCSX2 applies patches from several sources: GameIndex.dbf, cheats folder,
widescreen patches folder and widescreen patches zip (cheats_ws.zip).

all these patche sources are typically applied whenever any kind of
configuration changes (e.g. aspect ratio etc), depending on config.

typically we want to display all this info at the console/log only on boot,
unless we're in Devel mode or if the user enables the verbose console.

this patch unifies all the verbosity related prints to use PatchesCon, where
this object is controlled according to the conditions (devel mode, boot time,
console mode).

it replaces passing around a "verbose" and includes some more prints which did
not adhere to this policy earlier (e.g. the patches lines were only printed
if verbose console was enabled - now they also print on boot).

warnings and errors are unmodified and always print to the console.
2015-02-21 16:19:24 +02:00
Gregory Hainaut
330d14941f gsdx-linux: support dump mode on linux
It could be useful to analyze GS dump. Warning it consumes a lot of
disk space.
2015-02-21 13:51:06 +01:00
Gregory Hainaut
8d76586dec lilypad: fix windows build
I think lilypad used libc instead of libc++
2015-02-21 11:08:45 +01:00
Gregory Hainaut
642371996a lilypad: add joy support based on linux evdev
I wanted to play with linux interface :)

It is far from perfect but joysticks are detected. The biggest issue is the correct generation of the config file!
2015-02-21 11:08:45 +01:00
Gregory Hainaut
3a2e8f38df lilypad: removed old linux/LilyPad.cpp file 2015-02-20 23:05:21 +01:00
Gregory Hainaut
8350dc2c68 lilypad: remove debug printf 2015-02-20 23:05:21 +01:00
Gregory Hainaut
13bb1ae028 lilypad: Keep original KeyboardQueue (more ifdef)
It would be nice if windows support basic std::mutex

The reverse fifo queue is kept in Linux/KeyboardQueue.cpp
2015-02-20 23:05:21 +01:00
Gregory Hainaut
349bb810f0 lilypad: merge LilyPad.cpp (ifdef, ifdef)
Avoid duplication for linux
2015-02-20 23:05:21 +01:00
Gregory Hainaut
7985f5114c cmake: enable lilypad
I manage to have x/start button working with 0/1 key. Here the reference configuration.

[General\ Settings]
Force\ Cursor\ Hide=0
Mouse\ Unfocus=0
Background=0
Multiple\ Bindings=0
DirectInput\ Game\ Devices=0
XInput=0
DualShock\ 3=0
Multitap\ 1=0
Multitap\ 2=0
Escape\ Fullscreen\ Hack=0
Disable\ Screen\ Saver=0
Logging=0
Save\ State\ in\ Title=0
GH2=0
Turbo\ Key\ Hack=0
Vista\ Volume=0
Close\ Hacks=0
Keyboard\ Mode=16
Mouse\ Mode=0
Volume=0
[Pad\ 0\ 0]
Mode=1
Auto\ Analog=0
[Pad\ 0\ 1]
Mode=1
Auto\ Analog=0
[Pad\ 0\ 2]
Mode=1
Auto\ Analog=0
[Pad\ 0\ 3]
Mode=1
Auto\ Analog=0
[Pad\ 1\ 0]
Mode=1
Auto\ Analog=0
[Pad\ 1\ 1]
Mode=1
Auto\ Analog=0
[Pad\ 1\ 2]
Mode=1
Auto\ Analog=0
[Pad\ 1\ 3]
Mode=1
Auto\ Analog=0
[Device\ 0]
Display\ Name=displayName
Instance\ ID=instanceID
Product\ ID=deviceID
API=16
Type=1
Binding 0=0x00040030, 0, 31, 65536, 0, 0, 0
Binding 1=0x00040031, 0, 19, 65536, 0, 0, 0
Binding 2=0x00040002, 0, 50, 65536, 0, 0, 0
Binding 3=0x00040003, 0, 51, 65536, 0, 0, 0
Binding 4=0x00040004, 0, 52, 65536, 0, 0, 0
Binding 5=0x00040005, 0, 53, 65536, 0, 0, 0
Binding 6=0x00040006, 0, 54, 65536, 0, 0, 0
Binding 7=0x00040007, 0, 55, 65536, 0, 0, 0
Binding 8=0x00040008, 0, 56, 65536, 0, 0, 0
Binding 9=0x00040009, 0, 57, 65536, 0, 0, 0
Binding 10=0x0004000C, 0, 58, 65536, 0, 0, 0
Binding 11=0x0004000D, 0, 59, 65536, 0, 0, 0
Binding 12=0x0004000E, 0, 60, 65536, 0, 0, 0
Binding 13=0x0004000F, 0, 61, 65536, 0, 0, 0
Binding 14=0x00200010, 0, 62, 65536, 0, 0, 1
Binding 15=0x00200011, 0, 63, 65536, 0, 0, 1
Binding 16=0x01020012, 0, 33, 65536, 0, 0, 13172
Binding 17=0x02020012, 0, 35, 65536, 0, 0, 13172
Binding 18=0x02020014, 0, 39, 65536, 0, 0, 13172
Binding 19=0x02020015, 0, 38, 65536, 0, 0, 13172
2015-02-20 23:05:21 +01:00
Gregory Hainaut
42b9932bd0 lilypad: add code to bind key 2015-02-20 23:05:21 +01:00
Gregory Hainaut
3096e94616 lilypad : plug a basic keyboard device
Add a reverse fifo to transfer event from core to plugin

Long story short, on linux there is only one event queue in core
2015-02-20 23:05:21 +01:00
Gregory Hainaut
aec43f0bee lilypad: add x11 display pointer
If we move all window management hack into the core it would be useless (for input)
2015-02-20 23:05:21 +01:00
Gregory Hainaut
087f252909 lilypad: add plumbering config
Note: it miss interaction with any dialog
2015-02-20 23:05:21 +01:00
Gregory Hainaut
4f013a2960 lilypad: import common utility to manage config
Based work on spu2x equivalent file. Only convert the file to a CfgHelper object
2015-02-20 23:05:21 +01:00
Gregory Hainaut
156f66ef62 lilypad: make it compile on linux
* Ifdef windows code
* Add a windows crap to linux crap translation layer
2015-02-20 23:05:21 +01:00
Gregory Hainaut
3661f51bcb lilypad: minor c++ fixes
Must be checked on windows
2015-02-20 23:05:21 +01:00
Gregory Hainaut
147353a177 lilypad: add cmake file 2015-02-20 23:05:21 +01:00
Gregory Hainaut
76ff56a4e3 lilypad: add a linux fork
Yes it is bad!
2015-02-20 23:05:21 +01:00
Gregory Hainaut
2471306fc4 cmake: actually onepad requires X11 2015-02-20 23:05:21 +01:00
Gregory Hainaut
1655055f61 onepad: update old comment 2015-02-20 23:05:21 +01:00
Gregory Hainaut
2c481113ad update sv_SV mo file 2015-02-20 19:54:58 +01:00
Gregory Hainaut
a9430bb25e cmake: use O2 instead of every compiler flags
It was done to avoid issue with specific compiler flags. I think it is safe to reenable it now.

There are some flags that are still disabled that potentially could be re-enabled:
-fno-guess-branch-probability
-fno-dse
-fno-tree-dse

But it will be for another PR
2015-02-20 19:47:54 +01:00
Gregory Hainaut
e0f56282de cmake: no preferred-stack-option in asan
It conflicts with the global definition

I don't remember why this option was set on GSdx. Potentially it could be dropped (or fixed correctly)

Anyway, it will help to enable Address Sanitizer on Linux Build
2015-02-20 19:44:51 +01:00
Gregory Hainaut
866f052e34 Merge pull request #442 from pgert/master
sv_SE update
2015-02-20 19:39:55 +01:00
ramapcsx2
5c6b5374af Less verbose SPR stall control logging, avoids fps dives in ST:Voyager 2015-02-15 18:09:14 +01:00
Avi Halachmi (:avih)
f2657ae450 gzip iso: 2nd attempt to fix non-english file names (windows only) 2015-02-10 22:49:29 +02:00
pgert
9a60050e93 Update pcsx2_Main.po 2015-02-06 16:33:34 +01:00
pgert
aa7e745b43 Update pcsx2_Iconized.po 2015-02-06 16:32:06 +01:00
Avi Halachmi (:avih)
f3bb434b27 CDVD: more descriptive browse dialog title 2015-02-05 04:15:49 +02:00
Asmodean-
6440a011bc post-processing updates 2015-02-04 08:42:20 +00:00
ramapcsx2
f88bea5caf PCSX2 will now default to using the preset system for new installs. That
looks far more friendly to new users when they go to configure the
emulator for the first time."
2015-02-01 19:49:10 +01:00
Avi Halachmi (:avih)
c14a4f274f GameIndex.dbf: sort entries 2015-02-01 20:18:59 +02:00
Avi Halachmi (:avih)
6a63a92a1f GameIndex.dbf: update compatibility info
using the data from the forums and web site.
update summary:
Not at dbf (and added): 21
Unchanged: 1832
Better compat: 656
Worse compat: 23

new status:
Compatibility 1: 8 games
Compatibility 2: 38 games
Compatibility 3: 54 games
Compatibility 4: 67 games
Compatibility 5: 2607 games
2015-02-01 19:24:54 +02:00
avih
b2576cd8bb Merge pull request #443 from Asmodean-/master
Some post-processing updates.

- Fixed an old overlooked typo (scalar:scaler)
- Specified some function parameters as input only, for compiler's sake.
- Improved interpolation of the BlendGlow bloom type between light and dark pixels.
- Added a brightpass filter to the bloom to specifiy a light threshold that the bloom will affect.
- Improved some cross processing curve logic.
- Added pre luminance scaling before tone mapping takes place.
- Added both LDR & HDR variants to the tone map options.
- Removed clamping of the tone mapping output.
- Rearranged output of the gamma correction, for a more accurate transition of effects.
- Updated some option descriptions.
- Added the 'BloomCutoff' setting which can a alter the threshold offset for the bloom.
- Adjusted a few option defaults to compensate for logic changes.
2015-01-30 23:19:24 +02:00
Asmodean-
8cb20c5d19 Some post-processing updates. 2015-01-30 18:38:18 +00:00
pgert
4a29c268fd Update pcsx2_Main.po 2015-01-30 11:45:02 +01:00
pgert
1b4d10b58c Update pcsx2_Iconized.po 2015-01-30 11:43:24 +01:00
ramapcsx2
41f07bfed0 Merge pull request #441 from TheLastRar/master
Fix warped read code
2015-01-30 06:45:52 +01:00
Avi Halachmi (:avih)
dacadcdf2f dummy update to test the buildbot versioning 2015-01-29 15:14:00 +02:00
Avi Halachmi (:avih)
267ff7d196 tag v1.3.1: superficial - align the version for buildbot, pcsx2 and git
We should have tagged v1.3.0 at 1fb3d7dd17
but we didn't, and tagging v1.3.0 now (HEAD or retroactively) would only create
confusion.

Instead we're setting a new baseline version of 1.3.1 which will be displayed
at the buildbot lists, at pcsx2, and at the git tag.

This doesn't indicate any change to pcsx2 other than aligning the version
numbers of the various places which use it.
2015-01-29 14:43:31 +02:00
TheLastRar
80b24f8055 Fix warped read code 2015-01-27 15:16:06 +00:00
Avi Halachmi (:avih)
2da3e15aaa patches: move verbose from ELF-log to Dev-verbose
improvements from the previous commit stay (less noisy, better reboot verbose)
2015-01-19 10:12:12 +02:00
Avi Halachmi (:avih)
6305d8d61e patches: reduce console noise for patches/cheats, verbose with ELF-log
1. When changing settings, such as aspect ratio, patches message was spamming
the console, now they don't.

2. Added more verbose patches messages when ELF-log is enabled at the console.
These messages now show whenever patches/cheats are applied, including when
changing settings such as aspect ratio.

3. When rebooting the same game again, some of the cheats messages were not
displayed since it's the same CRC and the logic thought it should remain quiet,
now verbose gets reset on boot which will show all patches messages correctly.

4. Errors/warnings stay the same and not afected by this change.
2015-01-19 01:15:32 +02:00
Gregory Hainaut
9495b8e3e0 Merge pull request #434 from Leucos8/master
Added the latest strings to the Italian translation
2015-01-18 20:56:47 +01:00
Gregory Hainaut
29ef99d2d1 windows build take3: revert previous commit
Use back _Interlocked* function
Use vol_t type for all variables that uses _Interlocked* function
    (so it is compatible with 64 bits)
2015-01-18 19:25:46 +01:00
Gregory Hainaut
6d4039cc85 More fix for windows (extend previous commit) 2015-01-18 13:08:47 +01:00
Leucos
8da5817f8f Added the latest strings to the Italian translation 2015-01-18 11:40:05 +01:00
Gregory Hainaut
4cf1b6068f common: fix windows build (hopefully)
* Use threading wrapper for Mutex.cpp/wxHelpers.cpp
* Cast s32 to long on window

(not tested on windows ;) ping me if it still doesn't work)
2015-01-17 20:39:38 +01:00
Gregory Hainaut
c5e6013d75 Merge pull request #419 from PCSX2/64-bit-crashes-fix
64 bit crashes fix
2015-01-17 12:08:24 +01:00
Gregory Hainaut
0bdeb8d411 Merge pull request #430 from PCSX2/win-ocl-crash-fix
gsdx ocl: check size of array before access
2015-01-17 12:05:52 +01:00
Gregory Hainaut
6bb945f6c8 Merge pull request #428 from pgert/master
Case Mapping & GitHub instead of GoogleCode.
2015-01-16 21:25:36 +01:00
Gregory Hainaut
1295b46a49 Merge pull request #427 from uyjulian/add_forward_compatilbe_gl_core_context
WGL GSdx forward compatible bit

(I think it is for wine)
2015-01-16 21:02:13 +01:00
Johannes Obermayr
149940ffda common: gcc can't inline a couple of function
=> "can never be inlined because it uses variable argument lists"
2015-01-16 20:57:09 +01:00
Gregory Hainaut
70ad09f6ef gsdx ocl: check size of array before access
Potential fix for issue #408 ?
2015-01-16 09:39:50 +01:00
pgert
abb005e6e2 Update pcsx2.1 2015-01-13 13:17:57 +01:00
Gregory Hainaut
079ed2c7a9 Merge pull request #423 from micove/wxconfig-wx30
Search for wx-config-3.0 and wxrc-3.0.
2015-01-12 22:52:24 +01:00
pgert
ad8e800aa5 Update Cfg.c 2015-01-12 13:27:09 +01:00
pgert
6c750b19b3 Update AppInit.cpp 2015-01-12 13:25:50 +01:00
pgert
c0f1738bb9 Update pcsx2.1 2015-01-12 13:24:34 +01:00
Miguel A. Colón Vélez
f160c39814 Remove dead code from cmake/ApiValidation.cmake. 2015-01-12 02:54:49 -05:00
Gregory Hainaut
a5ff4aca80 mvu: add a comment on special 'register'
It explains why first 'register' isn't included in the loop.

Hardware note: it is called a register but in hardware they're just wire
stuck on 0/1, so not a real HW register
2015-01-11 15:37:46 +01:00
uyjulian
446977d126 GSdx forward compatible bit 2015-01-09 19:39:59 -06:00
Miguel A. Colón Vélez
90c4322fc5 Remove check for wxrc since it's not needed. 2015-01-09 07:44:26 -05:00
Miguel A. Colón Vélez
3b83d6d302 Make FindwxWidgets find the correct version/toolkit via wx-config.
WX_vs_SDL() is still needed.
2015-01-09 07:18:16 -05:00
Avi Halachmi (:avih)
7b7a977d11 gzip ISO: fix broken handling of file names with non-english chars
this uses <wxString>.mbc_str() instead of .toUTF8() for all file related
stuff.

also normalizes all Console outputs to use WX_STR(str).

TODO: this was only tested on windows.

if someone could test on linux (wx 2.8 and 3.0) that english-only and not
english-only iso.gz file names work correctly (open the file, create the index,
read the index on next boot and that all console prints are good), please
post a comment.
2015-01-09 12:16:13 +02:00
Miguel A. Colón Vélez
cc9b6fa5a4 Search for wx-config-3.0 and wxrc-3.0.
The comment made it look as an arch-only thing which was misleading.
.
Gentoo uses
wx-config-3.0 and wxrc-3.0
2015-01-08 22:27:16 -05:00
Gregory Hainaut
a3cd81c1bb Merge pull request #421 from micove/fix-issue-402
Fix issues with DOC_DIR_COMPILATION.
2015-01-07 21:59:05 +01:00
Gregory Hainaut
3c11e759a2 Merge pull request #420 from micove/git-cmake
Don't assume .git exists just because git is installed.
2015-01-07 21:58:56 +01:00
Miguel A. Colón Vélez
ed317360ef Fix issues with DOC_DIR_COMPILATION.
This fixes the remaining issues:
- wx2.8 => apparent utf issue.
- wx3.0 => opens the file twice.
.
Fixes #402
2015-01-06 22:02:22 -05:00
Miguel A. Colón Vélez
f392493245 Don't assume .git exists just because git is installed.
find_package(Git) is done in SearchForStuff it could be deleted over there
but it fits better there. The only thing this line did was saying git was
not found for a second time since if it was found then it never triggered.
.
Check for the existance of .git to avoid
fatal: Not a git repository (or any of the parent directories): .git
2015-01-06 21:14:10 -05:00
Gregory Hainaut
b03162747c sVU: add an option to remove it
The goal is to reduce the burden for new architecture port.

Patch is mostly inspired from 3kinox initial patch. The diff are
*/ used ifdef instead of raw removal
*/ gui don't rely on UseMicroVU* option
*/ completely remove sVU_micro.* file
2015-01-06 23:45:43 +01:00
Gregory Hainaut
e0add8003d mvu: mvu VI has only 16 registers
fix issue #417
2015-01-06 23:32:00 +01:00
Gregory Hainaut
678c8a5cd6 cmake: validate wx api
checks wx-config version is compatible with the one requested by the user (wx 2.8 or wx 3.0 with WX28_API option)
2015-01-06 21:55:33 +01:00
Gregory Hainaut
14d4b3fe7a build.sh: add a -no-cross-multilib option
(only for developers)
2015-01-06 21:54:55 +01:00
Gregory Hainaut
a0d54df522 Merge pull request #415 from micove/build-cleanup
Improve build system.
2015-01-06 21:36:24 +01:00
Gregory Hainaut
3f521cc7a0 pcsx2: use %ls for unicode string
%s seems to work because the printed string is single char. Let's be
pedantic
2015-01-05 23:59:08 +01:00
Gregory Hainaut
04ca7f4a2b common: 64 bits intrinsic fixes
long is 8B on linux. Replace it with s32
long long is always 8B but let's replace it with s64 so we are sure
2015-01-05 23:46:18 +01:00
Gregory Hainaut
e447ffc8b2 cmake: fix asan on 64 bits 2015-01-05 23:45:37 +01:00
Gregory Hainaut
aba0a09816 pcsx2 64b: fix crash on string formating function
Call to vsnprintf update the gp_offset of the varargs (at least on x86_64 linux).
Therefore the 2nd call (because buffer was too small) uses out-of-memory arguments

We need to keep a local copy otherwise you will get an awful SIGSEV

Note: I'm sure we have same issue on plugins
2015-01-05 23:38:30 +01:00
Miguel A. Colón Vélez
305942c78b Rely on the user specifying WX28_API. 2015-01-04 15:08:12 -05:00
Gregory Hainaut
90d27bf5f6 cmake: try to validate the user option
* GTK3_API requires a wxWidget that support it too
=> avoid complexe compilation error
* SDL2_API requires a wxWidget without SDL support (wxUSE_LIBSDL = 0)
=> avoid run time  crash

SDL check hypothesis: wx is linked against SDL1.2 and not SDL2. It would need to be improved on a distant future
2015-01-04 20:43:26 +01:00
Gregory Hainaut
0346da2fa0 cmake: both zzogl and gsdx require gtk
Actually everything require GTK
2015-01-04 19:54:05 +01:00
Miguel A. Colón Vélez
7c766e66ad Add the option of cross compiling by default in build.sh.
Revert this or use useCross=0 for normal behaviour.
2015-01-04 01:32:04 -05:00
Miguel A. Colón Vélez
8440d263cd Respect the CC and CXX environment variables when cross building. 2015-01-04 00:56:47 -05:00
Miguel A. Colón Vélez
e23e2ac327 Rely on clang autodetection instead of user input. 2015-01-03 22:07:16 -05:00
Miguel A. Colón Vélez
6e28a8e694 Update the archlinux wx fix.
This fixes it for build.sh and when not using build.sh (packaging).
.
Also fix native 32bit build which should also be broken and attempt to
predict the future and fix it for lib32-wx3.0. Worst case the filenames
have to be fixed which is trivial.
.
When wx2.8 support is dropped then only the lib32-wx3.0 IF should remain.
When crosscompilation support gets dropped then the first IF gets deleted
unless we also dropped wx2.8 support then everything gets deleted.
2015-01-03 22:00:47 -05:00
Avi Halachmi (:avih)
5933db386a gzip ISO: fix compile issues on linux 2015-01-03 18:50:07 +02:00
Gregory Hainaut
aea421cc8e partially revert #403
One define doesn't exists on linux
2015-01-03 15:52:43 +01:00
antoine faravelon
cdd6598e65 Update build.sh with 64bit support and with wx2.8 forced for archlinux
wx3.0 32bit is not in main repositories, better to avoid the use of aur just for pcsx2
2015-01-03 15:15:07 +01:00
Gregory Hainaut
a11286bbc5 Merge pull request #403 from pgert/master
Update i18n.cpp
2015-01-03 14:58:32 +01:00
Gregory Hainaut
798fa11c57 Merge branch 'micove-use-target-arch' 2015-01-03 14:51:12 +01:00
Miguel A. Colón Vélez
c2cba0d4ae Quick regression fix for SDL2 detection.
I only had to add "PATH_SUFFIXES SDL2".
.
include is superfluous
SDL2-2.0 is a distro specific convenience symlink. Use the correct one
as before.
.
I probably did this as an artificial way of disabling pkgconfig when cross
compiling and before disabling pkgconfig for all cross compiling but it's
wrong. I thought I had fixed this already.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez
be1842f4e9 Detect clang and automatically set USE_CLANG.
User may forget or not know about -DUSE_CLANG=TRUE. It could probably
be always autodetected instead of requiring user input.
.
Trivial wording changes to compiler_version.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez
c8c22cf6a0 Notify about cross build option upon failure.
Tell the user to use CMAKE_TOOLCHAIN_FILE upon failure.
.
Cleanup detectOperatingSystem. Should be the same but adding
GNU and kFreeBSD from Debian and filtering out pre OS X Apple.
.
libaio is linux only. Also check for the correct header since
aio.h is the POSIX one. Both are in /usr/include/ anyway.
Only build core if (Linux AND NOT AIO_FOUND) == false.
.
Use Unix for GTK and X11. Macs has gtk-quartzs and xquartz or native X11.
*BSD, linux, etc should have both.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez
b42c9defb1 Avoid PKG_CONFIG_PATH issues.
Even before this pull request it was required to set PKG_CONFIG_PATH
when cross compiling since pkg-config always searches for native
libraries. This would require to backup an already existing ENV
variable if present, detect the distro specific place the pkgconfig folder is,
and restore the original ENV variable if it was present. Cmake as shown in:
.
http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3df51470
.
added support for this but requires CMAKE_MINIMUM_REQUIRED_VERSION as 3.1
which is kind of strict since it was released 10 days ago.
.
To avoid the ugliness let just avoid pkg-config when cross compiling. This
means only EGL, SDL2 and GTK3 have to be updated since the rest work w/o
pkg-config.
- EGL is fixed with PR #409
- SDL2 is fixed here and it's trivial.
- GTK3 is non-trivial. For this one use pkg-config for native builds since
  the .pc file is kept up to date automatically. For cross compilation
  use the provided FindGTK3 which I made by using the sed documented
  inside the file and updating the dependencies for GTK3. Since I checked
  each and every single .pc file to make sure they are up to date this
  should have the same behaviour as pkg-config. Prefer the .pc files for
  native builds since it does not need to be manually updated and when
  the native 64bit port gets finished all the cross compile options should
  be removed which is quite easy since most of the code got moved to the
  CMAKE_TOOLCHAIN_FILE.
Note:
Cmake Modules are BSD-3-clause therefore GPL compatible.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez
bed7a4f92e Be really strict about dependencies.
The obtained binaries before and after this commit are identical (sha1sum)
when compiled in Debian/Ubuntu/Fedora/ArchLinux.
.
The linker will always pick the 32bit libraries the only thing this does is
make sure we have all the 32bit dependencies installed. Basically we avoid
detecting the 64bit libraries and telling the users the 32bit libraries were
found. We always link with 32bit libraries therefore this avoids having to
wait 5-10min to just be told -lXXX is missing.
.
The only thing really needed are
set(CMAKE_LIBRARY_ARCHITECTURE "../lib32")
set(CMAKE_LIBRARY_ARCHITECTURE ".")
.
which basically ensures we don't pick 64bit headers since
CMAKE_LIBRARY_ARCHITECTURE always gets tested first and for some reason
FindGTK2 test searches lib64 first then lib32/lib. These values are hardcoded.
Right now these arch specific headers are not used but can't say this will
always be true.
.
FIND_LIBRARY_USE_LIB64_PATHS is not needed for native builds and it's covered
by CMAKE_SYSTEM_IGNORE_PATH.
.
NOTE:
We filter out lib32 because multilib is not compatible with multiarch.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez
553536f9cb Fix build in Fedora and print a confimation of cross compilation.
- Fedora only needs --arch if cross compiling.
  + It's only used to select libdir so i386=i686=i986
- Messages are nice to debug build logs.
.
Everything seems to work unless some other distro broke. Other
distros need to add CMAKE_TOOLCHAIN_FILE or --cross-multilib if
they cross compiled amd64 -> i686.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez
b03ca5fcf4 Include some rather simple CMAKE_TOOLCHAIN_FILE.
- Update the build.sh and fix some typos.
  + Don't add the OSX ones because I have not tested them and it won't
    even build anyway due to the libaio dependency. Needs to use POSIX AIO
    or something else.
- They are rather simple and all the magic happens in two lines.
  + First line tells cmake to get ready to compile FOR linux or darwin.
    It also sets CMAKE_CROSSCOMPILING to true which is the only way to
    let cmake known that we are using stuff not from the host.
  + CMAKE_C_COMPILER/CMAKE_CXX_COMPILER are basically used to detect
    the architecture of the target. Since I used generic cc/c++ the
    hardcoded -m32 is needed to ensure we get TARGET=i386. Also
    since I hardcode -m32 and use c++/cc it's to be noted that
    we can only do i386->i386 (trivial), amd64 -> i386, and x32->i386.
    .
    Using something like i586-linux-gnu-{gcc,g++} would also work and
    enable arm -> i386, etc but it's infeasible and impractical to do all
    the combinations. File is simple enough that a distro or user can
    create their own and cross compiling is rather tedious compared
    to using a chroot to compile it.
- I tested it in Debian with "dpkg-buildpackage -ai386" but installing the
  build dependencies was rather tedious.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez
d6d06d243c Begin cleaning up the cross build code.
http://www.vtk.org/Wiki/CMake_Cross_Compiling
http://www.cmake.org/cmake/help/v3.0/manual/cmake-toolchains.7.html
.
The official way that cmake does cross compiling is via the use of a
CMAKE_TOOLCHAIN_FILE. This has to be given by the user and can't be
included from within a Cmake file since setting up the toolchain has
to be the first thing that happens.
.
After the file is given and validated cmake behaves nicely and all the
workarounds and hacks are not really needed anymore.
.
The consequence of this change is that without this file cmake will
try to build for the HOST architecture as expected and with the file
it will build for the TARGET architecture of the given toolchain. Due to
this remove 64BIT_BUILD_DONT_WORK and just ERROR out if the user tries
in the same way as before.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez
8ea0766773 Use TargetArch to correctly detect the target.
Currently crosscompiling was broken since we detected the cpu of the host
not of the target. Building arm -> i386, i386->amd64, etc resulted in
interesting stuff.
.
CMAKE_HOST_SYSTEM_PROCESSOR and CMAKE_SYSTEM_PROCESSOR should have done this
but they are incredibly broken and unreliable. I use
CMAKE_HOST_SYSTEM_PROCESSOR just to retain the format of the old message
and is not used for critical stuff so it does not matter.
.
This code also allows scalability so that if one day in the very distant
and unlikely future the x86/x86_64 specific code gets made portable
by replacing asm/MMX/SSE*/AVX/etc code with generic/portable code then
it also would work on all architectures.
.
For *BSD/OS X it probably would need to use POSIX AIO instead of linux
specific libaio but that is a different issue.
.
Error out the x86_64 builds.
Also the 64BIT_BUILD_DONT_WORK option became obsolete more info in following
commit.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez
e548ada1e9 Disable the use of multiple architectures in darwin.
- Update copyright due to incoming changes.
- Don't support universal binaries until they actually work therefore
  only allow 1 architecture in CMAKE_OSX_ARCHITECTURES.
- Don't allow an empty ARCH list.
  We probably asked for ppc or ppc64 w/o support for it.
2015-01-03 14:51:04 +01:00
Miguel A. Colón Vélez
b18b0fdf28 Add TargetArch.cmake.
For now just dump the original and add the BSD-2-Clause.
.
It's GPL compatible so it's okay.
.
I was writting one myself but found this one and it handles apple
which I did not consider since I can't test it.
2015-01-03 14:51:04 +01:00
Gregory Hainaut
806cefb0c6 64 bit: use uptr instead of int 2015-01-03 14:50:54 +01:00
Gregory Hainaut
f33027f24d Merge pull request #409 from micove/small-cleanup
Fix GSdx build and enhance the desktop file.
2015-01-03 14:47:54 +01:00
Avi Halachmi (:avih)
b07aeb892a cheats_ws.zip: now has 1763 files - 583 new, 105 modified, 14 removed
This is the cheats_ws folder inside Devina's archive from 2014-12-18, with 5
removed WIP patches (CRCs: 0E7F91DA, 4C33FA2A, 1771BFE4, C77AF2CA, DA3DD765),
zipped and replacing the existing cheats_ws.zip file.

See http://forums.pcsx2.net/Thread-PCSX2-Widescreen-Game-Patches?pid=423433#pid423433
2015-01-02 04:08:58 +02:00
Avi Halachmi (:avih)
e525f95f22 gzip ISO: allow custom index file name/location via a template
At PCSX2_ui.ini: default:  GzipIsoIndexTemplate=$(f).pindex.tmp
The rules:
- must contain one and only one instance of '$(f)' (without the quotes)
- if starts with $(f) then it expands to the full path + file name.
- if doesn't start with $(f) then the path is ignored (name+ext only)
- if doesn't start with $(f) and ends up relative,
  then it's relative to pcsx2.exe (not to cwd)
- No checks are performed if the result file name can be created, so the dir
  should exist.
- PCSX2 will not try to rename/move older index files to the new name/location.
  If it's modified - the user should take care of rename/move before loading
  gzipped iso files or else it will create a new index according to the template

Examples:
$(f).pindex.tmp - the default - same dir as the iso, loads older index files.
$(f).pindex     - a popular request.
cache.gz/$(f)   - relative to pcsx2.exe (if the dir exists).
%appdata%/pcsx2/cache.gz/$(f) - should end up at the default install docs dir.
2015-01-02 03:27:06 +02:00
avih
1c869450c1 Merge pull request #413 from monsterjamp/master
Small update to GameIndex
2015-01-01 04:42:48 +02:00
monsterjamp
7082102631 Small update to GameIndex 2014-12-31 18:50:37 -06:00
Avi Halachmi (:avih)
10040f82e0 UI: change language: more standard dialog and better Apply button
The Apply button was part of the language panel, now it's part of the dialog.
Also, The Apply button is now enabled/disabled correctly.
2014-12-31 12:32:29 +02:00
Avi Halachmi (:avih)
2b567e51ff nogui: don't zombie on suspend. --noguiprompt to prompt before exit
when running with --nogui, PCSX2 knows to exit when the GS window closes.
However, pressing esc (suspend) didn't close the window and instead hidden it.
As a result, PCSX2 didn't exit and remained a zombie process.

this patch closes the gs window on suspend in --nogui mode, which makes PCSX2
exit fully.

it's now also possibly to use --noguiprompt which prompts if esc will exit
PCSX2, and allows the user to abort the suspend and continue using PCSX2.

TODO: if PCSX2 was in full screen - then pressing esc exits full screen. it
would have been ideal to restore full screen, but for now it doesn't.
2014-12-31 03:37:24 +02:00
Avi Halachmi (:avih)
576513a6d0 kb shortcuts: fixed file name PCSX2_keys.ini to PCSX2_keys.ini.default 2014-12-30 22:22:43 +02:00
Avi Halachmi (:avih)
25382d471d kb shortcuts customization: improve messages, add sample PCSX2_keys.ini
- don't display a message if the replacement is the same as the default.
- display a message if the key combination is unknown
- (same as before) display a message when replacing a shortcut
- also added PCSX2_keys.ini.default sample file with some help
2014-12-30 22:15:01 +02:00
Avi Halachmi (:avih)
c4bd50c04c UI: Change Language: use a dialog instead of forcing first-time-wizard
The method of forcing first-time-wizard wasn't very effective because
1. it's ugly, and 2. after selecting the language at the wizard it either
imports the previous settings (together with the previous language thus
overriding the new language) or resets all other settings - which is not fun.

This patch uses a small dialog instead to only change the language, and within
it reuses the language panel from the first time wizard.
2014-12-30 19:31:50 +02:00
Avi Halachmi (:avih)
1779ee42c2 log console: Sources menu - add Restore Default item 2014-12-30 05:29:39 +02:00
Avi Halachmi (:avih)
95e00e0edf cheats[_ws]: don't ignore custom folders for cheat files
The code was searching only at the default paths for cheats and cheats_ws.
Now it's possible to set UseDefaultCheats[WS] at PCSX2_ui.ini to 'disabled'
and set a custom value to Cheats and/or CheatsWS and PCSX2 will respect it.
2014-12-29 14:21:38 +02:00
Miguel A. Colón Vélez
6dd3094802 Fix the rare case in which EGL is not found.
EGL sometimes is not found. Checklib 1st does
.
string(TOLOWER ${lib} lower_lib)
pkg_search_module(${var} QUIET ${lower_lib})
.
Therefore this part should be equivalent since we always compare lower.
.
This part seems to not find anything and then it does.
.
find_library(${var}_LIBRARIES ${lib})
.
Here it also does not find anything since it tries to find libegl
while the library is called libEGL therefore I changed the name to upper.
to avoid
_internal_message("-- ${lib} not found (miss lib)")
.
It could fail in the unlikely event that someone renamed libEGL to libegl.
This bug is triggered when you combine crosscompiling from amd64 to
i386 with Debian multiarch paths. For other distros it should work with
pkg_search_module normally.
2014-12-24 11:41:04 -05:00
Miguel A. Colón Vélez
9060eadfe7 Add the new Keywords entry to the desktop file.
It was added recently to the xDG specs
http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html
.
It should improve the discoverability of pcsx2 for gnome shell users in any
distro and Ubuntu users at the very least. It's unrelated to the menu
hierarchy so it does not need a special hack for OpenSuse. Also it should
not break anything.
.
It's an optional entry but the "gnome guys" really want software to use it
more.
.
It should be concise and not the name of the software so I just did
game;emulator; since for example gnome-chess uses game;strategy;.
2014-12-24 11:27:49 -05:00
Gregory Hainaut
d4793cc6b6 i18n: update build of various translation 2014-12-23 19:51:03 +01:00
Gregory Hainaut
c5b6216032 Merge pull request #405 from PCSX2/disable-opencl
gsdx ocl: disable it on windows
2014-12-23 19:48:50 +01:00
Gregory Hainaut
ee34bd724f gsdx ocl: avoid a crash if ocl is selected but not enabled 2014-12-23 19:39:02 +01:00
Gregory Hainaut
59847c964c Merge pull request #404 from Leucos8/master
Italian translation and game database update
2014-12-23 19:37:09 +01:00
Gregory Hainaut
d22a2c7961 Merge pull request #407 from josephgbr/master
Updated Brazilian Portuguese translation
2014-12-23 19:36:55 +01:00
Rafael Ferreira
f037a42309 Updated Brazilian Portuguese translation
Signed-off-by: Rafael Ferreira <rafael.f.f1@gmail.com>
2014-12-23 14:05:16 -02:00
Gregory Hainaut
fbb64c4ce7 Merge pull request #406 from nE0sIghT/master
Cmake: Use ${DOC_DIR} variable for docs destination
2014-12-23 10:08:49 +01:00
nE0sIghT
003ac1b762 Use ${DOC_DIR} variable for docs destination 2014-12-22 23:02:44 +03:00
Gregory Hainaut
d00666a4d9 cmake: regression to select SDL/GTK + 64bits fix 2014-12-22 19:31:32 +01:00
Gregory Hainaut
767b841fea gsdx ocl: disable it on windows
Until we found a way to fix a couple of crashes
2014-12-22 19:02:35 +01:00
Leucos
fd89d2145a Game database update
Many game title correction/update/normalization
2014-12-21 16:59:31 +01:00
Gregory Hainaut
6830962c3a i10n: update sv_SE 2014-12-21 16:54:41 +01:00
Gregory Hainaut
0c17d67fa5 cmake: add a new option to select the doc path in package mode
DOC_DIR_COMPILATION=/usr/share/doc/pcsx2

close issue #402
2014-12-21 16:51:41 +01:00
Leucos
bc4eff88a7 Updated the Italian translation 2014-12-21 16:28:13 +01:00
pgert
93cbce82f9 Update i18n.cpp 2014-12-21 14:38:07 +01:00
Gregory Hainaut
8123b5090a Merge pull request #400 from pgert/master
sv_SE translation
2014-12-21 13:21:43 +01:00
Gregory Hainaut
da969ffaeb Merge pull request #401 from PCSX2/unicode-mess
pcsx2:wx3: fix filter selection of iso
2014-12-21 13:21:35 +01:00
Gregory Hainaut
b24c76f12a SafeArray: add a null pointer check
Thanks @ghost for the report.

Close issue #327
2014-12-21 12:49:02 +01:00
Gregory Hainaut
0b77f93154 console: improve readability on consoles that have black backgrounds
Thanks Micove for the patch.

Close issue #383
2014-12-21 12:41:01 +01:00
Gregory Hainaut
2bc4686afa pcsx2:wx3: fix filter selection of iso
On linux, wxChar requires a %ls

It must be tested on windows:
1/ >CDVD>Iso selector>Browse...
2/ try the different filter
2014-12-21 12:34:05 +01:00
Gregory Hainaut
dc1cd3eb25 cmake: forbid user to use experimental flags
Namely GTK3_API and 64BIT_BUILD_DONT_WORK

The former was barely tested and doesn't compile with standard wx
The latter doesn't work at all

Note: I was very close to disable SDL2 too.  If wxWidget was built with
SDL1 support it will crash
2014-12-21 10:46:33 +01:00
pgert
7ab320b5d5 Update pcsx2_Main.po 2014-12-20 21:27:58 +01:00
pgert
4074f1b1ed Update pcsx2_Iconized.po 2014-12-20 21:27:12 +01:00
pgert
f7ffe391f6 Update pcsx2_Main.po 2014-12-20 21:21:46 +01:00
pgert
82c3a5ad5a Update pcsx2_Iconized.po 2014-12-20 21:20:53 +01:00
Gregory Hainaut
1f54bb73aa cmake: enable some aggressive warning
Allow to track strict aliasing issue and overflow
2014-12-20 13:43:25 +01:00
Gregory Hainaut
66d7aa75e2 cmake: move -DNDEBUG to global option 2014-12-20 13:43:25 +01:00
Gregory Hainaut
a99f3ea321 cmake: remove duplicate flags
also use the lighter elseif structure to reduce a bit the size of cmakefile
2014-12-20 13:43:25 +01:00
Gregory Hainaut
4773bcf0ea cmake: s/_LINUX/__linux__/ 2014-12-20 10:54:24 +01:00
Gregory Hainaut
532cc7755c cmake: remove cmake from 3rdparty
3rdparty have been deprecated since a long time on linux.

Files are likely wrong
2014-12-20 10:54:18 +01:00
Gregory Hainaut
4f957feacd onepad: use union instead of stange cast
Nicer this way. Beside it removes the strict aliasing issue.
2014-12-20 10:54:18 +01:00
Gregory Hainaut
43e854fece spu2x: remove duplicated function 2014-12-20 10:54:18 +01:00
Gregory Hainaut
03a88aab0b translation: Refresh all languages 2014-12-15 19:29:44 +01:00
Gregory Hainaut
ff24a5f702 gsdx linux: disable std::thread
Threads are not killed properly therefore GS crashes on reloading (aka F9)

See issue #392
2014-12-14 12:22:40 +01:00
Gregory Hainaut
b9297c6158 Merge pull request #377 from PCSX2/tlb_goemon_v2
goemon gamefix improvement
2014-12-14 11:47:37 +01:00
Gregory Hainaut
316efecaea Merge pull request #393 from CecilHarvey/master
updated zh_CN translations
2014-12-13 17:05:03 +01:00
Wei Mingzhi
f0a9f0ff29 updated zh_CN translations 2014-12-13 23:57:53 +08:00
Gregory Hainaut
63ba78b664 remove zzogl-pg-cg
superseeded by zzogl-pg
2014-12-13 12:28:37 +01:00
Gregory Hainaut
09ec6ebd8e pcsx2: fix a gcc warning 2014-12-13 12:28:37 +01:00
Gregory Hainaut
62bda675e0 build.sh: wx30 is the default, the option is useless 2014-12-13 12:28:37 +01:00
Gregory Hainaut
7d21497c11 clang: no support of f-abi-version=6 option 2014-12-13 12:28:37 +01:00
Gregory Hainaut
768362852e pscx2: s/wxTrap/pxTrap/
wxTrap is only enabled on wxDebug build. pxTrap is always available. It is much nicer for debug on linux
2014-12-13 12:28:37 +01:00
Gregory Hainaut
c5efdb9df9 Merge pull request #391 from micove/flush-color-reset
Don't buffer the changes to the console colors.
2014-12-13 10:55:21 +01:00
Miguel A. Colón Vélez
c7c8b70b22 Don't buffer the changes to the console colors.
After a Console.Write/Writeln that uses colors a call to
ConsoleColorScope::LeaveScope() is made to restore m_old_color. This
restoration command stays buffered until a full line is printed. In the
meantime any console message that happens will use the old coloring
and if the program happens to crash the console would keep using the
color of the last colored text that was printed.
2014-12-12 19:44:45 -05:00
Gregory Hainaut
01b0556419 goemon: reset recompiler after tlb unmap
Let's avoid unvalid virtual address on recompiler block
2014-12-12 22:43:01 +01:00
Gregory Hainaut
18405e2598 gsdx: add goemon comment on some assertion
If someone want to trigger them
2014-12-12 22:31:31 +01:00
Gregory Hainaut
cb73ed4737 pcsx2:tlb:goemon: allocation can be called from 2 places
* game is working :)

Note1: I dissassemble the main exe to search all call of the allocation (unlikely to have more calls)
Note2: it is easier to use the return of the function so allocation is done in the tlb[array] cache
2014-12-12 22:25:56 +01:00
Gregory Hainaut
e6de35f5ac pcsx2:tlb: enable GoemonUnloadTlb on recompiler 2014-12-12 22:14:08 +01:00
Gregory Hainaut
a8ad598153 pcsx2:tlb: improve goemon gamefix log 2014-12-12 22:14:08 +01:00
Gregory Hainaut
2cfbc6e5ef pcsx2:tlb: extend goemon gamefix
Add GoemonUnloadTlb function that invalidate TLB cache.

Currently the function is only used on the interpreter. It fixes TLB error after a reload of data.

Next step: porting to the recompiler
2014-12-12 22:14:08 +01:00
Gregory Hainaut
8d8aa87457 pcsx2: interpreter: better use pc
cpuRegs.pc is the actual pc+4...
2014-12-12 22:14:08 +01:00
Gregory Hainaut
bf9fc521cb disassembler: Allow to print register value
* Create a disBranch to factorize a bit the code

* Add PRINT_REG_CONTENT define that add a 32bits value of registers for
  standard opcode. (Far from perfect, but it very useful)
2014-12-12 22:14:08 +01:00
Gregory Hainaut
cebccea81c gsdx: disable some gl extensions when VMware driver is detected
It is likely the Mesa driver, code seems to have the same issue (separate shader)
2014-12-12 20:44:58 +01:00
Gregory Hainaut
35f26f00bc Merge pull request #386 from PCSX2/remove-tls
spu2x:zzogl: disable TLS
2014-12-11 09:55:17 +01:00
Gregory Hainaut
534b7041f4 Merge pull request #385 from PCSX2/gtk3_compilation_fix
Gtk3 port (require wx built against GTK3).
2014-12-11 09:54:45 +01:00
Gregory Hainaut
3d071e50ad gtk3: gtk_hscale_new_with_range => gtk_scale_new_with_range 2014-12-10 22:09:21 +01:00
Gregory Hainaut
feca2e3faf gtk3: GDK_WINDOW_XID was renamed
Well I guess. Not sure until I can test the behavior.
2014-12-10 22:09:21 +01:00
Gregory Hainaut
5d8b2d8044 gtk2: GtkNotebookPage is useless
And not supported by gtk3
2014-12-10 22:09:21 +01:00
Gregory Hainaut
e9233f4698 gtk2: use text rather than image
Require by GTK3
2014-12-10 22:09:21 +01:00
Gregory Hainaut
7fb548d7c5 gtk2: GTK_OBJECT is useless 2014-12-10 22:09:21 +01:00
Gregory Hainaut
d1389db2f4 gtk2: keyboard macro update 2014-12-10 22:09:21 +01:00
Gregory Hainaut
ba9e998ff5 gtk2: port gtk_combo_box to gtk_combo_box_text
The former was deprecated on gtk2.24 (and removed from gtk3)
2014-12-10 22:09:21 +01:00
Gregory Hainaut
cdd09a2616 gtk2: use a pointer as argument instead of g variable
Easier and compliant with gtk3
2014-12-10 22:09:21 +01:00
Gregory Hainaut
800262fc14 cmake: add a new GTK3.0 option
Thanks #micove for the patch
2014-12-10 22:07:48 +01:00
Gregory Hainaut
4991f9412d Merge pull request #387 from PCSX2/XDG_HOME_CONFIG-use-PCSX2-issue-381
pcsx2: use PCSX2 uppercase for XDG_HOME_CONFIG default value
2014-12-09 09:11:10 +01:00
Gregory Hainaut
87f1e8f77d pcsx2: use PCSX2 uppercase for XDG_HOME_CONFIG default value
This way it will always be the same.

Fix issues #381

Note: potentially we might need to move your previous directory.
mv $HOME/.config/pcsx2 $HOME/.config/PCSX2
2014-12-08 23:51:02 +01:00
Gregory Hainaut
5ce4b85edd build.sh: allow to use cmake option directly
It is handy to test option barely used. New options could be added to the script but there are alredy too much of them.
2014-12-08 23:48:00 +01:00
Gregory Hainaut
a52f598369 spu2x:zzogl: disable TLS
builds an Utilies_NO_TLS.a archive of the common Utilities code. It replaces native TLS by a slower reimplementation

Rational: number of TLS slot is very limited by the GLIBc on linux. I hope it doesn't impact performance.
* Zzogl don't requires TLS AFAIK
* spu2x will likely use it for assertions only.

TLS exhaustion creates issue to dlopen plugins
    issue #384 : https://github.com/PCSX2/pcsx2/issues/384

But also for profiled build (-fprofile-generate)
    http://forums.pcsx2.net/Thread-WORKAROUND-build-with-fprofile-generate

If someone have a better idea, please raise your hand!
2014-12-08 22:26:46 +01:00
Gregory Hainaut
0a4f9e43d9 cmake: clean sdl management
* sdl is mandatory for spu2x
* cmake will include either /usr/include/SDL or /usr/include/SDL2 so no
  need to add extra ifdef
2014-12-07 21:06:21 +01:00
Gregory Hainaut
9e8b0b59ba cmake: remove a duplicated line 2014-12-07 12:47:35 +01:00
Gregory Hainaut
29a14f5667 sed -i -e 's/seperately/separately/'
Thanks micove again
2014-12-07 12:46:16 +01:00
Gregory Hainaut
49d98a4429 pcsx2: move tlb info from warning to COP0_LOG
It will ease debug (pc is printed) and reduce noise for standard users.
2014-12-07 12:20:59 +01:00
Gregory Hainaut
c945aead54 cmake: better support of SDL2
Description: Building with SDL2_API=TRUE is incomplete
 SDL_FOUND does not imply SDL2_FOUND
 Use check_libs for detection
 Only include ${SDL_INCLUDE_DIR} when needed
 Use SDL2_LIBRARIES
Author: Miguel A. Colón Vélez

Gregory: add back SDL_BUILDING_LIBRARY
2014-12-07 12:19:14 +01:00
Gregory Hainaut
16284d0a59 gsdx: fix a couple of typo
From @micove
2014-12-07 12:12:53 +01:00
Gregory Hainaut
4b6632edf4 linux: use wx3.0 by default
+ Wx3.0 fixes various issue on linux (better sizing of box)
+ Debian doesn't provide wx2.8 anymore. Ubuntu will probably follow soon (close issue #342)

If you want to use wx2.8:
* Either you remove wx3.0 from your system
* Either you use the cmake option -DWX28_API=TRUE

Please don't hesitate to report any regresions.
2014-12-06 19:59:32 +01:00
Gregory Hainaut
070dce4c83 Merge pull request #356 from PCSX2/issue-fixes
various bug-tracker fixes
2014-12-06 19:48:13 +01:00
Gregory Hainaut
8afd2edd1d pcsx2:gui:wx3: wrong order of language in wizard
It seems wx3 remove all non alphanumeric character before the sorting
A 0 was added to force default to be the first choice as expected
2014-12-06 17:12:26 +01:00
Gregory Hainaut
7328e55ee9 pcsx2: disable tlb miss on the interpreter
Except on the debug build
2014-12-02 23:10:58 +01:00
Gregory Hainaut
1f5fe7a1db Merge pull request #348 from 3kinox/master
GSdx-ogl linux: std::thread
2014-12-02 22:43:29 +01:00
Gregory Hainaut
ec976743d6 Merge pull request #350 from PCSX2/interpreter-tlb-handler
Interpreter tlb handler
2014-12-02 21:47:56 +01:00
Gregory Hainaut
c9aa04c679 core: EE interpreter major speed boost
Disable the debugger and an useless debugI function

* x2 on dbg build :)
* x2.5 on dev build :)

Note: debugger doesn't work yet with the interpreter so no real drawback.
2014-12-02 21:38:39 +01:00
Gregory Hainaut
9c92a30dbb pcsx2: interpreter: add a typical example to disassemble R5900
Previous examples don't work anymore

v2: merge the cpu dump example
2014-12-02 21:38:39 +01:00
Gregory Hainaut
8a899c4c7b pcsx2: interpreter: increment pc before reading pc content
memRead32 could throw a TLB miss exception, however TLB handler expects pc counter to be incremented

Goemon is now really "playable" with the interpreter (disable automatic gamefix)
2014-12-02 21:38:39 +01:00
Gregory Hainaut
a30bd86311 pcsx2: interpreter: add an exception for tlb miss
When a tlb miss is detected current instruction must be skipped. We need
to immediately switch to the handler

Typical instruction bug case:
 lw a0, 0x8(a0)

a0 mustn't be loaded if we have a miss

v2: create a dedicated exception for tlb miss

v3:
* rename exception to CancelInstruction
* add a basic state machine on the exec loop so we keep same behavior
  for eeloadReplaceOSDSYS and eeGameStarting

v4: remove assert
2014-12-02 21:38:29 +01:00
Gregory Hainaut
374048e1c6 Merge pull request #367 from PCSX2/gabest11-master
GSdx-opencl
2014-12-02 20:59:23 +01:00
Gregory Hainaut
4238261784 gsdx-cl: update linux menu config
Try to use some id to be more robust

The best will be to sort the array first
2014-12-02 00:16:35 +01:00
Gregory Hainaut
76f719e5d0 gsdx-ocl: Add a ENABLE_OPENCL option
* Allow to compile GSdx on linux without opencl yet.
2014-12-02 00:16:35 +01:00
gabest11
b9b02cf749 implemented opencl program caching on disk under the system default temp folder, needs some additional work on linux 2014-12-02 00:16:35 +01:00
gabest11
ba59036a97 fixed a small compiling error in release mode 2014-12-02 00:16:35 +01:00
gabest11
7b466a98d0 replaced opencl.def with dynamic dll loading, god bless search and replace 2014-12-02 00:16:35 +01:00
gabest11
e3ba15de94 opencl device selection in settings dialog 2014-12-02 00:16:34 +01:00
gabest11
6f5cd1cd4d joined some tfx kernel calls, general speed up in most games 2014-12-02 00:16:34 +01:00
gabest11
3d2b0e3766 minor opencl kernel optimizations 2014-12-02 00:16:34 +01:00
gabest11
72cfc6a6ef 3rdparty/opencl 2014-12-02 00:16:34 +01:00
gabest11
9e20387595 Modified for opencl 1.1. While it runs on nvidia cards now, you can't use its sdk to compile gsdx, cl.hpp is missing there. Intel or amd is ok. 2014-12-02 00:16:34 +01:00
gabest11
263c097d13 solution for 32-bit z values in opencl and other minor optimizations 2014-12-02 00:16:34 +01:00
gabest11
c64f9ad9b1 squishing opencl bugs, there aren't many left hopefully 2014-12-02 00:16:34 +01:00
gabest11
ba1e522bbb Less opencl bugs, some games are actually playable now, there are still texture errors. 2014-12-02 00:16:34 +01:00
gabest11
881735b562 minor merging errors 2014-12-02 00:16:33 +01:00
gabest11
db7c26cde7 - Experimental OpenCL renderer (missing features: point, line, texture cache, mipmap, aa1, device selection). Needs any OpenCL SDK for the common headers and stub lib to compile, tested with AMD and Intel. Too bad it is not part of the Windows SDK yet.
- Renumbered renderer ids, compatible with old numbering, but it does not follow the mod3 logic anymore.
2014-12-02 00:16:33 +01:00
Gregory Hainaut
1b555ea3b5 gsdx-linux: Fix GSdx internal counter on linux
The issue is that clock gives the total cpu time of the process whereas
we want the cpu time of the rendering thread
2014-11-24 23:44:32 +01:00
Nicolas Hillegeer
b259a46ab7 linux/threads: simplify timer code
Possibly also changes the semantics. According to the docs, it should now be
equal to the Windows code (up to accuracy issues, of course).

v2: done by gregory38

Fix miscalculation of time. Unit must be in 1s/GetThreadTicksPerSeconds(). (now us)

Factorize a bit GetCpuTime/GetThreadCpuTime

Note: results seems reasonables and mostly equivalent as before.
2014-11-24 23:31:32 +01:00
Gregory Hainaut
0f2f25845d core: use memcpy and reserve function
newMem is a new memory allocated by "new". There is no way that is
overlap with previous allocation. Therefore the faster memcpy can be used safely
2014-11-24 10:00:46 +01:00
3kinox
732cbc3ad5 GSDX-ogl linux:
+ Implement threads/mutex using std::thread/std::mutex/std::condition_variable
+ Old implementation can be used by commenting out the "define _STD_THREAD_ in GSThread.h
+ Commit should be much cleaner than previous one.
2014-11-23 14:33:35 +01:00
Gregory Hainaut
5d89454d25 wx: properly overwrite trait creation
The fix move the Pcsx2AppTraits definition from core to common part.
It allows to use it in wxAppWithHelpers::CreateTraits

fix issue #352
2014-11-22 18:51:05 +01:00
ramapcsx2
fda48f3d55 Merge pull request #355 from Asmodean-/master
Add reg.chcr warning check.
2014-11-22 11:52:12 +01:00
Asmodean-
09c13777d8 Add reg.chcr warning check. 2014-11-21 21:55:35 +00:00
Gregory Hainaut
60c0eb7179 gsdx-ogl: windows: properly setup context flags
* Use a core profile context
* Only enable the debug context in debug build

Close issue #353
2014-11-20 22:12:30 +01:00
Gregory Hainaut
d21e6ff45f gsdx-ogl: don't declare a sampler variable
Nvidia was complaining on the fxaa shader. In doubt I also replaced it in Asmodean's shader
2014-11-20 22:07:44 +01:00
Gregory Hainaut
60f7ec03c2 Merge pull request #351 from Asmodean-/master
GSdx: change post-processing directory & some shader fixes.
2014-11-16 14:09:43 +01:00
Gregory Hainaut
7964933507 wx: use wx_pizza on wx2.8
The new method creates a strange gray box for some users.

Unknown status on wx3.0 (which soon will be the default)
2014-11-16 13:54:07 +01:00
Asmodean-
8f42b36a42 It might help if I changed this for d3d9 also :p 2014-11-15 21:40:00 +00:00
Asmodean-
c72af82f73 GSdx: Some post-processing fixes & add shaders directory. 2014-11-15 21:37:05 +00:00
Asmodean-
5b3867dd60 GSdx: change post-processing directory & name. 2014-11-15 21:33:23 +00:00
Gregory Hainaut
276e3d9d1b gsdx-ogl: always set texture parameter
* Avoid bug after a pause
* Not faster anyway
* keep old method only for gl retracer to reduce debugging noise

Remove some old&useless comment
2014-11-14 11:43:42 +01:00
Gregory Hainaut
3311336d0e gsdx-ogl: disable ARB_bindless_texture
I have a crash when I try to delete some texture (for example when the simulator is paused)
2014-11-11 23:45:41 +01:00
Gregory Hainaut
1b5ea0651c debian: only support SSE2 for the default build 2014-11-11 20:56:45 +01:00
Gregory Hainaut
75c96c08f7 git ignore: linux profiled data 2014-11-11 20:56:45 +01:00
Gregory Hainaut
b6a951a9fa gsdx: debug compilation fix
I'm not sure gcc behavior is correct here!
2014-11-11 20:54:34 +01:00
Gregory Hainaut
0ca9bab8b6 Merge pull request #344 from Asmodean-/master
[GSdx] OpenGL PP Updates
2014-11-11 16:14:01 +01:00
Gregory Hainaut
ab4eaea757 Merge pull request #346 from 3kinox/master
Linux : GSdx AVX fix
2014-11-11 16:08:23 +01:00
3kinox
30240b4cbf More robust detection of arch64(or any distrib using same path for wxwidget) 2014-11-11 15:55:31 +01:00
3kinox
06f53b2689 use -fabi_version=6 only for GSdx, solve bug with wxwidget
reenable avx build for GSdx
2014-11-11 15:55:31 +01:00
3kinox
4991ef608d add automatic archlinux build detection(wx path can not be found otherwise) 2014-11-11 15:55:31 +01:00
Asmodean-
1b836ac4a7 Fix Cel Shader for OpenGL. 2014-11-11 14:34:53 +00:00
Gregory Hainaut
e73d8f383b gsdx-ogl: compilation fix for old distribution 2014-11-11 15:01:22 +01:00
Kieran Hanrahan
0e636ce411 A few last bits of cleaning before merge. 2014-11-11 02:41:52 +00:00
Kieran Hanrahan
e8a92ae731 Small oversight fix for "sample_texLevel" 2014-11-11 00:57:11 +00:00
Kieran Hanrahan
b60e5a62fc Rearrange to right spot (I blame github editor ;p) 2014-11-11 00:17:21 +00:00
Kieran Hanrahan
7adc7c4833 Update GSSettingsDlg.cpp
Just add the OGL shader ini params to the file when the user enables post-processing In the options dialog.
2014-11-11 00:01:31 +00:00
Kieran Hanrahan
cf5da56390 Tabbing >.> 2014-11-10 23:49:11 +00:00
Kieran Hanrahan
d228ad3ddd OpenGL Updates - fix effects for both D3D & OGL
I had to edit this via the GitHub editor. I finish up my changes, and for some reason the pcsx2 repository won't let me read or write to it, since the last merge. I checked my other repositories, and they're working fine. ?.?
2014-11-10 23:46:50 +00:00
Gregory Hainaut
e6e534c13a Merge pull request #343 from PCSX2/shader-loading
GSdx ogl: external shader loading + FXAA
2014-11-10 15:43:05 +01:00
Gregory Hainaut
48b3d91768 partially revert previous commit ec1da2805c
It breaks windows...
2014-11-10 12:19:30 +01:00
Gregory Hainaut
cbf2e740e3 gsdx-ogl: port Asmodean shader to GLSL
I only checked the default configuration (on Nvidia). Please report any issue with it.
2014-11-10 10:39:55 +01:00
Gregory Hainaut
8c90e7cafc gsdx-ogl: support latest fxaa version
Only tested on Nvidia, please report any issue with your driver

Note: requires GL4 GPU
2014-11-10 10:39:55 +01:00
Gregory Hainaut
ff39dffe23 gsdx-ogl: add a gui option (linux) to select external shader
Note: of course it requires a glsl shader ;)

On windows, you can set the path on the ini file. Here an example with linux path:
shaderfx_conf = /home/gregory/playstation/emulateur/pcsx2_merge/bin/GSdx_FX_Settings.ini
shaderfx_glsl = /home/gregory/playstation/emulateur/pcsx2_merge/bin/shader.fx
2014-11-10 10:38:52 +01:00
Gregory Hainaut
920ac6695f gsdx-ogl: add preliminary support of external shader fx 2014-11-10 10:37:58 +01:00
Gregory Hainaut
ec1da2805c pcsx2/GSdx: disable AVX for the moment on linux
I need to check carefully the consequence of ABI change. So far wx is very unhappy!

Fatal Error: Mismatch between the program and library build versions detected.
The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6),
and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 1006,wx containers,compatible with 2.6).
2014-11-09 15:45:54 +01:00
Gregory Hainaut
84f844767c gsdx-ogl: micro optimize PSConstantBuffer cache
Might help to save a cache line on the CPU :)
2014-11-08 21:39:17 +01:00
Gregory Hainaut
58bd645d49 gsdx-ogl: BindBufferBase also bind to the generic binding point 2014-11-08 21:39:13 +01:00
Gregory Hainaut
16377f7249 gsdx-ogl: only call PixelStorei when parameters are updated
It won't improve performance but it would reduce a bit the noise in gl retracer tool
2014-11-08 21:30:14 +01:00
Gregory Hainaut
47f40ed79a gsdx-ogl: reduce pbo complexity
Copy the full line into the pbo. Dma will only take GL_UNPACK_ROW_LENGTH
- increase memcpy size by 2 in the pbo
+ single memcpy will be faster and can use sse

Enable buffer_storage extension:
* GL_CLIENT_STORAGE_BIT was required (it is the duty of TexSubImage to copy data into the GPU mem)
* Enable the extension by default
2014-11-08 21:30:14 +01:00
Gregory Hainaut
e62af05496 gsdx-ogl: reduce complexity of clear texture
Null is equivalent to a clear to 0.

Note: Code is not yet used because both stencil and depth are cleared.
Future note: stencil can potentially be replaced by load_store_image
2014-11-08 21:30:14 +01:00
Gregory Hainaut
bd9df9a6ec gsdx: Add some comment on GSTextureCache + schematics
Note: docs/TextureCache.odg was created with libreoffice. Not perfect but give a nice overview
2014-11-08 21:30:14 +01:00
ramapcsx2
b7e5e41afe Merge pull request #333 from PCSX2/linux-avx
Support of AVX build for linux
2014-11-08 14:09:06 +01:00
ramapcsx2
a908d1ab93 Merge pull request #340 from PCSX2/delete-memcpy-leftovers
common: remove old memcpy implementation
2014-11-08 13:44:36 +01:00
ramapcsx2
8434d6c397 Merge pull request #328 from tlbjr/master
GLDEBUGPROC type cast and postBuild.cmd for GSdx on VS2013
2014-11-08 13:11:07 +01:00
ramapcsx2
3d05d706f4 Merge pull request #339 from Asmodean-/master
[Post-Processing] Update GSdx effect suite to latest version.
2014-11-08 12:49:55 +01:00
Asmodean
df0a9c4683 Some small fixes, that I noticed. 2014-11-06 10:56:33 +00:00
ramapcsx2
ed6bf53547 Merge pull request #341 from ramapcsx2/spyro_patch
spyro enter the dragonfly bootup hack
2014-11-04 17:18:15 +01:00
ramapcsx2
a64d641a50 spyro enter the dragonfly bootup hack 2014-11-04 17:16:26 +01:00
Gregory Hainaut
69e88ffed0 common: remove old memcpy implementation
PCSX2 used standard memcpy now (thanks to xsacha)
2014-11-04 09:20:47 +01:00
Asmodean
937e475169 [Post-Processing] Update GSdx FX effect suite to latest version. 2014-11-03 07:15:34 +00:00
Gregory Hainaut
fc480e9bea Merge pull request #335 from tadatada/fix_resizing_loop
Fix resizing loop when the Windows Classic theme with some large resolutions have been chosen.
2014-10-28 10:36:10 +01:00
Gregory Hainaut
d6ba55eebf license:
* stack walk is coming from PPSSPP => GPL2+
* Remaining are from Kingcom => LGPL3+
2014-10-28 08:21:39 +01:00
tadatada
d55aa66751 Fix resizing loop when the Windows Classic theme with some large resolutions have been chosen. 2014-10-28 12:44:12 +09:00
Gregory Hainaut
f0d85d7dcc Merge pull request #329 from tadatada/mod_console_title
Inserted a game CRC in the title of the console log screen.
2014-10-26 21:53:58 +01:00
Gregory Hainaut
a28d2878e0 Merge pull request #326 from tadatada/mod_cheats_logs
Cheats: Added a cheats related log, changed color of a few positive logs.
2014-10-26 15:49:25 +01:00
Gregory Hainaut
a0056f4e05 Merge pull request #325 from tadatada/fix_ts_mixtures
Cheats: Fixed tab/space mixtures in pcsx2/Patch_Memory.cpp
2014-10-26 15:45:04 +01:00
Gregory Hainaut
6af09d8a09 Merge pull request #331 from tadatada/fix_bool
Fixed a C++ bool variable(1 byte) to WINAPI bool(4 bytes) for SystemParametersInfo API.
2014-10-26 15:34:05 +01:00
Gregory Hainaut
4d818f6cd9 ignore multiple linux file 2014-10-26 15:00:28 +01:00
Gregory Hainaut
f25e056914 gsdx: enable AVX with GCC
* Use overloaded function instead of specialized template
=> see http://stackoverflow.com/questions/3052579/explicit-specialization-in-non-namespace-scope

* replace _mm256_slli_si128 by _mm256_slli_si256
  I hope they're equivalent. I didn't find any info on _mm256_slli_si128,
  however srl use _mm256_srli_si256
2014-10-26 14:47:35 +01:00
Gregory Hainaut
679fa65b84 cmake: By default optimize for current arch
Note: it requires GCC 4.7. Otherwise use -DDISABLE_ADVANCE_SIMD=OFF to restore
previous behavior. It will impact Ubuntu precise (12.04)
2014-10-26 14:47:35 +01:00
tadatada
33967649b1 Fixed a C++ bool variable(1 byte) to WINAPI bool(4 bytes) for SystemParametersInfo API. 2014-10-16 07:49:30 +09:00
tadatada
ea6e78ab0d Inserted a game CRC in the title of the console log screen. 2014-10-13 13:26:03 +09:00
Tom Burnett
a1a1c7d0fb Removed svn rev inc file 2014-10-12 01:43:30 -07:00
Tom Burnett
1f734a69a0 Small VS2013 fixes 2014-10-12 01:40:40 -07:00
tadatada
7e89477e6c Cheats: Added a cheats related log, changed color of a few positive logs.
If any cheats file is not found, the "Not found Cheats file" message will appear with its full path of the cheats file on the log screen.

Changed color of a few positive logs to green from grey.
2014-10-08 16:51:09 +09:00
tadatada
8b45caf611 Cheats: Fixed tab/space mixtures in pcsx2/Patch_Memory.cpp 2014-10-08 16:43:08 +09:00
Gregory Hainaut
fa3db52cf7 partially revert commit 9fd2f3dd8a
No need to add Linux sillyness in Windows file... (Hopefully close #323)
2014-10-04 11:33:34 +02:00
Gregory Hainaut
6fe9ee387d gsdx-ogl: optimize the PS cb cache
* Don't use the stack
* Don't compare MinMax parameter (depends of others)
* Don't store not-compared parameter in the cache (HalfTexel/MinMax)

+0.3fps/46fps (well better than nothing)
2014-10-02 20:44:22 +02:00
Gregory Hainaut
a573ce185c gsdx-ogl: mark GL_EXT_shader_io_blocks as mandatory for GLES 2014-10-02 20:44:22 +02:00
Gregory Hainaut
ccc1137e12 gsdx-ogl: merge the two vertex buffer format
* Only a single VAO
    => Format is set once
    => Only a single bind at startup
    => GSVertexBufferStateOGL is nearly useless
    => barely faster but better than nothing :)
2014-10-02 20:44:22 +02:00
Gregory Hainaut
10c7be8c50 gsdx-ogl: Use 32B strides for all VBO 2014-10-02 20:44:22 +02:00
Gregory Hainaut
d37cc8e1e7 gsdx-ogl: GL_ARB_shading_language_420pack is now mandatory
All API/drivers support it so time to remove the fallback.
2014-10-02 20:44:22 +02:00
ramapcsx2
aaf3fe8b19 Merge pull request #319 from aphirst/patch-1
Minor spelling/punctuation fixes in SPU2-X
2014-10-02 20:04:21 +02:00
Adam Hirst
b98e53e059 Minor spelling/punctuation fixes in SPU2-X 2014-10-02 12:35:13 +02:00
Gregory Hainaut
79e8a912cd gsdx-ogl: keep the draw buffer enabled by default
Note: Only DATE requires to disable the draw buffer
2014-09-30 22:18:20 +02:00
Gregory Hainaut
f46e8cc6ac gsdx-ogl: bump base requirement to 3.3
A couple of fallbacks were introduced for the Mesa driver that only support 3.0
DSA will require a recent Mesa which already support GL3.3

Require at least SandyBridge for Intel GPU
2014-09-30 22:18:20 +02:00
Gregory Hainaut
594f6c33a2 gsdx-ogl-ES: require GL_EXT_shader_io_blocks + GLES3.1
Allow to use same shader interface for all API

Note: on the GL API it will require GL3.3 (see next commit)
2014-09-30 22:18:01 +02:00
Gregory Hainaut
1c501047f5 gsdx-ogl: refresh the linux gui with latest extension 2014-09-28 12:23:44 +02:00
Gregory Hainaut
8833afc2fa gsdx-ogl: drop GL_ARB_multi_bind
It will be replaced by DSA so let's reduce the complexity of opengl
2014-09-28 12:23:44 +02:00
Gregory Hainaut
fa43018d10 gsdx-ogl: no DSA isn't mandatory yet... 2014-09-28 12:11:22 +02:00
Gregory Hainaut
1e86e3cb08 gsdx-ogl: rework callback debug
* use DebugOutputToFile as a callback of gl error. Add a breakpoint to
  find the culprit GL call
* use string instead of char[n]

Note: CheckDebugLog is potentially useless now
2014-09-28 12:00:34 +02:00
Gregory Hainaut
b7601a9add gsdx-ogl: Enable various GL4+ extensions
* GL_ARB_clip_control: reduce z fighting
* GL_ARB_clear_texture: no real speed gain (but improve code quality)
* GL_ARB_bindless_texture: +1fps (if you're CPU limited)
2014-09-28 12:00:34 +02:00
Gregory Hainaut
9d8d702aa6 gsdx-ogl: drop GL_NV_depth_clamp extension
superseeded by GL_ARB_clip_control
2014-09-28 12:00:34 +02:00
Gregory Hainaut
4659184cc1 gsdx-ogl: add support of clip_control (depth only)
* replace the [-1;1] depth range of openGL with the DX range [0;1].
2014-09-28 12:00:34 +02:00
Gregory Hainaut
104688e3ee gsdx-ogl: fix ARB_bindless support 2014-09-28 12:00:34 +02:00
Gregory Hainaut
cc24da128c gsdx-ogl: fix for gl_clear_texture
Note: Disabled for depth_stencil texture (I'm not sure we can split the two)
2014-09-28 12:00:34 +02:00
Gregory Hainaut
d720cc16a6 gsdx-ogl: gl4.5: add plumbering to support direct_state_access and clip_control 2014-09-28 12:00:33 +02:00
Gregory Hainaut
0118d578a2 gitignore: debug file (linux) 2014-09-28 11:59:50 +02:00
Gregory Hainaut
1ea86eedc0 debian: force some dependencies
* i686 to use optimized version of the std lib
* libpulse (provide a sound plugin)
2014-09-28 11:59:50 +02:00
Gregory Hainaut
5297bd7b2c Merge pull request #316 from nE0sIghT/master
Use cmake variable "BIN_DIR" for binaries installation
2014-09-28 11:37:31 +02:00
nE0sIghT
7f57692ee3 Use cmake variable "BIN_DIR" for binaries installation 2014-09-27 22:26:42 +04:00
Gregory Hainaut
20b9dbadda pcsx2: replace wxStrtoul by ToUlong method
Close issue #308
2014-09-27 11:50:31 +02:00
Gregory Hainaut
c85221c64f openSuse vs openSUSE 2014-09-27 11:50:31 +02:00
ramapcsx2
962d136cbc Merge pull request #315 from tadatada/patch-1
Cheat code cleanup
2014-09-26 13:15:30 +02:00
tadatada
728840b7c5 Code cleanup
Altered some variable names and comments. Removed some redundant parentheses.
2014-09-26 06:55:00 +09:00
Gregory Hainaut
c66ea9f740 linux: openSuse don't follow the FHS, so manually pick the lib path 2014-09-24 09:02:56 +02:00
Gregory Hainaut
5b3f031654 cmake: fix commit f3a50a01a7
* link common with c lib (required for gold linker)
* fix the macro to properly set the library variable
  => use the variable instead to hardcoded value
2014-09-24 09:02:56 +02:00
ramapcsx2
cee80eb5f4 Merge pull request #279 from Kingcom/StackFrames
Add stack trace and step out
2014-09-22 16:34:52 +02:00
Gregory Hainaut
60297403a2 i10n: update th_TH mo file 2014-09-22 09:27:57 +02:00
Gregory Hainaut
58a8683d7d gsdx-ogl: disable texture compare mode
It seems to be used for depth texture
2014-09-22 09:27:34 +02:00
Gregory Hainaut
d51f008c72 gsdx: openglES fix
* require a 3.1 context
* unattach texture of the fbo when they're not used
(avoid to have a texture and depth_stencil with different size)

Note: except minor shader bug it works on Nvidia 340.23.01
2014-09-22 09:27:31 +02:00
Gregory Hainaut
9656fad0f5 Merge pull request #286 from jobermayr/master
Two patches from openSUSE / Packman
2014-09-21 17:34:14 +02:00
Gregory Hainaut
fd7b692d00 Merge pull request #251 from xsacha/memzero_ptr
Remove redundant memzero_ptr. All compilers use SSE implementation
2014-09-21 17:15:54 +02:00
Gregory Hainaut
39491f789b Merge pull request #309 from blackb1rd/master
Update th_TH po
2014-09-21 13:18:51 +02:00
blackb1rd
c4eca8b3cc Update th_TH po 2014-09-21 00:37:32 +07:00
Gregory Hainaut
47cafaaa7c windows build: fix typo introduced in bf7c29e4cd 2014-09-20 09:59:23 +02:00
Gregory Hainaut
1b6188ee1d Merge pull request #281 from xsacha/memcmp
Remove usages of memcmp_mmx
2014-09-19 21:43:19 +02:00
ramapcsx2
9ee88ad070 Merge pull request #273 from Kingcom/Interpreter
R5900 interpreter breakpoints
2014-09-18 16:40:56 +02:00
Kingcom
a95e55dc54 Add breakpoint support to R5900 interpreter 2014-09-18 16:31:44 +02:00
Johannes Obermayr
9fd2f3dd8a Don't use build date on openSUSE.
Fixes RPMLINT warning:
pcsx2.i586: W: file-contains-date-and-time /usr/bin/pcsx2
Your file uses  __DATE and __TIME__ this causes the package to rebuild when not needed
2014-09-17 22:37:34 +02:00
Johannes Obermayr
7b1d3ba7ea Do commits 2bc2047 and f287754 the right way ... 2014-09-16 19:11:11 +02:00
ramapcsx2
e59c9b0e65 Merge pull request #305 from ramapcsx2/memory_patch
"Support all functions of type D and E codes" for cheat patches (pnach) by tadatada
2014-09-16 11:22:10 +02:00
ramapcsx2
12e8f7d0b4 "Support all functions of type D and E codes" for cheat patches (pnach) by
tadatada
2014-09-16 11:03:10 +02:00
Sacha
bf7c29e4cd Disable memcmp_mmx for non-msvc compilers and 64-bit. Remove MemcpyFast.S (Linux). 2014-09-16 17:53:54 +10:00
blackb1rd
4f2c9a05fb Update th_TH po 2014-09-16 11:20:31 +07:00
Gregory Hainaut
f287754477 linux: add a desktop file that install PCSX2 on system menu
* Some people prefers emulator/system than emulator/game
2014-09-14 13:15:18 +02:00
Johannes Obermayr
2bc2047770 cmake: Fix RPATH/RUNPATH issue with openSuse wxWidgets libdir.
Gregory: Add an if clause to only change the rpath on openSuse

For me it doesn't follow the FHS => http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/fhs.html
2014-09-14 13:12:26 +02:00
Gregory Hainaut
73433c25f2 linux build: take 3 :p
close issue #300
2014-09-14 13:02:55 +02:00
Gregory Hainaut
9c81272278 cmake: oups forget to change the usage of 64BIT_BUILD variable 2014-09-13 14:22:41 +02:00
Gregory Hainaut
efa4a50cf5 linux package: update desktop file
get commit 45a09bfa8c4fa347c68799520df921c9554ad2d6 from pseiler

However keep Game instead of System
2014-09-12 20:41:28 +02:00
Gregory Hainaut
27992b16c2 common: fix std type define on windows 2014-09-12 20:41:28 +02:00
Gregory Hainaut
e101a1d77a linux build: let's be clear that 64 bit is not supported
* rename the cmake option to 64BIT_BUILD_DONT_WORK
* add --64-bit-dont-work to build.sh
2014-09-12 20:10:14 +02:00
Gregory Hainaut
20243ff6fb i10n: refresh es_ES/ja_JP
(due to po update)
2014-09-12 20:10:14 +02:00
ramapcsx2
98d22f8b2e Merge pull request #215 from xsacha/memcpy
Remove some slow, redundant memcpy implementations: memcpy_const/memcpy_...
2014-09-12 19:57:57 +02:00
Gregory Hainaut
b9e6024fe9 Merge pull request #282 from xsacha/emitter-cleanup
common: Remove two unused files in emitter, inlines.inl and macros.h
2014-09-12 19:30:34 +02:00
Gregory Hainaut
31a62c18be Merge pull request #294 from aktau/osx-ncpu
linux: build.sh: get number of CPUs on OSX too
2014-09-12 19:28:55 +02:00
Gregory Hainaut
2d4b6273f0 Merge pull request #276 from xsacha/defs-cleanup
pcsx2: require C99 standard for stdint
2014-09-12 19:24:08 +02:00
Kingcom
8dba78abce Add step out feature 2014-09-11 14:17:43 +02:00
Kingcom
d3ffd13c25 Add stack frames list to debugger 2014-09-11 14:17:43 +02:00
Kingcom
4768f293bf Port stack walker from PPSSPP 2014-09-11 14:15:07 +02:00
Nicolas Hillegeer
57b09c371a build.sh: get number of CPUs on OSX too
The linux way (reading /proc/cpuinfo) doesn't work on OSX.
2014-09-10 19:49:17 +02:00
Gregory Hainaut
b9fba8005a cmake: failed to get git version
* add a fallback when the git version can't be fetched

Close issue #122
2014-09-10 14:19:50 +02:00
ramapcsx2
270fc13e2a Merge pull request #289 from ramapcsx2/patch3
OPH flag hack removal for Tomb Raider Angel of Darkness
2014-09-08 17:40:42 +02:00
ramapcsx2
f67941d03b OPH flag hack removal for Tomb Raider Angel of Darkness 2014-09-08 17:38:11 +02:00
ramapcsx2
c89e703bed Merge pull request #250 from gigaherz/sln-changes
Remove some deprecated plugins from the project/build files
2014-09-06 01:01:32 +02:00
gigaherz
d0100548d4 Separate old plugins from the main project files (Windows). 2014-09-06 00:52:23 +02:00
ramapcsx2
f7192b82b1 Merge pull request #274 from Kingcom/Scrollbars
Fix column width in debugger
2014-09-06 00:35:47 +02:00
ramapcsx2
08dc8b40e4 Merge pull request #272 from Kingcom/Scanning
Complete function scanning
2014-09-06 00:32:51 +02:00
Gregory Hainaut
b875f81be3 Merge branch 'uyjulian-CleanCMake' 2014-09-05 20:17:07 +02:00
uyjulian
e8d13090b0 Look for GLESv3 header instead of GLESv2 header 2014-09-05 20:16:50 +02:00
uyjulian
f3a50a01a7 cmake: Use previous macros in CMakeLists.txt files
Gregory: add a c lib for zzogl-pg-cg replayer
2014-09-05 20:16:23 +02:00
uyjulian
1290d0b1a3 Remove unneeded comments 2014-09-05 20:14:09 +02:00
uyjulian
82dfed1512 Remove unneeded Check*.cmake 2014-09-05 20:14:09 +02:00
uyjulian
53e57766c9 Use CheckLib for some libs 2014-09-05 20:14:09 +02:00
uyjulian
dde94da94f Add cleaner svnrev.h code, add macros 2014-09-05 20:14:09 +02:00
uyjulian
5f4fc4701f Add CheckLib.cmake 2014-09-05 20:14:08 +02:00
uyjulian
20716e13e4 change .gitignore 2014-09-05 20:14:05 +02:00
Gregory Hainaut
bf52a4c737 build.sh: allow to replace build directory by a symlink
Use case: redirect the build into a ramdisk (less write on sdd and potentially faster io)
2014-09-02 21:21:46 +02:00
ramapcsx2
82ee28fa39 Merge pull request #283 from nrusef/master
Update ja_JP po
2014-08-30 22:18:04 +02:00
ramapcsx2
f5435f5ba5 Merge pull request #284 from Kingcom/RegisterNames
Fix duplicate register names
2014-08-30 13:28:04 +02:00
Kingcom
b717691901 Fix duplicate f21/fcr21/vf21 2014-08-30 12:49:59 +02:00
Sakura Naruse
7094cc7693 Update ja_JP po 2014-08-29 04:01:46 +09:00
Gregory Hainaut
80df352711 Merge pull request #211 from xsacha/intrinsics
Remove pre-gcc4.1.0 code and a bunch of functions that were never used.
2014-08-28 20:23:55 +02:00
Sacha
5287de930b Create a Math.h utility. Use it for count leading sign bits, used in MMI. 2014-08-28 00:42:53 +10:00
Sacha
378556c0c2 Remove two unused files in emitter, inlines.inl and macros.h 2014-08-27 22:40:26 +10:00
Sacha
b47a4da81f Use 64-bit compatible rdtsc for Linux. Remove some more intrin_x86 functions. 2014-08-27 18:49:44 +10:00
Sacha
1d116cc23b Remove memcpy_amd usages from plugins. No more custom implementations in plugins. 2014-08-27 13:50:55 +10:00
Sacha
ad3b76c4d8 Remove all custom memcpy usage from core pcsx2 and remove memcpy_fast from plugins. 2014-08-27 13:45:23 +10:00
Sacha
3f7cb991e4 Remove some slow, redundant memcpy implementations: memcpy_const/memcpy_qwc/memcpy_aligned. 2014-08-27 13:13:48 +10:00
ramapcsx2
9102e40f9c Merge pull request #280 from ramapcsx2/memcpy
Use generic memcpy from now on. Tests show generics are good enough now. It should be a speedup even on modern CPUs.
2014-08-26 23:13:13 +02:00
ramapcsx2
9168c344b1 Use generic memcpy from now on. Tests show generics are good enough now.
It should be a speedup even on modern CPUs.
2014-08-26 01:02:23 +02:00
Gregory Hainaut
4d4f7ac112 Merge pull request #277 from IlDucci/patch-3
i10n: es_ES: Update pcsx2_Iconized.po
2014-08-25 21:14:36 +02:00
Gregory Hainaut
884876572b Merge pull request #278 from IlDucci/patch-4
i10n: es_ES: Update pcsx2_Main.po
2014-08-25 21:14:07 +02:00
ramapcsx2
ec7fb80a5b Merge pull request #271 from Kingcom/Threads
Add threads list to debugger
2014-08-25 15:56:00 +02:00
IlDucci
c52c378f49 Update pcsx2_Main.po
Update Main file translation with edited lines.
2014-08-25 15:37:55 +02:00
IlDucci
60efb3c4b4 Update pcsx2_Iconized.po
Updating translation with edited lines.
2014-08-25 15:37:13 +02:00
ramapcsx2
d694a3a166 Merge pull request #263 from Kingcom/Recompiler
Fix recompiler breakpoint flushing logic (debugger related)
2014-08-25 15:33:39 +02:00
Sacha
90e59b2704 Clean up the type defines in pcsx2.
The non-stdint fallback was not even working which shows that it was never used. No supported platform would not have stdint anyway.
Remove unused code and do not restrict types to Linux and MSVC. Was there a reason for this?
2014-08-25 16:16:34 +10:00
Sacha
999eb83de8 Remove unused _InterlockeD* functions. 2014-08-25 04:57:03 +10:00
Gregory Hainaut
e019979749 Merge pull request #275 from mbeniamino/master
GSdx: disable automatic use of separate shader objects for Intel driver (likely a mesa bugs).
2014-08-24 17:37:41 +02:00
Matteo Beniamino
15c487e547 GSdx: fixed use of separate shader objects for Intel driver. 2014-08-23 17:09:38 +02:00
Kingcom
d8f3e22f14 Fix column width in debugger lists when scrollbars are present 2014-08-23 15:03:57 +02:00
Pseudonym
3fa5816aab Merge pull request #265 from Sonicadvance1/x86_64-vtlb
Get the VTLB working on x86_64.
2014-08-22 22:40:45 +01:00
Pseudonym
e5f7057539 Merge pull request #255 from Kingcom/Disasm
Add a couple of pseudo instructions to the R5900 disassembler
2014-08-22 22:35:52 +01:00
Kingcom
259a699613 Add shared source and dest register simplifications 2014-08-22 23:28:32 +02:00
Kingcom
d1619af18c Simplify disassembly of memory access with zero offset 2014-08-22 23:28:28 +02:00
Ryan Houdek
bddb2504b5 Get the VTLB working on x86_64.
VTLB does some nonsense with signed integers for the pointers.
We've got to make sure to set the signed bit in the correct bit on 64bit pointers so it works.
2014-08-22 15:31:40 -05:00
Kingcom
769cb6a369 Port the rest of the function scanning over from PPSSPP 2014-08-22 22:23:49 +02:00
Pseudonym
4512306207 Merge pull request #248 from Kingcom/OpcodeFlags
Add flags to R5900 opcodes, use them for the debugger
2014-08-22 20:55:08 +01:00
Kingcom
430c617a95 Use flags for breakpoints and memchecks in the recompiler 2014-08-22 21:50:09 +02:00
Kingcom
9fde236512 Update analyst to use new flags 2014-08-22 21:50:09 +02:00
Kingcom
72c2158b17 Add fcr registers to DebugInterface and rename others 2014-08-22 21:50:06 +02:00
Kingcom
f7ac17b6be Fill in flags for most debugger relevant opcodes 2014-08-22 21:50:05 +02:00
Kingcom
1e3e5c92a8 Add thread list to debugger 2014-08-22 16:11:16 +02:00
Kingcom
5f7a3a8ca9 Read EE threads from bios (thanks @gregory38) 2014-08-22 16:11:13 +02:00
Kingcom
5b14f7de64 Add a list with bios version specific information 2014-08-22 16:11:10 +02:00
Pseudonym
dc4e75a61c Merge pull request #264 from xsacha/icore-cleanup
Remove some unused code such as data moves and tags in iCore.
2014-08-21 16:13:19 +01:00
Sacha
f484f35d85 Remove some unused code such as data moves and tags in iCore.
The code was sitting there only serving to confuse people. The tags were a way of setting an 'isXMMreg' inside a function and the values actually didn't mean anything.
2014-08-22 00:42:40 +10:00
Kingcom
9e6fac5faa Fix recompiler breakpoint flushing logic 2014-08-20 17:12:48 +02:00
Kingcom
b72963ee5f Make simplifcations in the disassembler optional 2014-08-19 15:45:50 +02:00
Kingcom
a696bf0d02 Add branch pseudo opcodes to R5900 disassembler 2014-08-19 14:58:00 +02:00
Kingcom
b0cef1b143 Add a couple of pseudo instructions to the R5900 disassembler and display signed immediates as signed 2014-08-19 14:58:00 +02:00
David Quintana
02b19b7686 Merge pull request #249 from xsacha/3rdparty-cleanup
Remove unused tinyxml from 3rdparty.
2014-08-18 02:33:33 +02:00
ramapcsx2
795211dba6 Merge pull request #253 from ramapcsx2/wsfix2
fix the ws patches, broke them earlier
2014-08-18 01:28:50 +02:00
ramapcsx2
630f869f7f fix the ws patches, broke them earlier 2014-08-18 01:23:29 +02:00
Sacha
7a260c9885 Remove redundant memzero_ptr. All compilers use SSE implementation anyway. 2014-08-17 23:23:55 +10:00
Tobias Jakobi
6eb0ecbe7c debugger: fix static/extern issue which broke compilation
Previously (on gcc) compilation would fail with:
pcsx2/DebugTools/DisR5900asm.cpp:58:37: error: ‘R5900::GPR_REG’ was
declared ‘extern’ and later ‘static’ [-fpermissive]
2014-08-17 14:52:13 +02:00
sudonim1
071fbb92df Merge pull request #246 from Hindenburg/cmake-issue
"!64BIT_BUILD" is a variable name. Changed to "NOT 64BIT_BUILD"
2014-08-17 13:26:29 +01:00
Sacha
357c3160bb Remove unused tinyxml from 3rdparty. 2014-08-17 22:23:14 +10:00
Sacha
2ba0b1b76b Use posix_memalign and _aligned_malloc for alignment. Remove unused code. 2014-08-17 21:03:43 +10:00
Kingcom
a8c5454724 Add flags field to R5900 opcodes 2014-08-16 20:33:45 +02:00
aga
c963e0b62b "!64BIT_BUILD" is a variable name. Changed to "NOT 64BIT_BUILD" which is
the negation of the 64BIT_BUILD variable defined in
BuildParameters.cmake.
2014-08-16 12:00:50 -06:00
Pseudonym
05b33012b7 Merge pull request #241 from Kingcom/Debugger
Always enable debugger
2014-08-15 23:31:23 +01:00
Pseudonym
91fcad0a93 You know that commit where I removed the GTE? Apparently I didn't. 2014-08-15 23:22:25 +01:00
ramapcsx2
fb344fb646 Merge pull request #242 from Kingcom/ShareIso
Allow to share writing to the ISO through an ini option
2014-08-15 23:53:54 +02:00
Kingcom
f5fe75a73b Allow to share writing to the ISO through an ini option 2014-08-15 23:52:45 +02:00
Kingcom
df0fb9551f Always enable debugger 2014-08-15 21:25:30 +02:00
Pseudonym
7e5b6dee9c Removed System.map symbol file support.
I'm not sure what this is actually to be honest, ancient release notes say it was ps2linux related but I don't think this is Linux System.map compatible... regardless ps2linux isn't exactly high on our priority list.
2014-08-15 18:56:42 +01:00
Pseudonym
174e121034 Load symbols from ELFs. (Thanks Kingcom for this one liner.) 2014-08-15 18:44:01 +01:00
Pseudonym
9ebd9c4447 Removed long disabled code for inserting command line parameters for ELFs into EE memory. We'd have to do this completely differently in the current system anyway. 2014-08-15 18:41:24 +01:00
Pseudonym
4400b56fb5 Removed actual ELF loading from the ELF parser as we leave this up to the BIOS now. 2014-08-15 18:39:24 +01:00
Pseudonym
4de63714ce Replaced some printf(string)s with printf("%s", string) in R5900 block dumping. 2014-08-15 17:37:07 +01:00
Pseudonym
0ca72a7d60 Merge pull request #240 from Kingcom/DisR5900Removal
Remove redundant Disr5900
2014-08-15 16:55:12 +01:00
Pseudonym
2aa34186e1 Scrapped abortive GTE (PSX GPU) support so that certain people can stop fiddling with untestable code. We don't know whether the PS2 even has a hardware GTE and thanks to the miracle that is source control we can revive this module if needed. 2014-08-15 16:47:42 +01:00
Pseudonym
adc76243dc Merge pull request #239 from xsacha/stats_removal
Remove Stats.{cpp,h}, which was not being used by anything.
2014-08-15 16:35:33 +01:00
Pseudonym
565e72d9d7 Merge pull request #209 from xsacha/jASSUME
Remove deprecated jASSUME from pcsx2 core. It is still used in some plugins.

[I should note that this may change the performance of the devel target on msvc as jASSUME was compiling to __assume on devel and release while pxAssume only compiles to __assume on release]
2014-08-15 14:38:06 +01:00
Kingcom
2d7ef30e59 Remove redundant Disr5900 2014-08-15 15:23:45 +02:00
Pseudonym
9284a01346 Removed redundant initialisation code (covered in the resets), reverted a little pointless shuffling. 2014-08-15 14:09:18 +01:00
Pseudonym
b574d06f5f Merge pull request #214 from xsacha/init_vars
Init vars directly instead of using dedicated functions
2014-08-15 14:04:06 +01:00
Pseudonym
1c29874541 Removed unused variables. 2014-08-15 13:55:19 +01:00
Pseudonym
08d8026fa3 Removed a couple of unhelpful comments from today and a bunch from 2003. 2014-08-15 13:55:16 +01:00
Pseudonym
2286ac1c49 Merge pull request #221 from xsacha/vuops-2
Improve readability in the VUops.
2014-08-15 13:55:14 +01:00
Sacha
8d616133d6 Remove Stats.{cpp,h}, which was not being used by anything. 2014-08-15 18:08:03 +10:00
ramapcsx2
7197017e74 Merge pull request #228 from archshift/deb-package
Clarified names of the debian packager folder and script.
2014-08-15 07:33:06 +02:00
Sacha
f542c7232e Use __builtin_unreachable where possible for non-msvc 2014-08-15 14:43:52 +10:00
Sacha
7568f6f2ec Remove deprecated jASSUME from pcsx2 core. It is still used in some plugins 2014-08-15 14:32:56 +10:00
Sacha
3271048ab6 Remove init procedures from Hw.cpp 2014-08-15 14:17:35 +10:00
Sacha
791bfc181b Use a function with u32 inputs and make sure all the casts match, because.. 2014-08-15 13:55:14 +10:00
David Quintana
1facc8efbc Merge pull request #225 from lioncash/ghz-macro
cdvdGigaherz: Remove an unnecessary macro
2014-08-15 02:10:32 +02:00
Lioncash
b2d8e7137f cdvdGigaherz: Remove an unnecessary macro define 2014-08-14 20:07:10 -04:00
sudonim1
ba63fca9d8 Merge pull request #235 from archshift/gitignore
Updated .gitignore to exclude /build and pcsx2 snapshot builds
2014-08-15 01:07:00 +01:00
archshift
655c0efb31 Updated .gitignore to exclude /build and pcsx2 snapshot builds 2014-08-14 16:13:27 -07:00
Pseudonym
52fe7a9f2a Merge pull request #226 from archshift/stdminmax
Removed `using std::min/max` from PCH
2014-08-14 23:12:23 +01:00
archshift
fb9c24b900 Removed using std::min/max from PCH 2014-08-14 14:55:52 -07:00
Pseudonym
05d5f06bb5 Merge pull request #224 from xsacha/sse2-force
Require SSE2 instead of SSE+MMX. SSE2 implies SSE+MMX is supported, so all checks of of 'SSE' and 'MMX' can be removed.
2014-08-14 22:43:06 +01:00
Pseudonym
9dd9448d02 Merge pull request #213 from xsacha:patch_obsolete
Remove cheat patches obsoleted by a change in the UI, more than 4 years ago
2014-08-14 21:23:20 +01:00
Pseudonym
cb2593f2bb Merge pull request #210 from xsacha:plugin_cleanup
Some cleanup to improve readability.
2014-08-14 20:37:41 +01:00
Pseudonym
4c7db9e62d Merge pull request #203 from archshift/using-namespace-std
Removed usages of "using namespace std"
2014-08-14 19:31:07 +01:00
archshift
466e6008ad SamplProf.cpp: Removed "using namespace std" 2014-08-14 11:23:50 -07:00
archshift
396e42e17c sVU_zerorec.cpp: Removed "using namespace std" 2014-08-14 11:23:50 -07:00
archshift
f808593b2d DisR5900asm.cpp: Removed "using namespace std" 2014-08-14 11:23:50 -07:00
archshift
7de0065216 Elfheader.cpp: removed "using namespace std" 2014-08-14 11:23:50 -07:00
archshift
285e07be76 MicroVU: removed usage of "using namespace std" 2014-08-14 11:23:50 -07:00
Pseudonym
66765d827b Merged pull request #199 from xsacha/oldcode
Remove some horrible old code.
2014-08-14 19:12:19 +01:00
Pseudonym
19ea90aff5 Merge pull request #195 from Kingcom/DebuggerLists
Abstract list view behavior
2014-08-14 18:57:50 +01:00
Pseudonym
ad58118df0 Merge pull request #183 from Kingcom/Assembler
Add integrated assembler
2014-08-14 18:47:38 +01:00
Kingcom
2a0be7e91e Abstract list view behavior 2014-08-14 18:32:21 +02:00
ramapcsx2
fbdc364329 Merge pull request #230 from lioncash/void
Core: Get rid of C void parameter carryovers
2014-08-14 11:45:59 +02:00
Lioncash
54798d4743 Core: Get rid of C void parameter carryovers 2014-08-14 03:21:09 -04:00
archshift
5aed2b379a Clarified names of the debian packager folder and script 2014-08-14 00:03:13 -07:00
Sacha
6f5e0f96b4 Require SSE2 instead of SSE+MMX. SSE2 implies SSE+MMX is supported, so all checksOF of 'SSE' and 'MMX' can be removed.
SSE2 is supported on more than decade-old x86 CPUs. Almost(?) every x86 CPU since PS2 was released.
Certainly running the existing code on a non-SSE2 computer resulted in most of the code being disabled anyway and the emulator being incredibly slow.
This removal will hopefully allow the removal of MMX/3DNow code as it has been superceded.
2014-08-14 16:01:34 +10:00
Sacha
9dea86068a Remove giant min/max defines and make their usage more understandable. 2014-08-14 12:46:57 +10:00
Sacha
af3482b7cd Improve readability in the VUops. 2014-08-14 10:58:31 +10:00
ramapcsx2
707d32536c Merge pull request #216 from xsacha/soundtouch
Fix case of 'soundtouch' instead of creating a symlink as a workaround.
2014-08-13 21:53:35 +02:00
ramapcsx2
d247a79e48 Merge pull request #187 from lioncash/bool
Use bool constants instead of magic numbers in microVU
2014-08-13 13:17:24 +02:00
ramapcsx2
5820eea1cb Merge pull request #217 from ramapcsx2/wsfix
Removed "force English" patch line from the widescreen patch for FFX International.
2014-08-13 11:28:32 +02:00
ramapcsx2
b6e0ed43de Merge pull request #206 from ramapcsx2/hackremoval1
PCSX2: Removed the "managed VSync" option. I don't think it saw much use
2014-08-13 11:27:33 +02:00
ramapcsx2
72b28ac2fc Removed "force English" patch line from the widescreen patch for FFX
International.
2014-08-13 11:19:58 +02:00
Sacha
2ae3dd970a Fix case of 'soundtouch' instead of creating a symlink as a workaround. 2014-08-13 18:54:31 +10:00
Sacha
a3bc6a73a3 Remove some horrible old code.
Remove an assert define and instead use the static_assert that all compilers provide.
As an added bonus, assert messages\!
2014-08-13 13:55:32 +10:00
Sacha
e1bf7daf59 Remove cheat patches that were obsoleted by a change in the UI, more than 4 years ago. 2014-08-13 13:27:01 +10:00
Sacha
f0af6460a1 Remove pre-gcc4.1.0 code and a bunch of functions that were never used. 2014-08-13 13:08:19 +10:00
Sacha
9dcaaedf06 Some cleanup to improve readability.
Remove old compiler hacks that are no longer needed.
Fix up some spacing and comments that hid code.
Fix a critical bug in deprecated plugin peopsSPU.
2014-08-13 13:05:33 +10:00
ramapcsx2
9c58537078 PCSX2: Removed the "managed VSync" option. I don't think it saw much use
anyway.
2014-08-12 14:53:51 +02:00
ramapcsx2
c46749f236 Merge pull request #196 from archshift/using
Removed uses of `using std::string`
2014-08-12 10:40:49 +02:00
David Quintana
c09469a71c Merge pull request #204 from archshift/auto-itr
Simplified loops by declaring iterators with 'auto'
2014-08-10 22:07:31 +02:00
archshift
afbb5e2721 Simplified loops by declaring iterators with 'auto' 2014-08-10 01:48:57 -07:00
ramapcsx2
9a702cd0c4 Merge pull request #198 from bositman/master
Added  Lord of the Rings The Two Towers (IT) CRC
2014-08-08 14:05:28 +02:00
bositman
77599bec1c Added Lord of the Rings The Two Towers (IT) CRC
As seen here (SLES 51255):
http://forums.pcsx2.net/Thread-GSdx?pid=392166#pid392166
2014-08-07 13:01:54 +03:00
Gregory Hainaut
a5f54b5ec1 Merge pull request #185 from lioncash/leak
zzogl: Fix a few missing fcloses
2014-08-07 09:08:17 +02:00
Gregory Hainaut
b2df6152af Merge pull request #191 from Sonicadvance1/remove-stupid-define
Removes the usage of __LINUX__ define
2014-08-06 21:56:16 +02:00
ramapcsx2
98aad6ef76 Merge pull request #197 from archshift/no-comprende
PrecompiledHeader.h: Add a comment to clarify redefinition of BOOL
2014-08-06 13:19:24 +02:00
archshift
730d7ec528 Added comment explaining redefinition of BOOL 2014-08-06 04:15:23 -07:00
archshift
c911ba4747 Revert "PrecompiledHeader.h: Removed WTF-redefines"
This reverts commit 9fdb318776.
2014-08-06 04:12:38 -07:00
archshift
9fdb318776 PrecompiledHeader.h: Removed WTF-redefines
Removed redefinition of TRUE and FALSE, and removed typedef of int to BOOL
2014-08-06 03:46:15 -07:00
archshift
d92a621a70 DisR5900: removed using std::string 2014-08-06 03:14:11 -07:00
archshift
7734f2eed8 Gif.cpp: removed redundant using std::min 2014-08-06 03:06:58 -07:00
archshift
10dc0bcfa2 Removed using std::string
`using` classes from namespaces can lead to lack of clarity as to where
the class is coming form.
2014-08-06 03:01:48 -07:00
Gregory Hainaut
5d1f224794 Merge pull request #193 from JustArchi/patch-1
linux: Build.sh improvements
2014-08-05 12:17:42 +02:00
ramapcsx2
d876ff522a Merge pull request #169 from arielsrv/master
Added building support from Windows command line. This feature allow bui...
2014-08-04 20:29:56 +02:00
arielsrv
8f2b51c461 Added usage example and GNU License comments. 2014-08-04 13:14:32 -03:00
Łukasz Domeradzki
cd8d21cf8e Build.sh improvements 2014-08-04 03:58:37 +02:00
Ryan Houdek
3d37a6ce27 Removes the usage of __LINUX__ define
This is defined and set it a ton of different places.
It's checked in a whole lot more
Instead just use __linux__ like a real project should
2014-08-03 13:20:36 -05:00
Gregory Hainaut
82c7bcd761 wx3.0: compilation fix for arch linux
* Manually cast WxGetTranslation
* Accept string as format parameter of pxWindowTextWriter
* Manually convert wxString to wide string

Note: Wx setup.h is not the same between Debian and Arch. Unfortunately it
generated various compilations errors on wx code.

Close issue #172
2014-08-03 14:54:44 +02:00
Gregory Hainaut
3c9367825c wx3.0: partially revert 1fda2a611c
I wrongly removed code that set the language directory on Windows.
Linux uses another way (don't know which one)

close issue #189
2014-08-03 14:53:06 +02:00
Gregory Hainaut
e99540554a wx3.0: clang complains about support of reference in varargs 2014-08-03 14:43:08 +02:00
Gregory Hainaut
86152668c3 cmake: install mo file into Langs/id_code instead of Langs/id_code/LC_MESSAGES
Therefore it uses the same locations as windows.
2014-08-03 14:43:08 +02:00
Gregory Hainaut
61088b71c6 cmake: gcc warning management
* disable unused value warning (don't like the syntax 0&&)
* remove -Wno-ignored-attributes (c option). It replaces gcc warning
    by an unsupported option warning...
2014-08-03 14:43:08 +02:00
ramapcsx2
1bb15fd2cc Merge pull request #188 from ramapcsx2/patch1
Fixed a missing word in gamefixes panel
2014-08-01 15:21:22 +02:00
ramapcsx2
67f934a902 Fixed a missing word in gamefixes panel 2014-08-01 15:04:34 +02:00
sudonim1
a0a54bdd05 Merge pull request #186 from lioncash/early-return
ZZOgl: Fix an early return in ZZoglShadersGLSL4
2014-08-01 12:42:00 +01:00
Lioncash
ed65172308 Use bool constants instead of magic numbers in microVU 2014-07-31 20:34:16 -04:00
Lioncash
0a35a2fac9 Fix missing fclose calls in ZZoglCreate.cpp 2014-07-31 19:08:56 -04:00
Lioncash
a1d2c85d88 ZZOgl: Fix an early return in ZZoglShadersGLSL4 2014-07-31 19:00:53 -04:00
Kingcom
7d49f75317 Replace square character with unicode value 2014-07-31 20:38:26 +02:00
Kingcom
3e883e4be4 Integrate assembler 2014-07-31 20:38:26 +02:00
Pseudonym
3e65c1d0a3 Just killing a couple of latin-1 characters my editor was complaining about. 2014-07-31 16:17:37 +01:00
Pseudonym
e25ad9759a Merge pull request #178 from Sonicadvance1:x86_64-cpudetect
Support grabbing the MXCSR mask on x86_64.
2014-07-31 16:14:49 +01:00
Ryan Houdek
06ccc0121f Support grabbing the MXCSR mask on x86_64.
Instead of using some dynamic code to grab the FXSave information, use an intrinsic if on at least MSVC 2012.
With GCC just use a bit of ASM, and if on MSVC 2010 or older, use the old crappy method.

This method can be removed once MSVC 2010 support is dropped and mandate at least MSVC 2012 minimum.
2014-07-31 10:11:25 -05:00
Pseudonym
03bfffea23 Merge pulled request #174 from Sonicadvance1/x86_64-emitter-fixes
Fix a couple issues in the x86emitter on x86_64.
2014-07-31 15:43:35 +01:00
Pseudonym
de5a55c03e Merge pull request #176 from Sonicadvance1/x86_64-recompiler-casts
Fix a bunch of casts in the x86 recompiler core.
2014-07-31 15:03:26 +01:00
Ryan Houdek
b4771030d3 Fix a couple issues in the x86emitter on x86_64.
This won't fix the billions of errors that will happen at runtime of using the x86 emitter, but chooses to make some better coding practice choices
that enables it to compile on x86_64.

in the xIndirectVoid class, instead of using s32 for the offset, use sptr which will be 32bit or 64bit depending on architecture.
This also fixes a few alignment issues in xAddressVoid's constructors.

In EmitSibMagic we are casting a void* to s32, which won't work on x86_64, so first do a cast from sptr to s32.
Won't work on x86_64, but gets us compiling.
2014-07-31 09:01:56 -05:00
Pseudonym
4d06f982db Merge pull request #181 from lioncash/elif
Remove 'elif' define from Pcsx2Defs and microvu_misc.h
2014-07-31 14:21:47 +01:00
Pseudonym
1fb057462a Merge pull request #180 from lioncash/const
Apply const to some functions in Gif_Unit.h
2014-07-31 13:47:10 +01:00
sudonim1
93374facb8 Merge pull request #179 from moshekaplan/patch-7
Cleanup leaking memory and filehandles
2014-07-31 13:37:22 +01:00
Kingcom
e862047142 Add write32 method to DebugInterface 2014-07-31 14:10:36 +02:00
Kingcom
90eb776310 Add assembler 2014-07-31 14:10:36 +02:00
Pseudonym
9c77b2dfeb Merge pull request #177 from moshekaplan/patch-6
Fix Ztable memory leaks
2014-07-31 12:58:13 +01:00
Pseudonym
6abfd601ba Merge pull request #175 from Sonicadvance1/x86_64-dialog-casts
Fixes a few casts in the DisassemblyDialog and PluginSelectorPanel.
2014-07-31 12:40:29 +01:00
ramapcsx2
38738b2a18 Merge pull request #182 from chinhodado/patch-1
Fix a typo in README
2014-07-31 11:34:00 +02:00
chinhodado
99b5f7badf Fix a typo in README 2014-07-31 00:48:24 -04:00
Lioncash
ac558afc8a Remove 'elif' define from Pcsx2Defs and microvu_misc.h 2014-07-30 23:44:04 -04:00
Moshe Kaplan
d555656a41 Cleanup leaking memory and filehandles 2014-07-30 22:52:34 -04:00
Lioncash
10fd86fd68 Apply const to some functions in Gif_Unit.h 2014-07-30 22:52:00 -04:00
Moshe Kaplan
af58734826 Fix Ztable memory leaks 2014-07-30 22:09:25 -04:00
Ryan Houdek
08a6ff6e6c Fix a bunch of casts in the x86 recompiler core.
There are a load of casts from pointers to 'int' and 'u32' in the JIT core.
This takes a better practices approach to the problem and casts to uptr instead.
Zero functionality change of course, just changes all of these terrible casts to going to uptr which makes the casting style consistant and work on
both x86_32 and x86_64.

This obviously doesn't work around the issue of the recompiler not running on x86_64, but we need compiling before we delve further.
2014-07-30 18:32:36 -05:00
Ryan Houdek
7d13f96e28 Fixes a few casts in the DisassemblyDialog and PluginSelectorPanel.
We are casting wxWidget's events userdata from void* to integers.
So use uptr instead since it'll work on both x86_32 and x86_64.
2014-07-30 18:25:13 -05:00
Pseudonym
e726f82344 Merge pull request #161 from Kingcom/Debugger
Debugger enhancements
2014-07-30 18:24:38 +01:00
Gregory Hainaut
5c054fb486 pcsx2: compilation issue (miss a L for wstring) 2014-07-30 19:19:42 +02:00
sudonim1
904f5de1ea Merge pull request #144 from Sonicadvance1/fix-BitScanFoward
Fix the BitScanForward implementations for x86_64.
2014-07-30 18:19:19 +01:00
Kingcom
c79fe9a1e7 Fix linux issues 2014-07-30 19:02:39 +02:00
Kingcom
15943eddb1 Fix string handling in breakpoint list 2014-07-30 19:01:50 +02:00
Kingcom
8d1e294b32 Also highlight registers accessed by memory opcodes 2014-07-30 19:01:49 +02:00
Kingcom
c4e89bea32 Add function list 2014-07-30 19:01:49 +02:00
Kingcom
b37f6e9df1 Fix display of memory breakpoint enable status and add context menu to breakpoint list 2014-07-30 19:01:49 +02:00
Kingcom
30a5e31b66 Show the cycles passed in the debugger 2014-07-30 19:01:48 +02:00
sudonim1
5415fb361f Merge pull request #166 from moshekaplan/patch-2
Prevent filehandle from leaking
2014-07-30 17:42:01 +01:00
sudonim1
34010c5605 Merge pull request #167 from moshekaplan/patch-5
Avoid leaking `iso` structures
2014-07-30 13:36:24 +01:00
Gregory Hainaut
41d2ea4306 i10n: refresh all languages
Remove the --previous option of po generation. It broke some translations.

Remove the translation of PCSX2 version, no point to translate C format symbol.
2014-07-30 09:21:49 +02:00
Gregory Hainaut
36ea4658f1 Revert "i10n: refresh all languages"
This reverts commit 7a9f4161ea.
2014-07-30 09:21:49 +02:00
Gregory Hainaut
cc0b9bbca9 cmake: drop gtk workaround for ubuntu 10.10
Note: remove also FIND_LIBRARY_USE_LIB64_PATHS that is alredy set in build parameter
2014-07-30 09:21:49 +02:00
Gregory Hainaut
f38c6d0995 Merge pull request #142 from Sonicadvance1/fPIC_x86_64
Enable -fPIC on x86_64.
2014-07-30 00:01:08 +02:00
ramapcsx2
bfa2bbef85 Merge pull request #164 from moshekaplan/patch-1
Avoid leaking `romdir` file handle
2014-07-29 21:53:17 +02:00
Gregory Hainaut
7a9f4161ea i10n: refresh all languages 2014-07-29 21:40:32 +02:00
Gregory Hainaut
5c0702092a i10n: update sv_SE 2014-07-29 21:23:47 +02:00
Gregory Hainaut
0706564215 remove sparsehash from 3rdparty
small deps but the less the merrier

Note: could someone check windows builds :p
2014-07-29 21:06:31 +02:00
Gregory Hainaut
6485bd89d9 common: drop remaining of HashMap
Ryan Houdek removes all use of this code.

Let's remove the left-overs too, beside it will removes the sparsehash depencency
2014-07-29 21:06:31 +02:00
Gregory Hainaut
38f617233d pcsx2: don't rely on 3rdpary to bring back include dependency 2014-07-29 21:06:30 +02:00
Gregory Hainaut
9e774eb41c pcsx2: use int instead of uint on file reader
Fix a crash when offset was negative. Offet becomes bigger than my input file.
2014-07-29 20:52:18 +02:00
Kingcom
6f101c0a0c Add small lines between four byte groups in the memory view and fix status bar text not being displayed 2014-07-29 20:50:58 +02:00
Gregory Hainaut
1d5b250b58 pcsx2/cdvd: kill a small memory leak 2014-07-29 20:49:46 +02:00
Gregory Hainaut
e7d0a0345e pcsx2/: remove ^M eol on 3 files 2014-07-29 20:49:46 +02:00
Gregory Hainaut
50868f14f6 pcsx2: don't access member data directly 2014-07-29 20:45:46 +02:00
Gregory Hainaut
79701aa613 gui:debugger: clean string management
Let's use the FastFormatUnicode infrastructure
2014-07-29 20:45:46 +02:00
Gregory Hainaut
ac41ba1f73 wx3.0: rename some deprecated API call
Avoid various gcc warning

Note: Compatible with recent wx2.8 version
2014-07-29 20:45:45 +02:00
Gregory Hainaut
deb69c4c72 wx3.0: add a stripped down version of wx3.0
Based on the debian version.

Note: it can be surely stripped down further

MS build script must be updated. Note: I keep wx original  script as reference
2014-07-29 20:45:45 +02:00
Gregory Hainaut
76237955c7 wx3.0: fix various string printing on linux
wide-char must use %ls format on linux. Don't rely on non standard %s/%S
2014-07-29 20:45:44 +02:00
Gregory Hainaut
cfa8e94e95 wx3.0: disable an useless symbol on linux
Not used and print an error message for each plugins.
2014-07-29 20:45:44 +02:00
Gregory Hainaut
01de778831 wx3.0: various buggy code (wx assertion)
v3: reenable dc.GetSize, I didn't manage to reproduce the assertion failure
2014-07-29 20:45:44 +02:00
Gregory Hainaut
1fda2a611c wx3.0: various interface update
v3: partially revert previous version

* Keep old behavior for translation on wx2.8
* Revert wxDataObjectSimple parameter change
+ feature is MSW only
+ devs are welcome to improve it
* restore standard path, only update the reference type
2014-07-29 20:45:44 +02:00
Gregory Hainaut
d5d19acb3f wx3.0: lots of cast...
Various string as still wrong but at least it can be compiled now.

I think the remaining issue are w_char with %s format (at least on linux)
2014-07-29 20:45:44 +02:00
Gregory Hainaut
fded22e1b3 wx3.0: extend logger to support wxString as input
Note: only enabled it on 2.8 for windows (because of UTF8 linux is fine)
2014-07-29 20:45:44 +02:00
Gregory Hainaut
91afc2079c wx3.0: force wide char as expected
Note: on linux it would be better to force everythings to use UTF8
2014-07-29 20:45:43 +02:00
Gregory Hainaut
d09fee90ad wx3.0: add cmake support (2.8 by default)
use ./build.sh --wx30 for wx3.0
2014-07-29 20:45:43 +02:00
Moshe Kaplan
e1dbdce91e Update libiso.cpp
Oops, accidentally caused a use-after-free
2014-07-29 12:22:44 -04:00
Pseudonym
28227ea4c4 Merge pull request #123 from Sonicadvance1/fix_interlockedbittestandresetset
Fixes interlockedbittestandreset/set in intrin_x86.h
2014-07-29 14:20:13 +01:00
ramapcsx2
97ad04dfd0 Merge pull request #171 from Dokman/ca_ES
Rername pot files to po
2014-07-29 14:06:12 +02:00
dokman
4ada08c690 Changes acording to compile po files and remove the bin files that doesn't do anything there 2014-07-29 14:00:47 +02:00
dokman
84ee81aba9 I missed to put the files in bin directory 2014-07-29 13:46:14 +02:00
ramapcsx2
32a70a6552 Merge pull request #116 from Dokman/ca_ES
[WIP]Catalan translation files
2014-07-29 09:50:13 +02:00
arielsrv
ae88702e00 Added building support from Windows command line. This feature allow build in parallel (all available core) and use hard links if possible. Also change configuration destiny (i. e. avx2). It really is much faster than Visual Studio GUI.
Usage: build.cmd "Release AVX".
2014-07-28 15:26:30 -03:00
dokman
384fe14ac6 More translations i think that now can be used by people 2014-07-27 01:22:09 +02:00
dokman
c52228278f Huge fuckmind translating more things 2014-07-27 01:22:08 +02:00
Ryan Houdek
8c07d4e7b9 Enable -fPIC on x86_64.
-fPIC is required on x86_64 for shared libraries.
This allows the compilation to get farther in to plugin compiling.
2014-07-26 03:08:35 -05:00
refraction
fb5b7a34e3 VIF: Modification to illegal IRQ's on NOP's Fixes #162 . Some games like Looney Tunes Back In Action use the lower 16 bits for special codes, so we only check the command info area (not the command itself of course, that would be silly). 2014-07-24 18:22:00 +01:00
Moshe Kaplan
1e951605fb Avoid leaking iso structures 2014-07-23 13:58:17 -04:00
Moshe Kaplan
82dd025860 Prevent filehandle from leaking 2014-07-23 13:51:22 -04:00
Moshe Kaplan
f1d5a0a1b3 Avoid leaking romdir file handle 2014-07-23 11:42:05 -04:00
Gregory Hainaut
8a43789db5 zzogl/spu2x: clang warning fix
Nothing critical
2014-07-20 22:07:02 +02:00
Gregory Hainaut
ef0e3fe6c6 gsdx: disable separate shader on radeon driver (linux) 2014-07-19 14:02:37 +02:00
Pseudonym
41d12130c2 Merge pull request #155 from Kingcom/Debugger
Check for alignment when accessing memory with the debugger
2014-07-19 00:36:15 +01:00
Kingcom
b23062c54a Check for alignment when accessing memory with the debugger 2014-07-19 01:05:41 +02:00
Pseudonym
455a20d852 Removed unnecessary #include after pull request #154. 2014-07-18 21:54:46 +01:00
Pseudonym
a3498c506f Merge pull request #154 from from Kingcom/Debugger
Revert part of #140
2014-07-18 21:50:59 +01:00
Kingcom
2505291065 Revert part of #140 2014-07-18 22:17:41 +02:00
Forrest McDonald
81458912f9 pcsx2: remove template and pointer on overload function from wxGuiTools
Fixed clang build.

Note from Gregory:
C++ requests that at least 1 parameters is a class, an enumeration, or a
reference to those objects. Probably to avoid to screw basic type operation.
For example: *p += 4;

The realy buggy code was this one because T could be an int!
template T
f(*ptr, T)

To avoid any issue in the future the Team decide to drop all overload that use pointers.
2014-07-18 19:20:53 +02:00
Forrest McDonald
da93a960af clang fix for narrowing 2014-07-18 19:14:41 +02:00
David Quintana
cea03d91e4 Merge pull request #141 from lioncash/cdvdghz
cdvdGigaherz: Fix a few things
2014-07-16 20:50:40 +02:00
sudonim1
320d22f2a7 Merge pull request #146 from Sonicadvance1/GSdx-x86_64-fixes
Fixes for getting GSdx to compile on x86_64
2014-07-16 19:29:58 +01:00
Ryan Houdek
8ff0f9e869 Update GSSetupPrimCodeGenerator for x86_64.
offsetof requires the expression to be constant to get the offset.
Use a combination of offsetof + sizeof to get the correct offset.
2014-07-16 13:21:45 -05:00
Ryan Houdek
74dd2553a6 Fix function definitions in GSDrawScanlineCodeGenerator.x64
These have been changed since this was last compiled.
Also removes a #error and drops it to a #warning for now while development is in process.
2014-07-16 12:13:09 -05:00
sudonim1
85bb789ffa Merge pull request #148 from Sonicadvance1/remove-dictionary
Remove most of HashTools.
2014-07-16 18:10:56 +01:00
sudonim1
06dfc4e6ef Merge pull request #118 from lioncash/zgs
Minor changes to ZeroGS
2014-07-16 18:08:12 +01:00
Ryan Houdek
ba7b0612dc Use the iterator to get the value from maps to avoid two look ups. 2014-07-16 12:00:50 -05:00
ramapcsx2
c8c4ff39de Merge pull request #152 from josephgbr/master
Update Brazilian Portuguese translation
2014-07-16 18:57:18 +02:00
ramapcsx2
d12e5104e2 Merge pull request #149 from Kingcom/LilyPad
Allow hotplugging XInput devices in LilyPad
2014-07-16 18:55:10 +02:00
sudonim1
90515fdbb0 Merge pull request #150 from Kingcom/Highlight
Highlight arguments from disassembler selection
2014-07-16 17:49:49 +01:00
ramapcsx2
cb9fc6fa3e Merge pull request #100 from lioncash/duplicate-condition
ZeroGS: Remove a duplicate condition in RenderCRTC
2014-07-16 18:33:15 +02:00
Rafael Ferreira
152f04c0a7 Keep previous translation
When updating existing PO files with the newly created POT files, keep previous msgids of translated messsages (as fuzzy). This allows translators to compare previous and current msgid strings and then identify what has changed, resulting in a faster translation activity and a more consistent GUI.
2014-07-16 12:18:58 -03:00
Rafael Ferreira
527d58c9c3 Updated Brazilian Portuguese translation
Updated pt_BR translation for pcsx2_Main file
2014-07-16 12:04:08 -03:00
Rafael Ferreira
839c0af088 Updated Brazilian Portuguese translation
Updated pt_BR translation for pcsx2_Iconized file
2014-07-16 12:02:54 -03:00
Kingcom
3db06d7426 Highlight arguments from disassembler selection 2014-07-16 16:20:03 +02:00
ramapcsx2
ae607e56ca These are also not needed anymore. 2014-07-16 12:46:01 +02:00
ramapcsx2
d6b042f9fe Merge branch 'master' of https://github.com/PCSX2/pcsx2 2014-07-16 12:32:51 +02:00
ramapcsx2
735e441afc Merge pull request #132 from Dokman/patch-1
Deleting avg thing of the full installer
2014-07-16 12:32:12 +02:00
sudonim1
48d00e817f Merge pull request #145 from Sonicadvance1/zzogl-pointer-cast
Fix a pointer cast on x86_64 in zzogl.
2014-07-16 10:53:54 +01:00
Kingcom
ce4dc4ae21 Allow hotplugging XInput devices in LilyPad 2014-07-16 11:18:20 +02:00
Ryan Houdek
0c1087a2e5 Remove HashTools::IHashable/CommonComparisonClass
These are no longer used.
2014-07-15 22:08:11 -05:00
Ryan Houdek
abd605a066 Remove HashTools::HashSet.
This is no longer used.
2014-07-15 22:07:03 -05:00
Ryan Houdek
5bd06d3a02 Remove HashTools::HashMap/SpecializedHashMap
These are no longer used. Wipe them out.
2014-07-15 22:05:36 -05:00
Ryan Houdek
391cf379ae Remove usages of HashTools::Dictionary/HashMap
Replace these usages with unordered_map since they are just as quick
2014-07-15 22:02:14 -05:00
Ryan Houdek
264cce2003 Also remove UnicodeDictionary.
This class isn't used anywhere and we should promote usage of std::unordered_map instead of this class
2014-07-15 21:01:30 -05:00
Ryan Houdek
79dd0958d0 Remove the pxDictionary class since it is no longer needed.
This was only used by the game database, which has now been changed to an unordered_map
2014-07-15 20:58:25 -05:00
Ryan Houdek
2c6188b73f Switch the GameDatabase from using a pxDictionary to a std::unordered_map.
Both implementations are about the same, which is hard to measure since we are limited in speed due to the hashing function.

Both implementations averaged ~220ms to load the full game database on my workstation.
2014-07-15 20:55:52 -05:00
Ryan Houdek
33adabb035 Fix some _M_AMD64 checks in GSdx.
In the future these will be _M_X86_64, but for now this won't be the case.
2014-07-15 18:21:03 -05:00
Ryan Houdek
616500b8f3 Disabled preferred stack boundary on x86_64in GSdx. 2014-07-15 18:18:59 -05:00
Ryan Houdek
2f98f5a6d6 Fix a pointer cast on x86_64 in zzogl. 2014-07-15 18:16:14 -05:00
Ryan Houdek
2a6656050c Fix the BitScanForward implementations for x86_64. 2014-07-15 18:13:32 -05:00
sudonim1
80b22ca2be Merge pull request #140 from Kingcom/Debugger
Various debugger fixes and enhancements
2014-07-15 23:59:07 +01:00
Kingcom
53159a81cf -Add lq/sq preview
-fix potential memory access exceptions
-prevent the disassembly from changing positions when a breakpoint is toggled
-only use the status bar text from the current cpu
2014-07-16 00:51:53 +02:00
sudonim1
6f0f7ce948 Merge pull request #110 from Sonicadvance1/hashmap_64bit
Support 64bit address hashing in the CommonHashClass.
2014-07-15 23:15:03 +01:00
sudonim1
c21dd828d5 Merge pull request #137 from Sonicadvance1/vtlb-64bit
Fix vtlb compiling for x86_64.
2014-07-15 23:13:08 +01:00
Ryan Houdek
97bed8e710 Fix vtlb compiling for x86_64.
This has no functional change on x86_32, it's mostly just changing a few pointer to u32 conversions to uptr and sptr.

I can not yet confirm if this runs on x86_64, but compiling is enough of an issue currently.
2014-07-15 16:42:59 -05:00
sudonim1
aaf70d652b Merge pull request #138 from Sonicadvance1/yuv2rgb-64bit
Let non-x86_32 use the reference yuv2rgb conversion function.
2014-07-15 22:34:38 +01:00
Lioncash
54c21b30c9 cdvdGigaherz: Fix the seek function in FileStream.
Prior to this, it would have ignored any kind of reference position.
2014-07-15 17:28:13 -04:00
sudonim1
91f23938b5 Merge pull request #136 from Sonicadvance1/gui-pointers
Fix two conversions of pointers to integer in the GUI.
2014-07-15 22:20:37 +01:00
Ryan Houdek
0af0db6593 Fix two conversions of pointers to integer in the GUI.
Use uptr instead of 32bit integers fixes the issue of compiling.
2014-07-15 16:18:24 -05:00
sudonim1
7a1ebd22ed Merge pull request #135 from Sonicadvance1/jmp_emitter
Change the x86emitter jmp emitter from using s32 to sptr.
2014-07-15 22:16:04 +01:00
Lioncash
c2e96a081f cdvdGigaherz: Use booleans instead of ints to represent conditionals in CDVD.cpp 2014-07-15 17:06:49 -04:00
sudonim1
1d56035a56 Merge pull request #134 from Sonicadvance1/NOT32-declaration
Fix NOT32M function declaration.
2014-07-15 22:06:48 +01:00
sudonim1
0e68a9e0fc Merge pull request #133 from Sonicadvance1/microvu_ptr
Fix microVU converting pointers to u32.
2014-07-15 22:02:19 +01:00
Ryan Houdek
a143a8b1f6 Let non-x86_32 use the reference yuv2rgb conversion function.
The yuv2rgb_sse2 implementation is x86_32 only, so x86_64 can't take advantage of this optimized code path.

This requires the architecture defines to be working fully, so this can't be merged until it is fixed on the Windows side of things.
2014-07-15 15:31:07 -05:00
Ryan Houdek
5114b37bfa Change the x86emitter jmp emitter from using s32 to sptr.
This doesn't change anything on x86_32, but it is required on x86_64 so we don't lose precision.
Also adds an assert to see if the distance is greater than the maximum 32bit jump, which can't be hit on x86_32, but can be on x86_64.
2014-07-15 15:16:30 -05:00
Ryan Houdek
8c746302a2 Fix NOT32M function declaration.
Use uptr as the argument since it is either u32 or u64 depending on architecture.
2014-07-15 15:05:46 -05:00
Ryan Houdek
a1d6ca2298 Fix microVU converting pointers to u32.
Convert them to uptr instead to make it architecture independent.
2014-07-15 15:04:08 -05:00
dokman
d6a617c225 Deleting avg thing of the full installer
If now you have drop the avg toolbar it does nothing here i think
2014-07-15 18:30:49 +02:00
David Quintana
69f57351b2 Merge pull request #109 from Sonicadvance1/windows_arch_defines
Support _ARCH_32/64 defines on Windows
2014-07-15 17:04:21 +02:00
David Quintana
c4d5267107 Merge pull request #128 from Sonicadvance1/linux_arch_defines
Support _M_X86[_32/_64] on Linux.
2014-07-15 17:04:20 +02:00
Ryan Houdek
6b1ee680a2 Support _ARCH_32/64 _M_X86[_32/_64] defines on Windows
This defines the correct define depending on architecture build target.
Currently Windows doesn't support a x86_64 build target, but once it does the define will be in place.
2014-07-15 09:16:37 -05:00
sudonim1
d3ebdae159 Merge pull request #131 from lioncash/gsdx-wat
GSDX: Replace an FLT_MAX with the appropriate ULONG_MAX
2014-07-15 12:04:14 +01:00
sudonim1
86a0d3faff Merge pull request #124 from lioncash/array-bounds
sVU_zerorec.cpp: Correctly guard against invalid indexes in SuperVUDestroy
2014-07-15 11:27:53 +01:00
sudonim1
3f62ad08e1 Merge pull request #122 from lioncash/indents
COP0: Fix indentation for function TLBR
2014-07-15 11:26:13 +01:00
sudonim1
1a483a7d88 Merge pull request #121 from lioncash/zzogl-fix
ZZOGL: Fix an incorrect formatting argument in the Win32 config.
2014-07-15 11:22:45 +01:00
ramapcsx2
3daff15f34 Merge branch 'master' of https://github.com/PCSX2/pcsx2 2014-07-15 11:56:55 +02:00
David Quintana
1736c1e32e Merge pull request #125 from lioncash/cdghz
cdvdGigaherz: Simplify the loops within readLine and readLineW
2014-07-15 11:53:36 +02:00
David Quintana
764ca25f8d Merge pull request #120 from lioncash/dev9ghzdrk
DEV9ghzdrk: Clarify precedence for a bitwise AND in smap.
2014-07-15 11:53:27 +02:00
David Quintana
79ee48d91b Merge pull request #129 from lioncash/spu2x-warnings
SPU2-X: Fix some signed/unsigned mismatch warnings.
2014-07-15 11:52:02 +02:00
David Quintana
e2f4fc245a Merge pull request #127 from lioncash/dev9-warnings
dev9ghzdrk: Fix a few warnings.
2014-07-15 11:49:37 +02:00
David Quintana
f26319a2b0 Merge pull request #126 from lioncash/dev9-unused
dev9ghzdrk: Remove unreachable code.
2014-07-15 11:49:12 +02:00
Lioncash
637c99a362 GSDX: Replace an FLT_MAX with the appropriate ULONG_MAX 2014-07-15 01:47:26 -04:00
Ryan Houdek
a1a0ed0563 Support _M_X86[_32/_64] on Linux.
These go hand in hand with PR #109 but for Linux as well.

These are much more useful defines than what other compilers give us.
2014-07-14 23:58:02 -05:00
Lioncash
0a825a1aa4 SPU2-X: Fix some signed/unsigned mismatch warnings. 2014-07-15 00:09:48 -04:00
Lioncash
b5f805fc6c dev9ghzdrk: Fix a few warnings.
Mostly unsigned mismatches.
2014-07-14 23:41:51 -04:00
Lioncash
55c8633f9a dev9ghzdrk: Remove unreachable code.
Same as what is in the default switch cases
2014-07-14 23:26:31 -04:00
Lioncash
1fa95de554 cdvdGigaherz: Simplify the loops within readLine and readLineW 2014-07-14 22:58:49 -04:00
Lioncash
a1080f4853 sVU_zerorec.cpp: Correctly guard against invalid VU indexes
recVUHeaders and recVUBlocks are both arrays of size 2. Prior to this, it would allow an index of 2, which is out of range.
2014-07-14 22:44:31 -04:00
Ryan Houdek
48d178886e Fixes interlockedbittestandreset/set in intrin_x86.h
This doesn't update the file to the latest version from mingw32 since this is already a custom header stripped from mingw32.

This also fixes the functions for x86_64(verified that it still works for both architectures) and also updates the version inside of GSdx.
Also removes a comment in the GSdx header saying that these functions are broken since they no longer are.
2014-07-14 21:20:31 -05:00
Lioncash
673bac12a6 COP0: Fix indentation for function TLBR 2014-07-14 22:07:02 -04:00
Lioncash
b0a0508c85 ZZOGL: Fix an incorrect formatting argument in the Win32 config.
the _u32 should be passed, not the direct union itself.
2014-07-14 21:31:44 -04:00
Lioncash
69ecdd3236 DEV9ghzdrk: Clarify precedence for a bitwise and in smap. 2014-07-14 20:49:03 -04:00
sudonim1
9a950cdca6 Merge pull request #119 from lioncash/spu2x
SPU2-X: Fix float truncation warnings
2014-07-15 01:31:44 +01:00
Lioncash
7ec3cf46d6 SPU2-X: Fix float truncation warnings 2014-07-14 20:26:38 -04:00
Lioncash
ba0d3d1a6a ZeroGS: Add a missing formatter to a sprintf call 2014-07-14 18:02:22 -04:00
Lioncash
b9ff3b6c81 ZeroGS: Explicitly convert the LPVOID buffer to a const char*
Also make the failure case for one of these log calls a DEBUG_LOG instead
of a printf.
2014-07-14 18:01:50 -04:00
David Quintana
f4178e41b3 Merge pull request #117 from lioncash/cdvd
Minor changes to cdvdGigaherz
2014-07-14 22:38:48 +02:00
Lioncash
d648227e3d cdvdGigaherz: Get rid of a magic constant in TocStuff 2014-07-14 16:11:51 -04:00
Lioncash
3d0094b611 cdvdGigaherz: Fix some minor tab/space mismatches in TocStuff 2014-07-14 16:11:01 -04:00
Gregory Hainaut
f85a4c0467 clang: don't use clang asm tool
-no-integrated-as fixes most of the asm issue :)
2014-07-14 13:58:06 +02:00
Forrest McDonald
b24d4cce8d Clang doesn't support some flags that GCC does, so conditionally check the compiler and add them if we are doing a GCC build 2014-07-14 13:54:31 +02:00
dokman
a235da9cc5 Windows GS -
Finished
2014-07-13 22:10:01 +02:00
dokman
fa45ea32dc GS Window -
Many translations like a 85%
2014-07-13 21:41:41 +02:00
dokman
a594c444da Starting - Settings
- Finished EE/IOP (Original)
- Finished VUs (Original)
- Finished GS (All Translated)
2014-07-13 21:04:09 +02:00
dokman
210f06d990 Finishing the System Menu now this menu is at 100% 2014-07-13 19:22:38 +02:00
Dokman
899156435c update of copyrights 2014-07-13 19:05:51 +02:00
Dokman
1303b4950f Typo error 2014-07-13 19:05:01 +02:00
Dokman
a24deadb54 update of copyrights 2014-07-13 19:04:33 +02:00
dokman
4b55e6e68e Starting Catalan Translation Files:
-First configuration finished translations
- System Menu at 90% translated
2014-07-13 19:02:20 +02:00
ramapcsx2
0121366f65 Merge branch 'master' of https://github.com/PCSX2/pcsx2 2014-07-12 20:23:01 +02:00
Gregory Hainaut
c60fefa1a6 gcc: support address sanitizer 2014-07-12 19:57:26 +02:00
Gregory Hainaut
8c03d50421 cmake: remove a specific warning for clang 2014-07-12 16:04:57 +02:00
Gregory Hainaut
7318814474 pcsx2: remove/disable brace warning 2014-07-12 16:04:07 +02:00
Gregory Hainaut
afc4f3386a pcsx2: be sure that variables are initialized 2014-07-12 16:03:06 +02:00
Gregory Hainaut
c6c6171841 pcsx2: don't hide base function
As far as I understand you can't mix virtual (select at runtime) and
overloading (select at compile time).
2014-07-12 16:01:21 +02:00
Gregory Hainaut
47bf88ed3f gsdx: miss break / inline function in header 2014-07-12 16:00:10 +02:00
Gregory Hainaut
492d67c6e8 spu2x: use std::abs (c abs support only integer) 2014-07-12 15:59:29 +02:00
ramapcsx2
58b63cb58c Merge branch 'master' of https://github.com/PCSX2/pcsx2 2014-07-12 14:41:50 +02:00
Gregory Hainaut
d4a76b979c ooups a very bad typo 2014-07-12 13:33:24 +02:00
Gregory Hainaut
4fdfd04d3c partially revert c5d2343f51
Parameter name can help to understand the code so let's keep them.
Clang warning was disabled in previous commit
2014-07-12 13:30:34 +02:00
Gregory Hainaut
79f6aacc85 common: various warning fix
* Use c++11 static assert
* Properly cast to parameter template to u32 (help clang)
* Remove lots of useless ASM. Memset it only used with a size of 4096.
* check pthread_mutex_init status
2014-07-12 12:59:23 +02:00
Gregory Hainaut
c73ce3d02d pcsx2: don't use 0&& to remove code
It works but compiler is not happy because it is still parsing the full line.
2014-07-12 12:59:23 +02:00
Gregory Hainaut
f3d03b025a pcsx2: reorder init of member in constructor
Init must be done in the order of declaration
2014-07-12 12:59:23 +02:00
Gregory Hainaut
a1ac59a48a pcsx2: add various default case statement
Note: add a note on some case note handled properly not sure how to fix them.
Actually there are potentially invalid case.
2014-07-12 12:59:23 +02:00
Gregory Hainaut
f401f817ed cmake: sdl opt typo + clean warning management
Add back a lots of warning in the core!
2014-07-12 12:59:23 +02:00
Gregory Hainaut
23c76075e5 Merge pull request #108 from Sonicadvance1/wrong_arch
Remove -march argument on x86_64 build option.
2014-07-12 12:58:04 +02:00
Ryan Houdek
d132e6bce4 Support 64bit address hashing in the CommonHashClass.
The class already supports hashing 64bit values, just break it out to support it in this particular case.
From the 64bit version of the hash, this hash favours values that aren't on the extreme end.
Consdering that hashing is only really used by the class itself it isn't too big of an issue.
2014-07-11 17:16:58 -05:00
Ryan Houdek
1f188b2610 Remove -march argument on x86_64 build option.
GCC doesn't support pentium4 as a arch target for x86_64. It complains that the architecture doesn't support x86_64
Which to be fair the first few models didn't support 64bit.
Just remove the architecture setting since there isn't a need for it.
2014-07-11 14:32:17 -05:00
Gregory Hainaut
a6d8b3b847 linux build: add an easy option to strip binary 2014-07-10 09:17:39 +02:00
Gregory Hainaut
0de6e80093 stupid space 2014-07-09 15:46:46 +02:00
Gregory Hainaut
3d0f8c986f Update contributing.md 2014-07-09 15:41:09 +02:00
ramapcsx2
d41edf21e4 Merge branch 'master' of https://github.com/PCSX2/pcsx2 2014-07-08 20:57:47 +02:00
refraction
06167087b3 Remove SVN checks from installer files. Closes issue #20 2014-07-08 01:38:50 +01:00
ramapcsx2
a3d5d9112a Merge branch 'master' of https://github.com/PCSX2/pcsx2 2014-07-07 09:38:54 +02:00
sudonim1
1cb5ba3efd Merge pull request #98 from Sonicadvance1/minor_cleanup
Some minor cleanups to the codebase.
2014-07-06 12:11:00 +01:00
ramapcsx2
b56d9c9e31 Merge pull request #96 from lioncash/unused-vars
Core: Remove some unused variables
2014-07-05 20:58:12 +02:00
ramapcsx2
a48369dc41 Merge branch 'master' of https://github.com/PCSX2/pcsx2 2014-07-05 20:48:52 +02:00
ramapcsx2
6800753f09 bla 2014-07-05 20:48:45 +02:00
ramapcsx2
e9e08c6576 Merge pull request #95 from lioncash/typo-error
ZeroGS: Fix a sprintf typo in GSopen.
2014-07-05 20:42:45 +02:00
ramapcsx2
5907bbea6e Merge pull request #89 from lioncash/array-bounds
Fix a possibility for out of bound accesses in logging within Cache.cpp
2014-07-05 20:34:56 +02:00
Lioncash
cb5b265dcd ZeroGS: Remove a duplicate condition in RenderCRTC 2014-07-05 14:00:00 -04:00
Gregory Hainaut
f9baf3eb1c Merge branch 'Sonicadvance1-cmake_64bit_option' 2014-07-05 15:09:49 +02:00
Gregory Hainaut
1dba4aceca cmake: reduce a bit cmake syntax cluttering 2014-07-05 15:08:39 +02:00
Gregory Hainaut
e8b3532658 cmake: clean main file and option
Move build configuration from CMakeLists to cmake/BuildParameters.cmake where it belongs
Use option syntax for on/off option
Complete a bit previous commit to force all 64bits path detections (likely done by cmake)
2014-07-05 14:54:56 +02:00
Ryan Houdek
35979bb5a6 Add a CMake compile time option for building a 64bit binary.
By default the cmake build will still cross compile a 32bit binary and spout a message about it if not enabled.
This doesn't fix the 64bit build issues, just makes it easier for someone to test 64bit builds in the future.
Look towards a bright future instead of a dark and gloomy past
2014-07-05 05:09:17 -05:00
Ryan Houdek
182e826dc5 Fix SpatialArrayReserve::SetBlockSize function declaration to match definition.
The function was defined to use uptr, but the declaration was using uint.
2014-07-05 04:59:31 -05:00
Ryan Houdek
08ef4bfbff Wipe the clusterfsck that was the get16bits define in HashTools.
This define takes a pointer(s8* in this case) and grabs 16bits of data from the array it points to.
This can be done the generic way on all compilers, no need for specifying it another way.
2014-07-05 04:39:55 -05:00
Ryan Houdek
1bc3f346b1 Fix HostSys::Munmap function declaration.
It's arguments are defined to be (void*, size_t) but with the function declaration they were (void*, u32).
2014-07-05 04:36:48 -05:00
Lioncash
6dff0b13a4 Core: Remove some unused variables 2014-07-04 22:11:13 -04:00
Lioncash
76796c76cd ZeroGS: Fix a sprintf typo in GSopen.
This 1000 millisecond specifier was intended for the AddMessage call.
2014-07-04 21:50:18 -04:00
Gregory Hainaut
c5d2343f51 pcsx2/common: fix tons of warning spamming on clang
* Don't use parameter name to avoid unused parameter
* Set a default for various case
2014-07-05 00:08:48 +02:00
Gregory Hainaut
e6e7c95e94 linux: add an option for clang
It will be used on the future with clang/cmake cleaning contribution
2014-07-05 00:08:48 +02:00
Pseudonym
f4cb9de8d9 mVU: Corrected a typo in the branch in branch delay slot handling which prevented using the simpler code in the case of the delay slot being that of an unconditional branch. Now hopefully the code in question actually works for that case, since I'm not sure this has been tested. 2014-07-04 12:38:14 +01:00
Pseudonym
6f19551a77 Quick fix for undefined behaviour in the R3000A disassembler. 2014-07-04 12:35:00 +01:00
Gregory Hainaut
efce449550 github: add a CONTRIBUTING.md file
Initial version that likely got a broken syntax :(
2014-07-03 21:22:15 +02:00
Lioncash
ffa216d958 Fix a possibility for out of bound accesses in logging within Cache.cpp 2014-07-03 00:24:16 -04:00
ramapcsx2
ecb42cad9b Thanks Bluefire101 for reporting this (eventually) undefined behavior (depending on who you ask).
Even if there was no problem, code should always be clear on what it does.
2014-07-01 15:43:26 +02:00
refraction
0ddb77c048 VIF: Ignore interrupts caused by obviously bogus NOP and NULL codes. Fixes Onimusha Blade Warriors. 2014-06-30 18:56:10 +01:00
Gregory Hainaut
5bd806ada6 Merge pull request #75 from Leucos8/master
i10n: Updated the it_IT translation files

Thanks
2014-06-30 08:46:02 +02:00
Gregory Hainaut
2582649490 Merge branch 'gigaherz-master' 2014-06-28 11:26:33 +02:00
Gregory Hainaut
2084ead56c spu2x: linux port of Giga lastest update
=> Advanced (per-channel) Volume Adjustment AKA Room Correction

windows: update CfgReadFloat to really return a float
2014-06-28 11:23:44 +02:00
Gregory Hainaut
f2e50d4ffd Merge branch 'master' of git://github.com/gigaherz/pcsx2 into gigaherz-master 2014-06-28 11:00:19 +02:00
Leucos8
6faa7a060c Updated the it_IT translation files 2014-06-27 10:03:56 +02:00
Gregory Hainaut
f998b72e99 sigh I do the mistake every time 2014-06-20 18:55:25 +02:00
Gregory Hainaut
fe30f2e48e pcsx2: tlb fix
* pc is incremented before execution of the instruction => must be
    decremented before exception

* PS2 support 48 tlb => mask need 6 bits
2014-06-20 13:52:05 +02:00
Gregory Hainaut
9a82bed3a5 db: enable autogamefix of goemon + bump to ingame
Note: actually it could even be playable or perfect (let's dream)
2014-06-20 13:52:05 +02:00
Gregory Hainaut
a00b8ecc55 pcsx2: tlb: goemon implement a preload hack tlb
Tlb mapping is stored @0x3d5580 (GoemonTlb[150])
The function that will populate the tlb is around pc = 0x356250, ra = 0x33ad48

The idea is to add a callback on 0x33ad48 block that will populate the tlb based on
ee mem content.

Note: The hack is based on previous Virtual PS2 => Physical PS2 LUT
2014-06-20 13:52:05 +02:00
Gregory Hainaut
9452444a9f pcsx2: tlb: add a new lut (Virtual PS2 to Physical PS2)
note: automatic gamefixes are done after done after the init that why code was splitted.
note2: The LUT is 4MB and only used for only 1 game. So I only allocate it when the gamefix is
    enabled
2014-06-20 13:51:33 +02:00
Gregory Hainaut
2e8f56fc86 pcsx2: tlb: add a new gamefix hack for goemon 2014-06-20 13:17:59 +02:00
Gregory Hainaut
8148148932 Merge pull request #67 from nrusef/master
i10n: ja_JP
2014-06-20 10:25:39 +02:00
Sakura Naruse
e000eeaafb edit ja_JP 2014-06-15 12:35:23 +09:00
Gregory Hainaut
9ac9307b44 gsdx: try to protect more code when togging f9
deassert gsopen_done before delete the gs object. Compiler and CPU will
reordonate the store (or not because it is a global variable). Probably not
perfect but better.

Got a crash on GSKeyEvent which I guess wasn't thread safe. So let's ensure
gs is open.
2014-06-13 23:32:50 +02:00
Gregory Hainaut
cdba010794 zzogl: kill a couple of gcc warning 2014-06-13 23:04:21 +02:00
Gregory Hainaut
eb947dc325 pcsx2:gsdx: support of cross-platform (C11) aligned_malloc 2014-06-13 23:04:21 +02:00
Gregory Hainaut
9e22135f35 i10n: remove various extra % in ar
More C-String compliant
2014-06-13 23:04:20 +02:00
bositman
5c42ced8d3 Update GSCrc.cpp
Missed comma, thanks yxmline
2014-06-10 10:28:52 +03:00
bositman
b5e9a9d451 Merge pull request #62 from Blackbird88/patch-1
Corrected MGS3 comment, because OCD also new CRC
2014-06-10 01:34:26 +03:00
Blackbird88
cd3cfb27de Update GSCrc.cpp 2014-06-09 18:34:23 +02:00
Blackbird88
f7d35ff619 Corrected MGS3 comment, because OCD also new CRC
There is no such thing as MGS3 Substance only Subsistence. Substance is MGS2 :P
Also this new CRC is US Disc 2 of Subsistence. The blue stripes should be fixed now I guess.
2014-06-09 18:23:29 +02:00
refraction
81dd3b46c5 Modified behavior of the Delay VIF1 Stall hack to work with Spy Hunter. This is another one of those games which relies on a FIFO which we won't implement because it will just slow things down. 2014-06-06 22:29:33 +01:00
bositman
96d3b41989 Misspell fix for someone special at the forum :P 2014-06-06 09:53:24 +03:00
ramapcsx2
ff837a767b Merge pull request #60 from MrColdbird/master
Fixing DEV9 Adapter Detection
2014-06-05 16:25:40 +02:00
Coldbird
002dc80d48 Fixing DEV9 Adapter Detection 2014-06-05 12:33:43 +02:00
Gregory Hainaut
c64d7483db Merge pull request #57 from IlDucci/patch-2
i18n: (es/ES) Update pcsx2_Main.po
2014-06-05 08:10:28 +02:00
IlDucci
ef0f473199 Update pcsx2_Main.po
Updating translation.
2014-06-02 21:35:27 +02:00
refraction
fd8161c523 Removed a hack which broke Midnight Club in r3285 to fix Batman Begins. Doesn't seem to be needed anymore. 2014-05-29 00:11:04 +01:00
ramapcsx2
53e2824937 cdvdGigaherz: Some improvements to smooth out the "experience" when playing from CDs. A keepalive thread polls the drive every 30 seconds to prevent it from spinning down. When the plugin starts, it now tries to limit the spindle speed so it is less noisy and doesn't wear out as much (32x speed for CD games, 8x speed for DVD games).
Version bump to 0.9.
2014-05-26 14:28:56 +02:00
ramapcsx2
71ebb2493e Merge pull request #52 from Bigpet/master
Dev9 plugin - prevent null dereference if no device is set
2014-05-25 16:49:49 +02:00
Peter Tissen
ad9ec44228 prevent null dereference if no network device is selected in dev9 2014-05-24 22:12:26 +02:00
Gregory Hainaut
8775e51ebd Merge pull request #28 from Kingcom/Breakpoints
If a memcheck or breakpoint is triggered in a delay slot, stop on branch
2014-05-24 10:59:04 +02:00
Gregory Hainaut
f11877e72c Merge pull request #48 from nE0sIghT/master
Fix Cg find for Gentoo amd64
2014-05-20 09:03:00 +02:00
nE0sIghT
66785be691 Fix Cg find for Gentoo amd64 2014-05-18 22:51:09 +04:00
gigaherz
1fb3de2960 cdvdGigaherz: Change the order in which the different reading modes are attempted. Seems to fix some CD-Rom games. While at it, renamed a rude variable with a better name. ;P 2014-05-16 22:36:16 +02:00
gigaherz
654343f875 Advanced (per-channel) Volume Adjustment AKA Room Correction (Windows-only, need someone to fix the linux counterpart) 2014-05-11 17:26:00 +02:00
Gregory Hainaut
0bf7a35a53 pcsx2: improve the GS read fifo API
1/ initReadFifo will be first called on the GS thread
    (openGL can only be done on the GS thread)

2/ readFifo will be called on the EE thread. It is not safe too access eeMem from GS
 because of memory is virtual

Fix "recent" regression (crash) on Kingdom heart and others game too.

v2: add a len check on GSState::InitReadFIFO
2014-05-06 20:28:18 +02:00
Gregory Hainaut
3a46634f4a gcc: fix a couple of gcc warning (sign compare)
My gosh, they're like rabbit :p
2014-05-06 09:25:00 +02:00
Kingcom
67f7eaabc7 If a memcheck or breakpoint is triggered in a delay slot, stop on the branch 2014-05-05 23:50:37 +02:00
Avi Halachmi (:avih)
d28669761f gzip-iso: Speedup some cases by using more memory.
Significant speedup on some cases by using roughly another index size
in ram. The ram usage is now up to roughly cache size plus 2x index size.

This patch adds another index-like direct access point for each span we've
visited. This replaces the single z-state which was used for
sequential extraction, and does the same, but now it can continue
sequentially on most previously visited spans instead of only from
the last read.
2014-05-05 15:07:48 +03:00
Avi Halachmi (:avih)
8684596d66 gzip-iso: bugfix in zstate setup, cosmetic refactoring 2014-05-05 14:58:44 +03:00
Gregory Hainaut
460ee7f5de Merge branch 'Mirrors' of git://github.com/Kingcom/pcsx2 2014-05-05 09:39:35 +02:00
Gregory Hainaut
b7536ca94b zzogl: gcc warning fix
Let's hope variadic macro work on visual

cmake: reenable various warning. With previous fixes it just a matter of a couple of warnings
2014-05-03 10:37:58 +02:00
Gregory Hainaut
58077c63a7 gcc-warning: check c function return. Print error when bad.
v2: properly check return code of fread/getcwd function
2014-05-03 10:32:05 +02:00
Gregory Hainaut
22b65489e2 gcc warning: constify const string 2014-05-03 10:18:27 +02:00
Gregory Hainaut
2816188c83 zzogl: bad function declaration 2014-05-03 10:18:27 +02:00
Gregory Hainaut
4d78b6be31 pcsx2/plugin: sign compare mismatch extra 2014-05-03 10:18:27 +02:00
Gregory Hainaut
5087d13de8 gsdx: remove/comment unused variable 2014-05-03 10:18:27 +02:00
Gregory Hainaut
4d6d5c870c pcsx2: remove useless volatile
Volatile is only useful as argument not the returned value
2014-05-03 10:18:26 +02:00
Gregory Hainaut
dd8666036c pcsx2: sign compare mismatch 3/3 2014-05-03 10:18:26 +02:00
Gregory Hainaut
27a4bc5a39 pcsx2: sign compare mismatch 2/3 2014-05-03 10:18:26 +02:00
Gregory Hainaut
88f4d1e3a7 pcsx2: sign compare mismatch 1/3 2014-05-03 10:18:26 +02:00
Gregory Hainaut
c6d8b52d26 pcsx2: try to ensure better sync with FIFO read call
First wait will ensure correctness of GS register.
2nd wait will ensure that the GS fifo read call is finished

(If I understand MTGS correctly)
2014-05-01 16:43:12 +02:00
Avi Halachmi
14efa6fbda gzip-iso: update VS2010/2012 projects (2012 untested) 2014-04-30 13:21:08 +03:00
Avi Halachmi (:avih)
e859d3f3d1 gzip-iso: change zlib_indexed.c to .h 2014-04-29 23:33:28 +03:00
Avi Halachmi (:avih)
0f26be85b5 gzip-iso: fix compiler warning/error 2014-04-29 23:23:07 +03:00
Avi Halachmi (:avih)
49505ab93f gzip-iso: optimal small chunks sequential access 2014-04-29 11:26:35 +03:00
Avi Halachmi (:avih)
86a6fcddc0 gzip-iso: Better cache, more cpu for quicker extract 2014-04-29 02:41:30 +03:00
Gregory Hainaut
c92de149a2 pcsx2: quick linux fix of recent addition 2014-04-27 22:45:28 +02:00
Avi Halachmi (:avih)
36fe83afcc Gzip ISO: add cache (50 chunks of 4M) 2014-04-27 22:51:58 +03:00
Avi Halachmi (:avih)
5771e6eae8 Indexed gzipped ISO support (slow - no caching) 2014-04-27 19:58:20 +03:00
Avi Halachmi (:avih)
7d491cb230 Adding zlib example files 2014-04-27 01:33:37 +03:00
Gregory Hainaut
a86f2615be cmake: git compilation issue + useless warning message
* avoid compilation failure when git -C isn't supported
* don't print missing dependency when EXTRA_PLUGINS isn't activated
* sed /endif(.*)/endif/ because I don't like it
2014-04-17 20:42:56 +02:00
Gregory Hainaut
c37d9c10f7 cmake: git compilation issue + useless warning message
* avoid compilation failure when git -C isn't supported
* don't print missing dependency when EXTRA_PLUGINS isn't activated
* sed /endif(.*)/endif/ because I don't like it
2014-04-17 20:26:16 +02:00
avih
e39db3f9ad Merge pull request #30 from bositman/master
Added Metal Gear Solid 3 Subsistence Spanish
2014-04-17 13:59:51 +03:00
bositman
82f347403a Added Metal Gear Solid 3 Subsistence Spanish
to GSdx CRC hacks.
Refer here: http://forums.pcsx2.net/Thread-Metal-Gear-Solid-3-SLES-820-48-not-included-to-GSdx-fix
2014-04-17 13:53:06 +03:00
Avi Halachmi (:avih)
916d7502c8 Lilypad: Better focus/capture/uncapture handling.
1. After ALT-Tab to another window and back, now it accepts PCSX2
shortcuts properly (e.g. Esc or F6 etc) - focus changes were not
always recognized before.

2. If Lilypad is set to capture mouse, now it releases it on Escape. This
part is a small hack because the code looks as if it should handle it,
but in practice doesn't. This adds explicit uncapture on Escape.
2014-04-16 18:39:07 +03:00
Kingcom
42651c1500 Check mirrors in breakpoints and memchecks 2014-04-13 18:37:42 +02:00
Gregory Hainaut
da4a785fae debian: make create tarball script compatible with git 2014-04-13 10:48:37 +02:00
Gregory Hainaut
c2b78c6fdf license: again not yet perfect but much better
Remove old tsvn of zzogl
Add various header
add "is in public domain" for license in public domain so Debian's script catch it
2014-04-13 10:41:24 +02:00
Gregory Hainaut
c260decf58 gsdx: add bsd3 clause on gsdx xbyak files 2014-04-13 10:06:52 +02:00
Gregory Hainaut
17eb468f38 win build fix: set utf8-bom 2014-04-13 10:05:26 +02:00
Gregory Hainaut
75c64e12aa license: add missing header
Still miss lots of copyright header but we are better
2014-04-12 19:42:41 +02:00
Gregory Hainaut
ea25d12405 gsdx-gles: nvidia driver quick trial (only GLES3.0)
* Fix to create a 3.0 GLES context
* set a default precision to fix most of shader compilation issue
* Crash later because of GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
    => need to test opensource driver
2014-04-12 12:40:23 +02:00
Gregory Hainaut
ca8c5b041d cmake: drop sparsehash_new module
It was a workaround for a buggy version of the lib.
2014-04-12 10:25:40 +02:00
Gregory Hainaut
414ce3589a cmake: new option -DEXTRA_PLUGINS=TRUE|FALSE
--extra for ./build.sh script

By default only build the pricipal plugin: GSdx|zzogl/spu2-x/onepad/UsbNull/Dev9Null

Extra plugins are: GsNull|zzogl-cg/Spu2Null|zerospu/PadNull

The purpose is to improve compilation time on linux
2014-04-11 09:18:31 +02:00
Gregory Hainaut
37b1d3ae42 codeblock: remove build file => linux is cmake only
They are completely out-dated. And nobody have time to update them.
2014-04-11 09:18:31 +02:00
Gregory Hainaut
f984339404 pcsx2: reduce gamefix panel size
Move 2 sentences into the tooltip. Reduce both box and the useless empty space.

Unfortunately, translation would need to updated too.

Thanks Avih for the idea
2014-04-11 09:18:30 +02:00
Gregory Hainaut
86895cbf45 pcsx2 license: add missing nice header on various files
Remains 3 files that I don't know the source
pcsx2/windows/DwmSetup.cpp: *No copyright* UNKNOWN
pcsx2/windows/SamplProf.cpp: *No copyright* UNKNOWN
pcsx2/windows/VCprojects/IopSif.cpp: *No copyright* UNKNOWN

Remains 1 files in common that I don't know the source
common/include/comptr.h: *No copyright* UNKNOWN

Remains too much files in plugins that I don't know the source :(
2014-04-11 09:18:30 +02:00
Avi Halachmi (:avih)
18953e81bc Visual Studio re-Fix: and also build if git is available 2014-04-06 14:38:54 +03:00
Avi Halachmi (:avih)
bae75d234a Merge branch 'master' of https://github.com/PCSX2/pcsx2 2014-04-06 12:59:56 +03:00
Avi Halachmi (:avih)
2f634bddd3 Visual Studio Fix: build even if git is not available 2014-04-06 12:58:56 +03:00
Gregory Hainaut
187f0bea3b i18n: update all googlecode -> github stuff
Note: translation are still marked as fuzzy
2014-04-06 11:54:36 +02:00
Gregory Hainaut
605afeff74 cmake: enable -g for debug/dev build
otherwise it is a PITA on gdb
2014-04-06 11:43:40 +02:00
Gregory Hainaut
0d45e6d70e gsdx-ogl: avoid to send constant to the GPU
It was a waste of bandwith
2014-04-06 10:44:40 +02:00
gigaherz
4362cc0e9a Fixed a few references to Googlecode, and a few mentions of the "svn" word in comments.
Other instances of "svn" in filenames and such remain, but they are not high priority and I didn't want to mess with updating all the project systems.
Closes #19.
2014-04-05 18:38:41 +02:00
bositman
5af88a3e2b Merge pull request #17 from nrusef/master
Japanese translation improvement (further)
2014-04-01 16:17:56 +03:00
nrusef
9628700ced further improvement 2014-04-01 21:20:06 +09:00
Gregory Hainaut
32ed98a9a5 Merge pull request #15 from nrusef/jpn_translate
i18n: Japanese translation improvement

Note: mo not yet regenerated
2014-03-31 09:39:11 +02:00
nrusef
ea032b4b3e po format correction 2014-03-31 07:31:28 +09:00
nrusef
449192e565 Japanese translation fix 2014-03-31 04:31:00 +09:00
Roel Aaij
9d1840e37a Fix out of tree build.
Tell git to look in the source dir for the repository.
2014-03-30 16:59:29 +02:00
Roel Aaij
ec0f9e49c3 Fix segfault in non-dev build by adding extra check for NULL. 2014-03-30 16:59:28 +02:00
Gregory Hainaut
390245806a cmake: sed /PROJECT_SOURCE_DIR/CMAKE_SOURCE_DIR/
The former depends on the project command. Whereas the latter is the true absolute path
of the project
2014-03-30 16:36:02 +02:00
Gregory Hainaut
22e02b545e cmake: fatal error when path contains some parenthesis 2014-03-30 16:36:02 +02:00
Gregory Hainaut
b020bd76c6 gsdx-ogl: restore gles build
Add the --gles build option to the linux main script
Ifdef all gl code not supported on gles3 (note some will be reenabled for gles3.1)

Note: it probably doesn't run anymore. My Nvidia driver doesn't support
yet egl/gles so I can't test it. Feel free to contribute.
2014-03-29 11:55:02 +01:00
Gregory Hainaut
483b5a75e8 gsdx ogl: automatic setup of geometry shader
* disable it for gallium Mesa driver
* Re-enable it for Nvidia driver
2014-03-29 10:47:53 +01:00
Gregory Hainaut
70d1719b7d cmake: handle gracefully wxwidget 3.0-dev
1/ print a nice message
2/ replace 3.0 to 2.8 so it could still compile on system that both version
   are installed but wrongly configured
2014-03-26 11:37:49 +01:00
Gregory Hainaut
30ba964f9d fix visual studio compilation 2014-03-25 18:35:02 +01:00
gigaherz
3ef93addd0 It doesn't seem to be needed with vs, but those numbers are technically long longs. 2014-03-25 17:51:38 +01:00
Gregory Hainaut
0980591fa2 pcsx2 debugger: be more friendly with linux
* Fix a couple of gcc warning and replace deprecated function
* Fix the redraw of the memory zone
* Avoid a crash if we breakpoint before running
* Use %s on linux because %S isn't supported
* Properly check .result in recMemCheck. Add some code to print hit
  breakpoint.
* breakpoint window isn't properly resized so used a static size as a
  temporary workaround
2014-03-25 17:31:52 +01:00
Gregory Hainaut
e59b252cc0 ignore vim tmp file 2014-03-25 17:31:19 +01:00
Gregory Hainaut
4496093cf8 cmake version:
Use same version as window based on git
drop subversion code
use lld on onepad
2014-03-25 17:29:47 +01:00
Gregory Hainaut
8b78551b92 gsdx-ogl: improve debugging capabilities
allow to print memory transfer usage
Check gl call in dev build
2014-03-25 16:36:29 +01:00
Gregory Hainaut
bde2e3956d gsdx-ogl: automatic dectection of buffer_storage 2014-03-25 16:36:29 +01:00
Gregory Hainaut
c85ba4c259 gsdx ogl: add buffer_storage for vertex upload
A bit slower. Maybe because SubData does the copy in the driver thread. My memcpy is done on
the main thread. I'm not sure it would worth an extra thread to copy vertex data to the GPU

Note: testers are welcome. You need to edit the ini file.
"ogl_vertex_storage=1" <= enable the extension
"ogl_vertex_storage=0" <= disable the extension

Again you need the support of GL_arb_buffer_storage (i.e. not catalyst)
2014-03-25 16:36:29 +01:00
Gregory Hainaut
403518e852 gsdx-ogl: texture management
Improve arb_buffer_storage implementation
Try harder to align the texture buffer

Strangely arb_buffer_storage is 3 times slower on my PC (nvidia)

Tester are welcome! Open the ini file
"ogl_texture_storage = 1" <= enable the extension
"ogl_texture_storage = 0" <= disable the extension

Note: you need an opengl 4.4 driver or one that support arb_buffer_storage (i.e. not catalyst)
2014-03-25 16:36:29 +01:00
Gregory Hainaut
41091f8ebf gsdx ogl: remove multithread hack
This hack was used because GSReadFifo was called from the EE thread.
Previous commit move the call to the GSThread.

Hopefully avoid flushing the full GPU contex would improve openGL
performance (at least avoid some hiccups ;) )

Note: newer GSdx ogl won't be compatible with older PCSX2
2014-03-25 16:36:29 +01:00
Gregory Hainaut
f78c39cc98 pcsx2: call GSReadFIFO from GS thread (was EE) 2014-03-25 16:36:29 +01:00
Gregory Hainaut
39a9b7b721 local: refresh all language
* Mark "enable widescreen hack" as fuzzy in most translation
* update zh_TW/es_ES
2014-03-25 16:36:29 +01:00
Gregory Hainaut
9d2b6cb589 locale: remove garbage files 2014-03-25 16:36:28 +01:00
David Quintana
87c42c8c5d Merge pull request #7 from Kingcom/master
Fix VS2010 build
2014-03-25 16:18:52 +01:00
Kingcom
e31afb5885 Fix VS2010 build 2014-03-25 16:15:21 +01:00
David Quintana
2fbac107ca Merge pull request #5 from Kingcom/master
More debugger enhancements and fixes
2014-03-25 14:42:59 +01:00
David Quintana
a1239ee6a8 Update README.md 2014-03-25 14:19:30 +01:00
David Quintana
15ac8d9ffc Update README.md 2014-03-25 14:17:48 +01:00
David Quintana
f57be52061 Update README.md 2014-03-25 14:17:18 +01:00
David Quintana
f68918c5a9 Update README.md 2014-03-25 14:07:43 +01:00
David Quintana
1b481f1946 Update README.md 2014-03-25 14:02:45 +01:00
David Quintana
127c1ef8bf Create README.md 2014-03-25 13:53:36 +01:00
gigaherz
189c8701d7 Git ignore. 2014-03-25 13:31:56 +01:00
gigaherz
f7c1b6e060 Git-based versioning. 2014-03-25 13:31:36 +01:00
Kingcom
c25020765c Display memory view page when setting its position 2014-03-23 13:30:11 +01:00
Kingcom
10c3928eef Focus disassembly when a breakpoint triggered 2014-03-23 13:30:11 +01:00
Kingcom
100fe404a5 Load symbols from file 2014-03-23 13:30:10 +01:00
Kingcom
0ade0a44b5 Detect and skip padding nops at the end of functions 2014-03-23 13:30:10 +01:00
Kingcom
7a20d94536 Fix breakpoint window on Linux 2014-03-23 13:30:10 +01:00
Kingcom
4e2e178417 Add list to show, edit and delete breakpoints 2014-03-23 13:30:10 +01:00
Kingcom
aad9ea0e05 Memory breakpoints 2014-03-23 13:27:50 +01:00
Kingcom
074da1fedf Use CPU cycles to determine if we should skip a breakpoint after resuming 2014-03-23 13:27:50 +01:00
Kingcom
c8a760832b Change register value 2014-03-23 13:27:50 +01:00
Kingcom
b69dcb51a0 Always enable debugger in devbuilds, but keep function scanning restricted to the enable state 2014-03-23 13:27:50 +01:00
Kingcom
e55229db40 A hackish attempt at step into 2014-03-23 13:27:49 +01:00
Kingcom
d8abd04a8e Only capture F10, not all system keys 2014-03-23 13:27:49 +01:00
Kingcom
5935572458 Better valid ranges 2014-03-23 13:27:49 +01:00
Kingcom
807521f91b Add debugger config to ini, and put it to use 2014-03-23 13:27:49 +01:00
Kingcom
8ee14a8039 Address mask for breakpoints, always clear whole instruction cache (until there's a better solution) 2014-03-23 13:27:49 +01:00
Kingcom
8cd45189c3 Step over ERET 2014-03-23 13:27:48 +01:00
Kingcom
fbb0a77ce3 Allow re-opening the debugger after closing it 2014-03-23 13:27:48 +01:00
Kingcom
854574af66 Enable debugger in release builds. Let's see if it negatively affects anythi 2014-03-23 13:27:48 +01:00
Kingcom
1f7d6461c5 Help button/window in debugger (Windows only) 2014-03-23 13:27:48 +01:00
gregory.hainaut
30d5135fdd gsdx-ogl: sigh.. this one was hidden :p
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5932 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-23 08:25:54 +00:00
gregory.hainaut
192c5d2c4a gsdx-ogl: one more
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5931 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-22 22:00:46 +00:00
gregory.hainaut
6c87673e57 gsdx-ogl: forget a pointer
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5930 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-22 21:14:57 +00:00
gregory.hainaut
ba46b25e2f GSdx-ogl: GL4.1 program shader is optional
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5929 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-22 09:08:37 +00:00
gregory.hainaut
d044147698 linux: fix compilation issue with recent Mesa (gentoo)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5928 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-13 17:37:40 +00:00
ramapcsx2.code
689405732c VS2012 project file changes. Took a bit of trickery since I don't have 2012 installed but I hope it works.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5927 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-07 00:04:03 +00:00
ramapcsx2.code
bae54f312d VS2010 project file changes.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5926 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-06 23:44:56 +00:00
ramapcsx2.code
8fbe363f3c Gte.cpp fix for VS2013.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5925 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-06 23:34:23 +00:00
gregory.hainaut
141c5e60c5 mirror, mirror
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5924 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-06 23:32:56 +00:00
gregory.hainaut
9d41fe251b linux fix:
rename Gte.c into Gte.cpp need to be done on windows too
rename a duplicated function. Until we get a nice name for it.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5923 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-06 23:30:11 +00:00
ramapcsx2.code
6ccebbf7a8 These files go with last commit.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5922 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-06 23:16:50 +00:00
ramapcsx2.code
ef27358a82 Initial work on getting further with PSX mode. Because the PSX rules!
All work done by Refraction, I'm just the commit guy for this.

Note: Missing Visual Studio 2012 / 2010 project files and Linux makefile additions.
Note2: PSX games don't work yet :p

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5921 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-06 23:00:09 +00:00
refraction@gmail.com
fb13a502d2 Don't know how/why these changed in the DMA commit, but reverting to what it should be.
(seriously, i don't remember changing this!)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5920 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-03-05 10:11:28 +00:00
refraction
e6b363ef54 Path3 Masking: Lower the Intermediate mode threshold for smaller packets, fixes some small texture glitches on Path3 masking games such as Wallace & Gromit
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5919 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-28 21:38:04 +00:00
ramapcsx2.code
8fd3fd7259 These logs never helped solve issues and they tend to spam in some games. Removing them.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5918 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-28 01:36:44 +00:00
refraction
3f2f799248 DMA: Fix for FFXII in r5915. Apparently it tries to use an invalid DMA mode, so we shall assume they meant "chain" mode.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5917 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-27 22:22:28 +00:00
gigaherz@gmail.com
b460019846 [15:33] (Kingcom): it seems inline breaks gcc, as it can't extern a function declared with inline
[15:34] (Kingcom): other functions in other units use it, and get linker errors like this

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5916 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-27 14:41:44 +00:00
refraction
35b5e6a923 GIF:
-Implemented GIF_MODE Masking fixed the All Star Pro Wrestling series slowness/hanging.

DMA: 
-Standardize the IPU and SIF dma's to use the standard chain handling in hw.c, fixed up some DMA resuming stuff in the forementioned units, VIF, GIF and SPR.

-Added some warnings for DMA stall control which isn't implemented, hopefully somebody will find a game that does it so we can add/test it :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5915 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-26 22:34:02 +00:00
gregory.hainaut
e24f3585d4 pcsx2: fix window compilation + a couple of extra ;)
* Fix some issue with the new debugger on linux
* Enable the previous tlb miss fix on the interpreter
* disable the building of po by default. It pollute too much my env.



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5914 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-23 16:00:55 +00:00
gregory.hainaut
220f55d760 linux compilation fix:
* use c++11 for pcsx2
* rename __rdtsc so I won't conflict with gnu version
* add a bunch of .data() method to get string data



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5913 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-23 09:57:01 +00:00
ramapcsx2.code
c374343ae9 GSdx:
Crashfix for a weird GIF_FLG_IMAGE2 situation in Wallace and Gromit Project Zoo. Needs further investigation.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5912 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-22 20:04:32 +00:00
gregory.hainaut
ca3035fe07 pcsx2: on going work to better support tlb miss
Currenty code isn't activated because it will crash any game that do a tlb miss (with the recompiler)

However if you activate the code with the interpreter, the exception will be fired and new tlb setting
will be loaded => got nice picture with "Bouken Jidai Katsugeki"



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5911 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-22 16:23:31 +00:00
gregory.hainaut
5af621056a gsdx ogl: new option for free driver
reduce_gl_requirement_for_free_driver => set it to 1 to only required a 3.0 context (you still required the good extensions)



git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5910 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-22 16:12:42 +00:00
ramapcsx2.code
44d43495a7 Kingcom fixed a small annoyance where the savestate hotkeys would defocus the GS window, causing them to not work after one use.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5909 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-22 14:54:37 +00:00
ramapcsx2.code
8a92ad1434 Added insane EE cycle rate multipliers because they get requested so much.
Requires editing the pcsx2_vm.ini directly. Set EECycleRate = whatever (between 3 and 99). 

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5908 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-22 14:04:41 +00:00
gigaherz
182d51eb34 Really, svn? those files clearly were in the patch I gave you, you created them on disk, how did you forget to add them to the commit?!
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5907 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-21 14:43:13 +00:00
gigaherz
22dc1e7f86 Missed these files while juggling with git<->svn
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5906 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-21 14:38:10 +00:00
gigaherz
babd8868d9 Initial debugger work by Kingcom. Features:
- Advanced disassembly view for R5900 and R3000
  - Register list with change highlight
  - Editable memory view
  - Conditional execute breakpoints (r5900 only)
  - Step over
  - Scan for functions (incomplete), show macros
  - Enable C++11 for debug tools.
  - Expression parser
  - Disasm updates for thread safety
Squashed from: https://github.com/PCSX2/pcsx2/pull/1
Thanks to Kingcom for coding it all and mziab for Linux patches


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5905 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-21 14:29:13 +00:00
refraction
038d3bea87 If you're gonna do a revert, you might as well do it properly :P If you don't want it doing properly, give it to me.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5904 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-16 16:21:08 +00:00
refraction
f3399ead26 Vsync: Put it back to half slices, there seems to be games which don't like the vsync timing more accurate either way. Until i can work out why we will go back to the old half n half timing which all known games seem happy with.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5903 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-16 16:07:14 +00:00
gigaherz
888f0a27da Remove vs2008 project files, since they have become outdated, and complicated to maintain.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5902 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-15 18:24:06 +00:00
refraction
c979181bd7 Counters/Vsync: Adjusted VSync according to an older test we had. Fixes Legendz Gekitou! Saga Battle. Also adjusted the number of scanlines depending on if the game is using interlacing or not.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5900 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-13 22:16:21 +00:00
ramapcsx2.code
916537b0f8 These might be needed, dunno.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5899 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-12 12:52:03 +00:00
ramapcsx2.code
65152066ca Just a bit of GSdx debugging.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5898 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-11 21:47:43 +00:00
Asmodean.pcsx2
0651e45460 GSdx: Just some cleaning.
Reformatted fx files that were causing issues on certain text editors. They should now display correctly in those editors.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5897 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-11 04:27:32 +00:00
Asmodean.pcsx2
7d96af950e GSdx: A few small post-processing changes, to accommodate future updates.
Also removed the fallback recovery ps, and replaced the compile fail catch to a simple console print. Which I think is safer, and faster.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5894 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-09 01:01:41 +00:00
refraction
82d5194a4f SPU2-X: Just fixing up a small error i came across while looking into something else. Nothing to see here.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5893 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-08 17:52:33 +00:00
refraction
9d479ab64b GameGB: Syphon Filter - Omega Strain Europe patch for Flashlight. Removed an incorrect/pointless patch on the US version.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5892 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-08 12:38:08 +00:00
gregory.hainaut
1922598f0f the "don't let users shoot themself in the foot" commit
UserHacks_AlphaStencil will take precedence on override_GL_ARB_shader_image_load_store


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5891 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-08 11:22:51 +00:00
gregory.hainaut
3d7b86660a gsdx ogl: Enable by default advance DATE effect on nvidia (GL4 GPU)
Note: DATE is used for shadows (persona 3) and others effect

You can disable it when you disable gl image extension (override_GL_ARB_shader_image_load_store = 0)
You can also enable it on AMD too (set it to 1 this time) but no guarantee.

If you feel the extension is too slow, you can try disable some gl barrier (aka "damn the torpedo full steam ahead!").
It can be done with the option UserHacks_DateGL4 = 1. Otherwise just disable the extension.

Note: don't enable UserHacks_AlphaStencil in the same time. GL_ARB_shader_image_load_store is an alternative implementation.
Enabling both in the same time will lead to undefined (well surely wrong) behavior.




git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5890 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-08 11:05:26 +00:00
refraction
907964a7d1 Langs: Change the Arabic name properly, update relevant files (thanks for the heads up Gregory :) )
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5889 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-07 20:34:36 +00:00
gregory.hainaut
384c0c12ea gsdx ogl:
* properly detect gl nv depth extension
* Always show the hack on the gui. Add a new hack option for DATE (gl4.2) only
* Save the scan mode on linux too (f7)
* hopefully fix some crash on some drivers... (ensure aligment 256 bits alignment, and if not use std memcpy)


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5888 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-07 19:53:01 +00:00
ramapcsx2.code
749568f290 It might be a good idea to notify the emulator that the disc changed on a disc swap.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5886 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-07 10:02:53 +00:00
refraction
0403bd8c3c rename Arabic folder, one user suggested it fixed some problem causing PCSX2 to boot. Makes it more uniform so it can't hurt i guess.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5885 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-06 21:57:36 +00:00
refraction
eafadaf15a GSDX: Fix up the GUI that displays during the First Run Wizard
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5884 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-05 22:42:02 +00:00
Asmodean.pcsx2
ea06e2e403 GSdx: Dialog label fix.
Extra rendering threads label text was getting cut off early.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5882 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-05 00:23:02 +00:00
Asmodean.pcsx2
11a15ca58a GSdx: Just tidying up a few last things, to wrap up the AF changes.
Also disabled the gsdx AF options for the OGL renderer (because it's not implemented for that yet). 

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5881 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-04 21:42:43 +00:00
avihal@gmail.com
93cb647091 Games db: normalize (4 missing games name, few places where compat appeared after the hacks section, removed 2 almost duplicate entries (-T at the serial).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5880 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-04 01:43:50 +00:00
Asmodean.pcsx2
42b879e6b8 GSdx: Anisotropic Filtering.
Fixes a small oversight on my part. Which was setting the maximum anisotropy to (0,1,2,3,4) respectively, instead of (1,2,4,8,16). So when you selected x16 for example, you were actually only getting x4 >.>

Corrected now, and you will be getting the full x16 when selected :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5879 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-03 20:06:00 +00:00
Asmodean.pcsx2
b8f8459275 GSdx: Anisotropic Filtering.
Adds anisotropic texture filtering (1x-16x) to the hardware settings. Enhances the visual quality of textures that are at oblique viewing angles.

Anisotropic filtering is automatically disabled if: 8-bit textures are enabled.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5878 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-03 16:58:11 +00:00
refraction
3bc5779f68 GSDX: Just correcting some typo's
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5875 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-02 22:46:06 +00:00
Asmodean.pcsx2
644f0e61ba GSdx: Store the user selected F7 shader to the ini, as TVShader.
As before: use the hotkey(f7) to switch between them. It will now save the chosen scanline effect, instead of always defaulting to disabled, on load.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5874 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-02 20:40:28 +00:00
refraction
5a8f01edf4 VIF MFIFO: Missed the MFIFO when i did my VIF change in r5843 which would have stopped some games working.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5873 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-02 20:19:54 +00:00
Asmodean.pcsx2
02afca3bb6 GSdx: Just some small post processing cleanup changes, should lower the FXAA compiling time on pause/resumes.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5872 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-02 17:50:32 +00:00
ramapcsx2.code
1fb3d7dd17 Regular version numbering for SVN again. We're at 1.3 now :)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5870 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-02 13:56:09 +00:00
4680 changed files with 765540 additions and 723450 deletions

8
.gitattributes vendored Normal file
View File

@@ -0,0 +1,8 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
*.props text eol=crlf
*.vcxproj text eol=crlf
*.vcxproj.filters text eol=crlf

112
.gitignore vendored Normal file
View File

@@ -0,0 +1,112 @@
.*.swp
.*.swn
.*.swo
*.suo
*.ncb
*.sdf
*.opensdf
*.user
*.log
*.dsp
*.dsw
*.bsc
*.aps
*.exe
*.trace
*.dump
*.asm
!/pcsx2/IPU/yuv2rgb.asm
!/pcsx2/x86/ix86-32/aVif_proc-32.asm
!/plugins/CDVDpeops/i386.asm
!/plugins/zerogs/dx/x86-32.asm
!/plugins/zerogs/dx/x86-64.asm
!/plugins/zerogs/opengl/x86-32.asm
!/plugins/zzogl-pg/opengl/x86-32.asm
**/Win32/Release*
**/Win32/Debug*
**/Win32/Devel*
**/x64/Release*
**/x64/Debug*
**/x64/Devel*
_ReSharper.*
pcsx2.snapshot_*
svnrev.h
/build
/obj-*
.DS_Store
Thumbs.db
Debug.txt
install_log.txt
Debug
Release
Devel
oprofile_data/
# Visual Studio upgrades
/Backup*
/UpgradeLog*.htm
/bin/**/*.dll
/bin/**/*.exp
/bin/**/*.ilk
/bin/**/*.lib
/bin/**/*.pdb
/bin/PCSX2
/bin/*ReplayLoader
/bin/bios
/bin/dumps
/bin/help
/bin/inis
/bin/logs
/bin/memcards
/bin/plugins
/bin/snaps
/bin/sstates
/deps
/ipch
/nsis/output/
!/3rdparty/libjpeg/change.log
/3rdparty/portaudio/portaudio-2.0.pc
/3rdparty/portaudio/bin
/3rdparty/portaudio/bin-*
/3rdparty/portaudio/autom4te.cache
/3rdparty/portaudio/libtool
/3rdparty/portaudio/config.*
/3rdparty/portaudio/lib-stamp
/3rdparty/portaudio/Makefile
/3rdparty/portaudio/bindings
/3rdparty/portaudio/test
/3rdparty/portaudio/testcvs
/3rdparty/portaudio/src/hostapi/asio/ASIOSDK/common
/3rdparty/portaudio/src/hostapi/asio/ASIOSDK/host
/3rdparty/portaudio/src/hostapi/wasapi/mingw-include
/3rdparty/**/include/wx/setup.h
/3rdparty/**/wx/msw/rcdefs.h
/nsis/svnrev_cdvdiso.nsh
/nsis/svnrev_gsdx.nsh
/nsis/svnrev_lilypad.nsh
/nsis/svnrev_pcsx2.nsh
/nsis/svnrev_spu2x.nsh
/nsis/svnrev_zerogs.nsh
/nsis/svnrev_zerospu2.nsh
/pcsx2/gui/Resources/*.h
!/pcsx2/gui/Resources/EmbeddedImage.h
/plugins/CDVDolio/Template
/plugins/GSdx/Template
/plugins/USBqemu/Win32/bin
/plugins/xpad/Template
/plugins/zerospu2/Windows/dsound51.cpp
/tools/bin
/tools/GSDumpGUI/bin
/tools/GSDumpGUI/obj

23
.travis.yml Normal file
View File

@@ -0,0 +1,23 @@
language: cpp
sudo: required
dist: trusty
matrix:
include:
# Version 5 seems to be whatever is latest - for now it's 5.2
- env: VERSION=5
compiler: gcc
os: linux
- env: VERSION=4.9
compiler: gcc
os: linux
- env: VERSION=3.7
compiler: clang
os: linux
before_install:
- ./travis.sh before_install
script:
- ./travis.sh script

View File

@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
<OutDir>$(SvnRootDir)\deps\$(PlatformName)\$(Configuration)\</OutDir>
<IntDir>$(PlatformName)\$(Configuration)\</IntDir>
<ExtensionsToDeleteOnClean>*.bsc;*.idb;*.sbr;*.res;*.pch;*.pdb;*.obj;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath);$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>__WIN32__;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StructMemberAlignment>16Bytes</StructMemberAlignment>
<FunctionLevelLinking>true</FunctionLevelLinking>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
</ItemDefinitionGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
<OutDir>$(SvnRootDir)\deps\$(PlatformName)\$(Configuration)\</OutDir>
<IntDir>$(PlatformName)\$(Configuration)\</IntDir>
<ExtensionsToDeleteOnClean>*.bsc;*.idb;*.sbr;*.res;*.pch;*.pdb;*.obj;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath);$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>__WIN32__;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StructMemberAlignment>16Bytes</StructMemberAlignment>
<FunctionLevelLinking>true</FunctionLevelLinking>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="windows-1250"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="3rdparty"
OutputDirectory="$(SvnRootDir)\deps\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
DeleteExtensionsOnClean="*.bsc;*.idb;*.sbr;*.res;*.pch;*.pdb;*.obj;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;$(TargetPath)"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;"
PreprocessorDefinitions="__WIN32__;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
StructMemberAlignment="5"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="false"
WarningLevel="3"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="2"
/>
</VisualStudioPropertySheet>

View File

@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
<OutDir>$(SvnRootDir)\deps\$(PlatformName)\$(Configuration)\</OutDir>
<IntDir>$(PlatformName)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>__WIN32__;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StructMemberAlignment>16Bytes</StructMemberAlignment>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>$(SvnRootDir)/common/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
<OutDir>$(SvnRootDir)\deps\$(PlatformName)\$(Configuration)\</OutDir>
<IntDir>$(PlatformName)\$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>__WIN32__;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StructMemberAlignment>16Bytes</StructMemberAlignment>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>$(SvnRootDir)/common/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
</Project>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="windows-1250"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="3rdpartyDLL"
OutputDirectory="$(SvnRootDir)\deps\$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;"
PreprocessorDefinitions="__WIN32__;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
StructMemberAlignment="5"
RuntimeTypeInfo="false"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(SolutionDir)\bin\$(ProjectName).dll"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
ImportLibrary="$(OutDir)\$(ProjectName).lib"
/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="&quot;$(SvnRootDir)/common/include&quot;"
/>
</VisualStudioPropertySheet>

View File

@@ -1,8 +0,0 @@
# Check that people use the good file
if(NOT TOP_CMAKE_WAS_SOURCED)
message(FATAL_ERROR "
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
endif(NOT TOP_CMAKE_WAS_SOURCED)
### 3rd party was dropped

View File

@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="UserMacros">
<ProjectRootDir>$(ProjectDir)</ProjectRootDir>
<SvnRootDir>$(ProjectRootDir)\..\..</SvnRootDir>
</PropertyGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
</PropertyGroup>
<ItemGroup>
<BuildMacro Include="ProjectRootDir">
<Value>$(ProjectRootDir)</Value>
</BuildMacro>
<BuildMacro Include="SvnRootDir">
<Value>$(SvnRootDir)</Value>
</BuildMacro>
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="UserMacros">
<ProjectRootDir>$(ProjectDir)</ProjectRootDir>
<SvnRootDir>$(ProjectRootDir)\..\..</SvnRootDir>
</PropertyGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
</PropertyGroup>
<ItemGroup>
<BuildMacro Include="ProjectRootDir">
<Value>$(ProjectRootDir)</Value>
</BuildMacro>
<BuildMacro Include="SvnRootDir">
<Value>$(SvnRootDir)</Value>
</BuildMacro>
</ItemGroup>
</Project>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="DefaultProjectRootDir"
>
<UserMacro
Name="ProjectRootDir"
Value="$(ProjectDir)"
/>
<UserMacro
Name="SvnRootDir"
Value="$(ProjectRootDir)\..\.."
/>
</VisualStudioPropertySheet>

14435
3rdparty/GL/glew.h vendored

File diff suppressed because it is too large Load Diff

2173
3rdparty/GL/glext.h vendored

File diff suppressed because it is too large Load Diff

1476
3rdparty/GL/glxew.h vendored

File diff suppressed because it is too large Load Diff

1247
3rdparty/GL/wglew.h vendored

File diff suppressed because it is too large Load Diff

1321
3rdparty/GL/wglext.h vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,349 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
///
/// Win32 version of the AMD 3DNow! optimized routines for AMD K6-2/Athlon
/// processors. All 3DNow! optimized functions have been gathered into this
/// single source code file, regardless to their class or original source code
/// file, in order to ease porting the library to other compiler and processor
/// platforms.
///
/// By the way; the performance gain depends heavily on the CPU generation: On
/// K6-2 these routines provided speed-up of even 2.4 times, while on Athlon the
/// difference to the original routines stayed at unremarkable 8%! Such a small
/// improvement on Athlon is due to 3DNow can perform only two operations in
/// parallel, and obviously also the Athlon FPU is doing a very good job with
/// the standard C floating point routines! Here these routines are anyway,
/// although it might not be worth the effort to convert these to GCC platform,
/// for Athlon CPU at least. The situation is different regarding the SSE
/// optimizations though, thanks to the four parallel operations of SSE that
/// already make a difference.
///
/// This file is to be compiled in Windows platform with Microsoft Visual C++
/// Compiler. Please see '3dnow_gcc.cpp' for the gcc compiler version for all
/// GNU platforms (if file supplied).
///
/// NOTICE: If using Visual Studio 6.0, you'll need to install the "Visual C++
/// 6.0 processor pack" update to support 3DNow! instruction set. The update is
/// available for download at Microsoft Developers Network, see here:
/// http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx
///
/// If the above URL is expired or removed, go to "http://msdn.microsoft.com" and
/// perform a search with keywords "processor pack".
///
/// Author : Copyright (c) Olli Parviainen
/// Author e-mail : oparviai 'at' iki.fi
/// SoundTouch WWW: http://www.surina.net/soundtouch
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $
// File revision : $Revision: 4 $
//
// $Id: 3dnow_win.cpp 63 2009-02-21 16:00:14Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
// License :
//
// SoundTouch audio processing library
// Copyright (c) Olli Parviainen
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////////////
#include "cpu_detect.h"
#include "STTypes.h"
#ifndef WIN32
#error "wrong platform - this source code file is exclusively for Win32 platform"
#endif
using namespace soundtouch;
#ifdef ALLOW_3DNOW
// 3DNow! routines available only with float sample type
//////////////////////////////////////////////////////////////////////////////
//
// implementation of 3DNow! optimized functions of class 'TDStretch3DNow'
//
//////////////////////////////////////////////////////////////////////////////
#include "TDStretch.h"
// Calculates cross correlation of two buffers
double TDStretch3DNow::calcCrossCorrStereo(const float *pV1, const float *pV2) const
{
int overlapLengthLocal = overlapLength;
float corr = 0;
// Calculates the cross-correlation value between 'pV1' and 'pV2' vectors
/*
c-pseudocode:
corr = 0;
for (i = 0; i < overlapLength / 4; i ++)
{
corr += pV1[0] * pV2[0];
pV1[1] * pV2[1];
pV1[2] * pV2[2];
pV1[3] * pV2[3];
pV1[4] * pV2[4];
pV1[5] * pV2[5];
pV1[6] * pV2[6];
pV1[7] * pV2[7];
pV1 += 8;
pV2 += 8;
}
*/
_asm
{
// give prefetch hints to CPU of what data are to be needed soonish.
// give more aggressive hints on pV1 as that changes more between different calls
// while pV2 stays the same.
prefetch [pV1]
prefetch [pV2]
prefetch [pV1 + 32]
mov eax, dword ptr pV2
mov ebx, dword ptr pV1
pxor mm0, mm0
mov ecx, overlapLengthLocal
shr ecx, 2 // div by four
loop1:
movq mm1, [eax]
prefetch [eax + 32] // give a prefetch hint to CPU what data are to be needed soonish
pfmul mm1, [ebx]
prefetch [ebx + 64] // give a prefetch hint to CPU what data are to be needed soonish
movq mm2, [eax + 8]
pfadd mm0, mm1
pfmul mm2, [ebx + 8]
movq mm3, [eax + 16]
pfadd mm0, mm2
pfmul mm3, [ebx + 16]
movq mm4, [eax + 24]
pfadd mm0, mm3
pfmul mm4, [ebx + 24]
add eax, 32
pfadd mm0, mm4
add ebx, 32
dec ecx
jnz loop1
// add halfs of mm0 together and return the result.
// note: mm1 is used as a dummy parameter only, we actually don't care about it's value
pfacc mm0, mm1
movd corr, mm0
femms
}
return corr;
}
//////////////////////////////////////////////////////////////////////////////
//
// implementation of 3DNow! optimized functions of class 'FIRFilter'
//
//////////////////////////////////////////////////////////////////////////////
#include "FIRFilter.h"
FIRFilter3DNow::FIRFilter3DNow() : FIRFilter()
{
filterCoeffsUnalign = NULL;
filterCoeffsAlign = NULL;
}
FIRFilter3DNow::~FIRFilter3DNow()
{
delete[] filterCoeffsUnalign;
filterCoeffsUnalign = NULL;
filterCoeffsAlign = NULL;
}
// (overloaded) Calculates filter coefficients for 3DNow! routine
void FIRFilter3DNow::setCoefficients(const float *coeffs, uint newLength, uint uResultDivFactor)
{
uint i;
float fDivider;
FIRFilter::setCoefficients(coeffs, newLength, uResultDivFactor);
// Scale the filter coefficients so that it won't be necessary to scale the filtering result
// also rearrange coefficients suitably for 3DNow!
// Ensure that filter coeffs array is aligned to 16-byte boundary
delete[] filterCoeffsUnalign;
filterCoeffsUnalign = new float[2 * newLength + 4];
filterCoeffsAlign = (float *)(((uint)filterCoeffsUnalign + 15) & (uint)-16);
fDivider = (float)resultDivider;
// rearrange the filter coefficients for mmx routines
for (i = 0; i < newLength; i ++)
{
filterCoeffsAlign[2 * i + 0] =
filterCoeffsAlign[2 * i + 1] = coeffs[i + 0] / fDivider;
}
}
// 3DNow!-optimized version of the filter routine for stereo sound
uint FIRFilter3DNow::evaluateFilterStereo(float *dest, const float *src, uint numSamples) const
{
float *filterCoeffsLocal = filterCoeffsAlign;
uint count = (numSamples - length) & (uint)-2;
uint lengthLocal = length / 4;
assert(length != 0);
assert(count % 2 == 0);
/* original code:
double suml1, suml2;
double sumr1, sumr2;
uint i, j;
for (j = 0; j < count; j += 2)
{
const float *ptr;
suml1 = sumr1 = 0.0;
suml2 = sumr2 = 0.0;
ptr = src;
filterCoeffsLocal = filterCoeffs;
for (i = 0; i < lengthLocal; i ++)
{
// unroll loop for efficiency.
suml1 += ptr[0] * filterCoeffsLocal[0] +
ptr[2] * filterCoeffsLocal[2] +
ptr[4] * filterCoeffsLocal[4] +
ptr[6] * filterCoeffsLocal[6];
sumr1 += ptr[1] * filterCoeffsLocal[1] +
ptr[3] * filterCoeffsLocal[3] +
ptr[5] * filterCoeffsLocal[5] +
ptr[7] * filterCoeffsLocal[7];
suml2 += ptr[8] * filterCoeffsLocal[0] +
ptr[10] * filterCoeffsLocal[2] +
ptr[12] * filterCoeffsLocal[4] +
ptr[14] * filterCoeffsLocal[6];
sumr2 += ptr[9] * filterCoeffsLocal[1] +
ptr[11] * filterCoeffsLocal[3] +
ptr[13] * filterCoeffsLocal[5] +
ptr[15] * filterCoeffsLocal[7];
ptr += 16;
filterCoeffsLocal += 8;
}
dest[0] = (float)suml1;
dest[1] = (float)sumr1;
dest[2] = (float)suml2;
dest[3] = (float)sumr2;
src += 4;
dest += 4;
}
*/
_asm
{
mov eax, dword ptr dest
mov ebx, dword ptr src
mov edx, count
shr edx, 1
loop1:
// "outer loop" : during each round 2*2 output samples are calculated
prefetch [ebx] // give a prefetch hint to CPU what data are to be needed soonish
prefetch [filterCoeffsLocal] // give a prefetch hint to CPU what data are to be needed soonish
mov esi, ebx
mov edi, filterCoeffsLocal
pxor mm0, mm0
pxor mm1, mm1
mov ecx, lengthLocal
loop2:
// "inner loop" : during each round four FIR filter taps are evaluated for 2*2 output samples
movq mm2, [edi]
movq mm3, mm2
prefetch [edi + 32] // give a prefetch hint to CPU what data are to be needed soonish
pfmul mm2, [esi]
prefetch [esi + 32] // give a prefetch hint to CPU what data are to be needed soonish
pfmul mm3, [esi + 8]
movq mm4, [edi + 8]
movq mm5, mm4
pfadd mm0, mm2
pfmul mm4, [esi + 8]
pfadd mm1, mm3
pfmul mm5, [esi + 16]
movq mm2, [edi + 16]
movq mm6, mm2
pfadd mm0, mm4
pfmul mm2, [esi + 16]
pfadd mm1, mm5
pfmul mm6, [esi + 24]
movq mm3, [edi + 24]
movq mm7, mm3
pfadd mm0, mm2
pfmul mm3, [esi + 24]
pfadd mm1, mm6
pfmul mm7, [esi + 32]
add esi, 32
pfadd mm0, mm3
add edi, 32
pfadd mm1, mm7
dec ecx
jnz loop2
movq [eax], mm0
add ebx, 16
movq [eax + 8], mm1
add eax, 16
dec edx
jnz loop1
femms
}
return count;
}
#endif // ALLOW_3DNOW

View File

@@ -1,184 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
///
/// FIR low-pass (anti-alias) filter with filter coefficient design routine and
/// MMX optimization.
///
/// Anti-alias filter is used to prevent folding of high frequencies when
/// transposing the sample rate with interpolation.
///
/// Author : Copyright (c) Olli Parviainen
/// Author e-mail : oparviai 'at' iki.fi
/// SoundTouch WWW: http://www.surina.net/soundtouch
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2009-01-11 09:34:24 -0200 (dom, 11 jan 2009) $
// File revision : $Revision: 4 $
//
// $Id: AAFilter.cpp 45 2009-01-11 11:34:24Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
// License :
//
// SoundTouch audio processing library
// Copyright (c) Olli Parviainen
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////////////
#include <memory.h>
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include "AAFilter.h"
#include "FIRFilter.h"
using namespace soundtouch;
#define PI 3.141592655357989
#define TWOPI (2 * PI)
/*****************************************************************************
*
* Implementation of the class 'AAFilter'
*
*****************************************************************************/
AAFilter::AAFilter(uint len)
{
pFIR = FIRFilter::newInstance();
cutoffFreq = 0.5;
setLength(len);
}
AAFilter::~AAFilter()
{
delete pFIR;
}
// Sets new anti-alias filter cut-off edge frequency, scaled to
// sampling frequency (nyquist frequency = 0.5).
// The filter will cut frequencies higher than the given frequency.
void AAFilter::setCutoffFreq(double newCutoffFreq)
{
cutoffFreq = newCutoffFreq;
calculateCoeffs();
}
// Sets number of FIR filter taps
void AAFilter::setLength(uint newLength)
{
length = newLength;
calculateCoeffs();
}
// Calculates coefficients for a low-pass FIR filter using Hamming window
void AAFilter::calculateCoeffs()
{
uint i;
double cntTemp, temp, tempCoeff,h, w;
double fc2, wc;
double scaleCoeff, sum;
double *work;
SAMPLETYPE *coeffs;
assert(length >= 2);
assert(length % 4 == 0);
assert(cutoffFreq >= 0);
assert(cutoffFreq <= 0.5);
work = new double[length];
coeffs = new SAMPLETYPE[length];
fc2 = 2.0 * cutoffFreq;
wc = PI * fc2;
tempCoeff = TWOPI / (double)length;
sum = 0;
for (i = 0; i < length; i ++)
{
cntTemp = (double)i - (double)(length / 2);
temp = cntTemp * wc;
if (temp != 0)
{
h = fc2 * sin(temp) / temp; // sinc function
}
else
{
h = 1.0;
}
w = 0.54 + 0.46 * cos(tempCoeff * cntTemp); // hamming window
temp = w * h;
work[i] = temp;
// calc net sum of coefficients
sum += temp;
}
// ensure the sum of coefficients is larger than zero
assert(sum > 0);
// ensure we've really designed a lowpass filter...
assert(work[length/2] > 0);
assert(work[length/2 + 1] > -1e-6);
assert(work[length/2 - 1] > -1e-6);
// Calculate a scaling coefficient in such a way that the result can be
// divided by 16384
scaleCoeff = 16384.0f / sum;
for (i = 0; i < length; i ++)
{
// scale & round to nearest integer
temp = work[i] * scaleCoeff;
temp += (temp >= 0) ? 0.5 : -0.5;
// ensure no overfloods
assert(temp >= -32768 && temp <= 32767);
coeffs[i] = (SAMPLETYPE)temp;
}
// Set coefficients. Use divide factor 14 => divide result by 2^14 = 16384
pFIR->setCoefficients(coeffs, length, 14);
delete[] work;
delete[] coeffs;
}
// Applies the filter to the given sequence of samples.
// Note : The amount of outputted samples is by value of 'filter length'
// smaller than the amount of input samples.
uint AAFilter::evaluate(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels) const
{
return pFIR->evaluate(dest, src, numSamples, numChannels);
}
uint AAFilter::getLength() const
{
return pFIR->getLength();
}

View File

@@ -1,67 +0,0 @@
# SoundTouch library
# library name
set(Output pcsx2_SoundTouch)
set(CommonFlags
-march=athlon-xp
-march=prescott
)
set(OptimizationFlags
-Os
-W
)
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines
add_definitions(${CommonFlags} -g)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags})
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags})
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# variable with all sources of this library
set(SoundTouchSources
AAFilter.cpp
FIFOSampleBuffer.cpp
FIRFilter.cpp
RateTransposer.cpp
SoundTouch.cpp
TDStretch.cpp
# WavFile.cpp # directly include in spu2x
cpu_detect_x86_gcc.cpp
mmx_optimized.cpp
sse_optimized.cpp)
# variable with all headers of this library
set(SoundTouchHeaders
AAFilter.h
BPMDetect.h
FIFOSampleBuffer.h
FIFOSamplePipe.h
FIRFilter.h
RateTransposer.h
STTypes.h
SoundTouch.h
TDStretch.h
# WavFile.h # directly include in spu2x
cpu_detect.h)
# add library
add_library(${Output} STATIC ${SoundTouchSources} ${SoundTouchHeaders})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@@ -1,71 +0,0 @@
## Process this file with automake to create Makefile.in
##
## $Id: Makefile.am 138 2012-04-01 20:00:09Z oparviai $
##
## This file is part of SoundTouch, an audio processing library for pitch/time adjustments
##
## SoundTouch is free software; you can redistribute it and/or modify it under the
## terms of the GNU General Public License as published by the Free Software
## Foundation; either version 2 of the License, or (at your option) any later
## version.
##
## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
## A PARTICULAR PURPOSE. See the GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along with
## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
## Place - Suite 330, Boston, MA 02111-1307, USA
include $(top_srcdir)/config/am_include.mk
# set to something if you want other stuff to be included in the distribution tarball
EXTRA_DIST=SoundTouch.dsp SoundTouch.dsw SoundTouch.sln SoundTouch.vcproj
noinst_HEADERS=AAFilter.h cpu_detect.h cpu_detect_x86.cpp FIRFilter.h RateTransposer.h TDStretch.h PeakFinder.h
lib_LTLIBRARIES=libSoundTouch.la
#
libSoundTouch_la_SOURCES=AAFilter.cpp FIRFilter.cpp FIFOSampleBuffer.cpp RateTransposer.cpp SoundTouch.cpp TDStretch.cpp cpu_detect_x86.cpp BPMDetect.cpp PeakFinder.cpp
# Compiler flags
AM_CXXFLAGS=-O3 -fcheck-new -I../../include
# Compile the files that need MMX and SSE individually.
libSoundTouch_la_LIBADD=libSoundTouchMMX.la libSoundTouchSSE.la
noinst_LTLIBRARIES=libSoundTouchMMX.la libSoundTouchSSE.la
libSoundTouchMMX_la_SOURCES=mmx_optimized.cpp
libSoundTouchSSE_la_SOURCES=sse_optimized.cpp
# We enable optimizations by default.
# If MMX is supported compile with -mmmx.
# Do not assume -msse is also supported.
if HAVE_MMX
libSoundTouchMMX_la_CXXFLAGS = -mmmx $(AM_CXXFLAGS)
else
libSoundTouchMMX_la_CXXFLAGS = $(AM_CXXFLAGS)
endif
# We enable optimizations by default.
# If SSE is supported compile with -msse.
if HAVE_SSE
libSoundTouchSSE_la_CXXFLAGS = -msse $(AM_CXXFLAGS)
else
libSoundTouchSSE_la_CXXFLAGS = $(AM_CXXFLAGS)
endif
# Let the user disable optimizations if he wishes to.
if !X86_OPTIMIZATIONS
libSoundTouchMMX_la_CXXFLAGS = $(AM_CXXFLAGS)
libSoundTouchSSE_la_CXXFLAGS = $(AM_CXXFLAGS)
endif
# other linking flags to add
# noinst_LTLIBRARIES = libSoundTouchOpt.la
# libSoundTouch_la_LIBADD = libSoundTouchOpt.la
# libSoundTouchOpt_la_SOURCES = mmx_optimized.cpp sse_optimized.cpp
# libSoundTouchOpt_la_CXXFLAGS = -O3 -msse -fcheck-new -I../../include

View File

@@ -1,777 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>SoundTouch library README</title>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<meta name="author" content="Olli Parviainen">
<meta name="description"
content="Readme file for SoundTouch audio processing library">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style> <!-- .normal { font-family: Arial }
--></style>
</head>
<body class="normal">
<hr>
<h1>SoundTouch audio processing library v1.7.1</h1>
<p class="normal">SoundTouch library Copyright <20> Olli Parviainen 2001-2012 </p>
<hr>
<h2>1. Introduction </h2>
<p>SoundTouch is an open-source audio processing library that allows
changing the sound tempo, pitch and playback rate parameters
independently from each other, i.e.:</p>
<ul>
<li> Sound tempo can be increased or decreased while maintaining the
original pitch </li>
<li> Sound pitch can be increased or decreased while maintaining the
original tempo </li>
<li> Change playback rate that affects both tempo and pitch at the
same time </li>
<li> Choose any combination of tempo/pitch/rate</li>
</ul>
<h3>1.1 Contact information </h3>
<p>Author email: oparviai 'at' iki.fi </p>
<p>SoundTouch WWW page: <a href="http://www.surina.net/soundtouch">http://www.surina.net/soundtouch</a></p>
<hr>
<h2>2. Compiling SoundTouch</h2>
<p>Before compiling, notice that you can choose the sample data format
if it's desirable to use floating point sample data instead of 16bit
integers. See section "sample data format" for more information.</p>
<h3>2.1. Building in Microsoft Windows</h3>
<p>Project files for Microsoft Visual C++ 6.0 and Visual C++ .NET are
supplied with the source code package.<br>
</p>
<p> Please notice that SoundTouch library uses processor-specific
optimizations for Pentium III and AMD processors. Visual Studio .NET
and later versions supports the required instructions by default, but
Visual Studio 6.0 requires a processor pack upgrade to be installed in
order to support these optimizations. The processor pack upgrade can be
downloaded from Microsoft site at this URL:</p>
<p><a href="http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx">http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx</a></p>
<p>If the above URL is unavailable or removed, go to <a
href="http://msdn.microsoft.com/"> http://msdn.microsoft.com</a> and
perform a search with keywords "processor pack". </p>
<p>To build the binaries with Visual C++ compiler, either run
"make-win.bat" script, or open the appropriate project files in source
code directories with Visual Studio. The final executable will appear
under the "SoundTouch\bin" directory. If using the Visual Studio IDE
instead of the make-win.bat script, directories bin and lib may need to
be created manually to the SoundTouch package root for the final
executables. The make-win.bat script creates these directories
automatically. </p>
<h3>2.2. Building in Gnu platforms</h3>
<p>The SoundTouch library compiles in practically any platform
supporting GNU compiler (GCC) tools. SoundTouch requires GCC version 4.3 or later.</p>
<p>To build and install the binaries, run the following commands in
/soundtouch directory:</p>
<table border="0" cellpadding="0" cellspacing="4">
<tbody>
<tr>
<td style="vertical-align: top;">
<pre>./bootstrap -</pre>
</td>
<td style="vertical-align: top;">Creates "configure" file with
local autoconf/automake toolset.<br>
</td>
</tr>
<tr valign="top">
<td>
<pre>./configure -</pre>
</td>
<td>
<p>Configures the SoundTouch package for the local environment.
Notice that "configure" file is not available before running the
"./bootstrap" command as above.<br>
</p>
</td>
</tr>
<tr valign="top">
<td>
<pre>make -</pre>
</td>
<td>
<p>Builds the SoundTouch library &amp; SoundStretch utility.</p>
</td>
</tr>
<tr valign="top">
<td>
<pre>make install -</pre>
</td>
<td>
<p>Installs the SoundTouch &amp; BPM libraries to <b>/usr/local/lib</b>
and SoundStretch utility to <b>/usr/local/bin</b>. Please notice that
'root' privileges may be required to install the binaries to the
destination locations.</p>
</td>
</tr>
</tbody>
</table>
<h4><b>2.2.1 Required GNU tools</b>&nbsp;</h4>
<p> <span style="font-weight: bold;">Bash shell</span>, <span
style="font-weight: bold;">GNU C++ compiler</span>, <span
style="font-weight: bold;">libtool</span>, <span
style="font-weight: bold;">autoconf</span> and <span
style="font-weight: bold;">automake</span> tools
are required for compiling the SoundTouch library. These are usually
included with the GNU/Linux distribution, but if not, install these
packages first. For example, Ubuntu Linux can acquire and install
these with the following command:</p>
<pre><b>sudo apt-get install automake autoconf libtool build-essential</b></pre>
<h4><b>2.2.2 Problems with GCC compiler compatibility</b></h4>
<p>At the release time the SoundTouch package has been tested to
compile in GNU/Linux platform. However, If you have problems getting the
SoundTouch library compiled, try disabling optimizations that are specific for
x86 processors by running <b>./configure</b> script with switch
<blockquote>
<pre>--enable-x86-optimizations=no</pre>
</blockquote>
Alternatively, if you don't use GNU Configure system, edit file "include/STTypes.h"
directly and remove the following definition:<blockquote>
<pre>#define SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS 1</pre>
</blockquote>
<h4><b>2.2.3 Compiling Shared Library / DLL version</b></h4>
<p>
The GNU compilation does not automatically create a shared-library version of
SoundTouch (.so or .dll). If such is desired, then you can create it as follows
after running the usual compilation:</p>
<blockquote>
<pre>g++ -shared -static -DDLL_EXPORTS -I../../include -o SoundTouch.dll \
SoundTouchDLL.cpp ../SoundTouch/.libs/libSoundTouch.a
sstrip SoundTouch.dll</pre>
</blockquote>
<h3>2.1. Building in Android</h3>
<p>Android compilation instructions are within the
source code package, see file &quot;<b>source/Android-lib/README-SoundTouch-Android.html</b>&quot;
in the package.</p>
<hr>
<h2>3. About implementation &amp; Usage tips <h3>3.1. Supported sample data formats</h3>
<p>The sample data format can be chosen between 16bit signed integer
and 32bit floating point values, the default is 32bit floating point. </p>
<p> In Windows environment, the sample data format is chosen in file
"STTypes.h" by choosing one of the following defines:</p>
<ul>
<li> <span style="font-weight: bold;">#define
SOUNDTOUCH_INTEGER_SAMPLES</span> for 16bit signed integer </li>
<li> <span style="font-weight: bold;">#define </span><span
style="font-weight: bold;">SOUNDTOUCH_</span><span
style="font-weight: bold;">FLOAT_SAMPLES</span> for 32bit floating
point</li>
</ul>
<p> In GNU environment, the floating sample format is used by default,
but integer sample format can be chosen by giving the following switch
to the configure script: </p>
<blockquote>
<pre>./configure --enable-integer-samples</pre>
</blockquote>
<p>The sample data can have either single (mono) or double (stereo)
audio channel. Stereo data is interleaved so that every other data
value is for left channel and every second for right channel. Notice
that while it'd be possible in theory to process stereo sound as two
separate mono channels, this isn't recommended because processing the
channels separately would result in losing the phase coherency between
the channels, which consequently would ruin the stereo effect.</p>
<p>Sample rates between 8000-48000H are supported.</p>
<h3>3.2. Processing latency</h3>
<p>The processing and latency constraints of the SoundTouch library are:</p>
<ul>
<li> Input/output processing latency for the SoundTouch processor is
around 100 ms. This is when time-stretching is used. If the rate
transposing effect alone is used, the latency requirement is much
shorter, see section 'About algorithms'. </li>
<li> Processing CD-quality sound (16bit stereo sound with 44100H
sample rate) in real-time or faster is possible starting from
processors equivalent to Intel Pentium 133Mh or better, if using the
"quick" processing algorithm. If not using the "quick" mode or if
floating point sample data are being used, several times more CPU power
is typically required.</li>
</ul>
<h3>3.3. About algorithms</h3>
<p>SoundTouch provides three seemingly independent effects: tempo,
pitch and playback rate control. These three controls are implemented
as combination of two primary effects, <em>sample rate transposing</em>
and <em>time-stretching</em>.</p>
<p><em>Sample rate transposing</em> affects both the audio stream
duration and pitch. It's implemented simply by converting the original
audio sample stream to the&nbsp; desired duration by interpolating from
the original audio samples. In SoundTouch, linear interpolation with
anti-alias filtering is used. Theoretically a higher-order
interpolation provide better result than 1st order linear
interpolation, but in audio application linear interpolation together
with anti-alias filtering performs subjectively about as well as
higher-order filtering would.</p>
<p><em>Time-stretching </em>means changing the audio stream duration
without affecting it's pitch. SoundTouch uses WSOLA-like
time-stretching routines that operate in the time domain. Compared to
sample rate transposing, time-stretching is a much heavier operation
and also requires a longer processing "window" of sound samples used by
the processing algorithm, thus increasing the algorithm input/output
latency. Typical i/o latency for the SoundTouch time-stretch algorithm
is around 100 ms.</p>
<p>Sample rate transposing and time-stretching are then used together
to produce the tempo, pitch and rate controls:</p>
<ul>
<li> <strong>'Tempo'</strong> control is implemented purely by
time-stretching. </li>
<li> <strong>'Rate</strong>' control is implemented purely by sample
rate transposing. </li>
<li> <strong>'Pitch</strong>' control is implemented as a
combination of time-stretching and sample rate transposing. For
example, to increase pitch the audio stream is first time-stretched to
longer duration (without affecting pitch) and then transposed back to
original duration by sample rate transposing, which simultaneously
reduces duration and increases pitch. The result is original duration
but increased pitch.</li>
</ul>
<h3>3.4 Tuning the algorithm parameters</h3>
<p>The time-stretch algorithm has few parameters that can be tuned to
optimize sound quality for certain application. The current default
parameters have been chosen by iterative if-then analysis (read: "trial
and error") to obtain best subjective sound quality in pop/rock music
processing, but in applications processing different kind of sound the
default parameter set may result into a sub-optimal result.</p>
<p>The time-stretch algorithm default parameter values are set by the
following #defines in file "TDStretch.h":</p>
<blockquote>
<pre>#define DEFAULT_SEQUENCE_MS AUTOMATIC<br>#define DEFAULT_SEEKWINDOW_MS AUTOMATIC<br>#define DEFAULT_OVERLAP_MS 8</pre>
</blockquote>
<p>These parameters affect to the time-stretch algorithm as follows:</p>
<ul>
<li> <strong>DEFAULT_SEQUENCE_MS</strong>: This is the default
length of a single processing sequence in milliseconds which determines
the how the original sound is chopped in the time-stretch algorithm.
Larger values mean fewer sequences are used in processing. In principle
a larger value sounds better when slowing down the tempo, but worse
when increasing the tempo and vice versa.&nbsp;<br>
<br>
By default, this setting value is calculated automatically according to
tempo value.<br>
</li>
<li> <strong>DEFAULT_SEEKWINDOW_MS</strong>: The seeking window
default length in milliseconds is for the algorithm that seeks the best
possible overlapping location. This determines from how wide a sample
"window" the algorithm can use to find an optimal mixing location when
the sound sequences are to be linked back together.&nbsp;<br>
<br>
The bigger this window setting is, the higher the possibility to find a
better mixing position becomes, but at the same time large values may
cause a "drifting" sound artifact because neighboring sequences can be
chosen at more uneven intervals. If there's a disturbing artifact that
sounds as if a constant frequency was drifting around, try reducing
this setting.<br>
<br>
By default, this setting value is calculated automatically according to
tempo value.<br>
</li>
<li> <strong>DEFAULT_OVERLAP_MS</strong>: Overlap length in
milliseconds. When the sound sequences are mixed back together to form
again a continuous sound stream, this parameter defines how much the
ends of the consecutive sequences will overlap with each other.<br>
<br>
This shouldn't be that critical parameter. If you reduce the
DEFAULT_SEQUENCE_MS setting by a large amount, you might wish to try a
smaller value on this.</li>
</ul>
<p>Notice that these parameters can also be set during execution time
with functions "<strong>TDStretch::setParameters()</strong>" and "<strong>SoundTouch::setSetting()</strong>".</p>
<p>The table below summaries how the parameters can be adjusted for
different applications:</p>
<table border="1">
<tbody>
<tr>
<td valign="top"><strong>Parameter name</strong></td>
<td valign="top"><strong>Default value magnitude</strong></td>
<td valign="top"><strong>Larger value affects...</strong></td>
<td valign="top"><strong>Smaller value affects...</strong></td>
<td valign="top"><strong>Effect to CPU burden</strong></td>
</tr>
<tr>
<td valign="top">
<pre>SEQUENCE_MS</pre>
</td>
<td valign="top">Default value is relatively large, chosen for
slowing down music tempo</td>
<td valign="top">Larger value is usually better for slowing down
tempo. Growing the value decelerates the "echoing" artifact when
slowing down the tempo.</td>
<td valign="top">Smaller value might be better for speeding up
tempo. Reducing the value accelerates the "echoing" artifact when
slowing down the tempo </td>
<td valign="top">Increasing the parameter value reduces
computation burden</td>
</tr>
<tr>
<td valign="top">
<pre>SEEKWINDOW_MS</pre>
</td>
<td valign="top">Default value is relatively large, chosen for
slowing down music tempo</td>
<td valign="top">Larger value eases finding a good mixing
position, but may cause a "drifting" artifact</td>
<td valign="top">Smaller reduce possibility to find a good mixing
position, but reduce the "drifting" artifact.</td>
<td valign="top">Increasing the parameter value increases
computation burden</td>
</tr>
<tr>
<td valign="top">
<pre>OVERLAP_MS</pre>
</td>
<td valign="top">Default value is relatively large, chosen to
suit with above parameters.</td>
<td valign="top">&nbsp;</td>
<td valign="top">If you reduce the "sequence ms" setting, you
might wish to try a smaller value.</td>
<td valign="top">Increasing the parameter value increases
computation burden</td>
</tr>
</tbody>
</table>
<h3>3.5 Performance Optimizations </h3>
<p><strong>General optimizations:</strong></p>
<p>The time-stretch routine has a 'quick' mode that substantially
speeds up the algorithm but may degrade the sound quality by a small
amount. This mode is activated by calling SoundTouch::setSetting()
function with parameter&nbsp; id of SETTING_USE_QUICKSEEK and value
"1", i.e. </p>
<blockquote>
<p>setSetting(SETTING_USE_QUICKSEEK, 1);</p>
</blockquote>
<p><strong>CPU-specific optimizations:</strong></p>
<ul>
<li> Intel MMX optimized routines are used with compatible CPUs when
16bit integer sample type is used. MMX optimizations are available both
in Win32 and Gnu/x86 platforms. Compatible processors are Intel
PentiumMMX and later; AMD K6-2, Athlon and later. </li>
<li> Intel SSE optimized routines are used with compatible CPUs when
floating point sample type is used. SSE optimizations are currently
implemented for Win32 platform only. Processors compatible with SSE
extension are Intel processors starting from Pentium-III, and AMD
processors starting from Athlon XP. </li>
<li> AMD 3DNow! optimized routines are used with compatible CPUs when
floating point sample type is used, but SSE extension isn't supported .
3DNow! optimizations are currently implemented for Win32 platform only.
These optimizations are used in AMD K6-2 and Athlon (classic) CPU's;
better performing SSE routines are used with AMD processor starting
from Athlon XP. </li>
</ul>
<hr>
<h2><a name="SoundStretch"></a>4. SoundStretch audio processing utility
</h2>
<p>SoundStretch audio processing utility<br>
Copyright (c) Olli Parviainen 2002-2012</p>
<p>SoundStretch is a simple command-line application that can change
tempo, pitch and playback rates of WAV sound files. This program is
intended primarily to demonstrate how the "SoundTouch" library can be
used to process sound in your own program, but it can as well be used
for processing sound files.</p>
<h3>4.1. SoundStretch Usage Instructions</h3>
<p>SoundStretch Usage syntax:</p>
<blockquote>
<pre>soundstretch infilename outfilename [switches]</pre>
</blockquote>
<p>Where: </p>
<table width="100%" border="0" cellpadding="2">
<tbody>
<tr>
<td valign="top">
<pre>"infilename"</pre>
</td>
<td valign="top">Name of the input sound data file (in .WAV audio
file format). Give "stdin" as filename to use standard input pipe. </td>
</tr>
<tr>
<td valign="top">
<pre>"outfilename"</pre>
</td>
<td valign="top">Name of the output sound file where the
resulting sound is saved (in .WAV audio file format). This parameter
may be omitted if you&nbsp; don't want to save the output (e.g. when
only calculating BPM rate with '-bpm' switch). Give "stdout" as
filename to use standard output pipe.</td>
</tr>
<tr>
<td valign="top">
<pre>&nbsp;[switches]</pre>
</td>
<td valign="top">Are one or more control switches.</td>
</tr>
</tbody>
</table>
<p>Available control switches are:</p>
<table width="100%" border="0" cellpadding="2">
<tbody>
<tr>
<td valign="top">
<pre>-tempo=n </pre>
</td>
<td valign="top">Change the sound tempo by n percents (n = -95.0
.. +5000.0 %) </td>
</tr>
<tr>
<td valign="top">
<pre>-pitch=n</pre>
</td>
<td valign="top">Change the sound pitch by n semitones (n = -60.0
.. + 60.0 semitones) </td>
</tr>
<tr>
<td valign="top">
<pre>-rate=n</pre>
</td>
<td valign="top">Change the sound playback rate by n percents (n
= -95.0 .. +5000.0 %) </td>
</tr>
<tr>
<td valign="top">
<pre>-bpm=n</pre>
</td>
<td valign="top">Detect the Beats-Per-Minute (BPM) rate of the
sound and adjust the tempo to meet 'n' BPMs. When this switch is
applied, the "-tempo" switch is ignored. If "=n" is omitted, i.e.
switch "-bpm" is used alone, then the BPM rate is estimated and
displayed, but tempo not adjusted according to the BPM value. </td>
</tr>
<tr>
<td valign="top">
<pre>-quick</pre>
</td>
<td valign="top">Use quicker tempo change algorithm. Gains speed
but loses sound quality. </td>
</tr>
<tr>
<td valign="top">
<pre>-naa</pre>
</td>
<td valign="top">Don't use anti-alias filtering in sample rate
transposing. Gains speed but loses sound quality. </td>
</tr>
<tr>
<td valign="top">
<pre>-license</pre>
</td>
<td valign="top">Displays the program license text (LGPL)</td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ul>
<li> To use standard input/output pipes for processing, give "stdin"
and "stdout" as input/output filenames correspondingly. The standard
input/output pipes will still carry the audio data in .wav audio file
format. </li>
<li> The numerical switches allow both integer (e.g. "-tempo=123")
and decimal (e.g. "-tempo=123.45") numbers. </li>
<li> The "-naa" and/or "-quick" switches can be used to reduce CPU
usage while compromising some sound quality </li>
<li> The BPM detection algorithm works by detecting repeating bass or
drum patterns at low frequencies of &lt;250Hz. A lower-than-expected
BPM figure may be reported for music with uneven or complex bass
patterns. </li>
</ul>
<h3>4.2. SoundStretch usage examples </h3>
<p><strong>Example 1</strong></p>
<p>The following command increases tempo of the sound file
"originalfile.wav" by 12.5% and stores result to file
"destinationfile.wav":</p>
<blockquote>
<pre>soundstretch originalfile.wav destinationfile.wav -tempo=12.5</pre>
</blockquote>
<p><strong>Example 2</strong></p>
<p>The following command decreases the sound pitch (key) of the sound
file "orig.wav" by two semitones and stores the result to file
"dest.wav":</p>
<blockquote>
<pre>soundstretch orig.wav dest.wav -pitch=-2</pre>
</blockquote>
<p><strong>Example 3</strong></p>
<p>The following command processes the file "orig.wav" by decreasing
the sound tempo by 25.3% and increasing the sound pitch (key) by 1.5
semitones. Resulting .wav audio data is directed to standard output
pipe:</p>
<blockquote>
<pre>soundstretch orig.wav stdout -tempo=-25.3 -pitch=1.5</pre>
</blockquote>
<p><strong>Example 4</strong></p>
<p>The following command detects the BPM rate of the file "orig.wav"
and adjusts the tempo to match 100 beats per minute. Result is stored
to file "dest.wav":</p>
<blockquote>
<pre>soundstretch orig.wav dest.wav -bpm=100</pre>
</blockquote>
<p><strong>Example 5</strong></p>
<p>The following command reads .wav sound data from standard input pipe
and estimates the BPM rate:</p>
<blockquote>
<pre>soundstretch stdin -bpm</pre>
</blockquote>
<hr>
<h2>5. Change History</h2>
<h3>5.1. SoundTouch library Change History </h3>
<p><b>1.7.1:</b></p>
<ul>
<li>Added files for Android compilation
</ul>
<p><b>1.7.0:</b></p>
<ul>
<li>Sound quality improvements/li>
<li>Improved flush() to adjust output sound stream duration to match better with
ideal duration</li>
<li>Rewrote x86 cpu feature check to resolve compatibility problems</li>
<li>Configure script automatically checks if CPU supports mmx & sse compatibility for GNU platform, and
the script support now "--enable-x86-optimizations" switch to allow disabling x86-specific optimizations.</li>
<li>Revised #define conditions for 32bit/64bit compatibility</li>
<li>gnu autoconf/automake script compatibility fixes</li>
<li>Tuned beat-per-minute detection algorithm</li>
</ul>
<p><b>1.6.0:</b></p>
<ul>
<li> Added automatic cutoff threshold adaptation to beat detection
routine to better adapt BPM calculation to different types of music </li>
<li> Retired 3DNow! optimization support as 3DNow! is nowadays
obsoleted and assembler code is nuisance to maintain</li>
<li>Retired "configure" file from source code package due to
autoconf/automake versio conflicts, so that it is from now on to be
generated by invoking "boostrap" script that uses locally available
toolchain version for generating the "configure" file</li>
<li>Resolved namespace/label naming conflicts with other libraries by
replacing global labels such as INTEGER_SAMPLES with more specific
SOUNDTOUCH_INTEGER_SAMPLES etc.<br>
</li>
<li>Updated windows build scripts &amp; project files for Visual
Studio 2008 support</li>
<li> Updated SoundTouch.dll API for .NET compatibility</li>
<li> Added API for querying nominal processing input &amp; output
sample batch sizes</li>
</ul>
<p><strong>1.5.0:</strong></p>
<ul>
<li> Added normalization to correlation calculation and improvement
automatic seek/sequence parameter calculation to improve sound quality </li>
<li> Bugfixes:&nbsp;
<ul>
<li> Fixed negative array indexing in quick seek algorithm </li>
<li> FIR autoalias filter running too far in processing buffer </li>
<li> Check against zero sample count in rate transposing </li>
<li> Fix for x86-64 support: Removed pop/push instructions from
the cpu detection algorithm.&nbsp; </li>
<li> Check against empty buffers in FIFOSampleBuffer </li>
<li> Other minor fixes &amp; code cleanup</li>
</ul>
</li>
<li> Fixes in compilation scripts for non-Intel platforms </li>
<li> Added Dynamic-Link-Library (DLL) version of SoundTouch library
build, provided with Delphi/Pascal wrapper for calling the dll routines
</li>
<li> Added #define PREVENT_CLICK_AT_RATE_CROSSOVER that prevents a
click artifact when crossing the nominal pitch from either positive to
negative side or vice versa</li>
</ul>
<p><strong>1.4.1:</strong></p>
<ul>
<li> Fixed a buffer overflow bug in BPM detect algorithm routines if
processing more than 2048 samples at one call&nbsp;</li>
</ul>
<p><strong>1.4.0:</strong></p>
<ul>
<li> Improved sound quality by automatic calculation of time stretch
algorithm processing parameters according to tempo setting </li>
<li> Moved BPM detection routines from SoundStretch application into
SoundTouch library </li>
<li> Bugfixes: Usage of uninitialied variables, GNU build scripts,
compiler errors due to 'const' keyword mismatch. </li>
<li> Source code cleanup</li>
</ul>
<p><strong>1.3.1: </strong> </p>
<ul>
<li> Changed static class declaration to GCC 4.x compiler compatible
syntax. </li>
<li> Enabled MMX/SSE-optimized routines also for GCC compilers.
Earlier the MMX/SSE-optimized routines were written in
compiler-specific inline assembler, now these routines are migrated to
use compiler intrinsic syntax which allows compiling the same
MMX/SSE-optimized source code with both Visual C++ and GCC compilers. </li>
<li> Set floating point as the default sample format and added switch
to the GNU configure script for selecting the other sample format.</li>
</ul>
<p><strong>1.3.0: </strong> </p>
<ul>
<li> Fixed tempo routine output duration inaccuracy due to rounding
error </li>
<li> Implemented separate processing routines for integer and
floating arithmetic to allow improvements to floating point routines
(earlier used algorithms mostly optimized for integer arithmetic also
for floating point samples) </li>
<li> Fixed a bug that distorts sound if sample rate changes during
the sound stream </li>
<li> Fixed a memory leak that appeared in MMX/SSE/3DNow! optimized
routines </li>
<li> Reduced redundant code pieces in MMX/SSE/3DNow! optimized
routines vs. the standard C routines. </li>
<li> MMX routine incompatibility with new gcc compiler versions </li>
<li> Other miscellaneous bug fixes </li>
</ul>
<p><strong>1.2.1: </strong> </p>
<ul>
<li> Added automake/autoconf scripts for GNU platforms (in courtesy
of David Durham) </li>
<li> Fixed SCALE overflow bug in rate transposer routine. </li>
<li> Fixed 64bit address space bugs. </li>
<li> Created a 'soundtouch' namespace for SAMPLETYPE definitions.</li>
</ul>
<p><strong>1.2.0: </strong> </p>
<ul>
<li> Added support for 32bit floating point sample data type with
SSE/3DNow! optimizations for Win32 platform (SSE/3DNow! optimizations
currently not supported in GCC environment) </li>
<li> Replaced 'make-gcc' script for GNU environment by master
Makefile </li>
<li> Added time-stretch routine configurability to SoundTouch main
class </li>
<li> Bugfixes</li>
</ul>
<p><strong>1.1.1: </strong> </p>
<ul>
<li> Moved SoundTouch under lesser GPL license (LGPL). This allows
using SoundTouch library in programs that aren't released under GPL
license. </li>
<li> Changed MMX routine organiation so that MMX optimized routines
are now implemented in classes that are derived from the basic classes
having the standard non-mmx routines. </li>
<li> MMX routines to support gcc version 3. </li>
<li> Replaced windows makefiles by script using the .dsw files </li>
</ul>
<p><strong>1.0.1: </strong> </p>
<ul>
<li> "mmx_gcc.cpp": Added "using namespace std" and removed "return
0" from a function with void return value to fix compiler errors when
compiling the library in Solaris environment. </li>
<li> Moved file "FIFOSampleBuffer.h" to "include" directory to allow
accessing the FIFOSampleBuffer class from external files. </li>
</ul>
<p><strong>1.0: </strong> </p>
<ul>
<li> Initial release </li>
</ul>
<p>&nbsp;</p>
<h3>5.2. SoundStretch application Change History </h3>
<p><b>1.7.0:</b></p>
<ul>
<li>Bugfixes in Wavfile: exception string formatting, avoid getLengthMs() integer
precision overflow, support WAV files using 24/32bit sample format.</li>
</ul>
<p><b>1.5.0:</b></p>
<ul>
<li> Added "-speech" switch to activate algorithm parameters more
suitable for speech processing than the default parameters tuned for
music processing.</li>
</ul>
<p><strong>1.4.0:</strong></p>
<ul>
<li> Moved BPM detection routines from SoundStretch application into
SoundTouch library </li>
<li> Allow using standard input/output pipes as audio processing
input/output streams</li>
</ul>
<p><strong>1.3.0:</strong></p>
<ul>
<li> Simplified accessing WAV files with floating point sample
format. </li>
</ul>
<p><strong>1.2.1: </strong> </p>
<ul>
<li> Fixed 64bit address space bugs.</li>
</ul>
<p><strong>1.2.0: </strong> </p>
<ul>
<li> Added support for 32bit floating point sample data type </li>
<li> Restructured the BPM routines into separate library </li>
<li> Fixed big-endian conversion bugs in WAV file routines (hopefully
:)</li>
</ul>
<p><strong>1.1.1: </strong> </p>
<ul>
<li> Fixed bugs in WAV file reading &amp; added byte-order conversion
for big-endian processors. </li>
<li> Moved SoundStretch source code under 'example' directory to
highlight difference from SoundTouch stuff. </li>
<li> Replaced windows makefiles by script using the .dsw files </li>
<li> Output file name isn't required if output isn't desired (e.g. if
using the switch '-bpm' in plain format only) </li>
</ul>
<p><strong>1.1:</strong></p>
<ul>
<li> Fixed "Release" settings in Microsoft Visual C++ project file
(.dsp) </li>
<li> Added beats-per-minute (BPM) detection routine and command-line
switch "-bpm" </li>
</ul>
<p><strong>1.01: </strong> </p>
<ul>
<li> Initial release </li>
</ul>
<hr>
<h2>6. Acknowledgements </h2>
<p>Kudos for these people who have contributed to development or
submitted bugfixes since SoundTouch v1.3.1: </p>
<ul>
<li> Arthur A</li>
<li> Richard Ash</li>
<li> Stanislav Brabec</li>
<li> Christian Budde</li>
<li> Jacek Caban</li>
<li> Brian Cameron</li>
<li> Jason Champion</li>
<li> David Clark</li>
<li> Patrick Colis</li>
<li> Miquel Colon</li>
<li> Justin Frankel</li>
<li> Jason Garland</li>
<li> Takashi Iwai</li>
<li> Yuval Naveh</li>
<li> Paulo Pizarro</li>
<li> Blaise Potard</li>
<li> RJ Ryan</li>
<li> Patrick Colis </li>
<li> Miquel Colon </li>
<li> Sandro Cumerlato</li>
<li> Justin Frankel </li>
<li> Jason Garland </li>
<li> Takashi Iwai </li>
<li> Mathias M<>hl</li>
<li> Yuval Naveh </li>
<li> Paulo Pizarro </li>
<li> Blaise Potard</li>
<li> RJ Ryan </li>
<li> John Sheehy</li>
<li> Tim Shuttleworth</li>
<li> John Stumpo</li>
<li> Tim Shuttleworth</li>
<li> Katja Vetter</li>
</ul>
<p>Moral greetings to all other contributors and users also!</p>
<hr>
<h2>7. LICENSE </h2>
<p>SoundTouch audio processing library<br>
Copyright (c) Olli Parviainen</p>
<p>This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License version 2.1
as published by the Free Software Foundation.</p>
<p>This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
General Public License for more details.</p>
<p>You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</p>
<hr><!--
$Id: README.html 168 2012-12-28 20:55:19Z oparviai $
-->
<p>
<i>RREADME.html file updated on 28-Dec-2012</i></p>
</body>

View File

@@ -1,626 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
///
/// Sample rate transposer. Changes sample rate by using linear interpolation
/// together with anti-alias filtering (first order interpolation with anti-
/// alias filtering should be quite adequate for this application)
///
/// Author : Copyright (c) Olli Parviainen
/// Author e-mail : oparviai 'at' iki.fi
/// SoundTouch WWW: http://www.surina.net/soundtouch
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2011-09-02 15:56:11 -0300 (sex, 02 set 2011) $
// File revision : $Revision: 4 $
//
// $Id: RateTransposer.cpp 131 2011-09-02 18:56:11Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
// License :
//
// SoundTouch audio processing library
// Copyright (c) Olli Parviainen
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////////////
#include <memory.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include "RateTransposer.h"
#include "AAFilter.h"
using namespace soundtouch;
/// A linear samplerate transposer class that uses integer arithmetics.
/// for the transposing.
class RateTransposerInteger : public RateTransposer
{
protected:
int iSlopeCount;
int iRate;
SAMPLETYPE sPrevSampleL, sPrevSampleR;
virtual void resetRegisters();
virtual uint transposeStereo(SAMPLETYPE *dest,
const SAMPLETYPE *src,
uint numSamples);
virtual uint transposeMono(SAMPLETYPE *dest,
const SAMPLETYPE *src,
uint numSamples);
public:
RateTransposerInteger();
virtual ~RateTransposerInteger();
/// Sets new target rate. Normal rate = 1.0, smaller values represent slower
/// rate, larger faster rates.
virtual void setRate(float newRate);
};
/// A linear samplerate transposer class that uses floating point arithmetics
/// for the transposing.
class RateTransposerFloat : public RateTransposer
{
protected:
float fSlopeCount;
SAMPLETYPE sPrevSampleL, sPrevSampleR;
virtual void resetRegisters();
virtual uint transposeStereo(SAMPLETYPE *dest,
const SAMPLETYPE *src,
uint numSamples);
virtual uint transposeMono(SAMPLETYPE *dest,
const SAMPLETYPE *src,
uint numSamples);
public:
RateTransposerFloat();
virtual ~RateTransposerFloat();
};
// Operator 'new' is overloaded so that it automatically creates a suitable instance
// depending on if we've a MMX/SSE/etc-capable CPU available or not.
void * RateTransposer::operator new(size_t s)
{
ST_THROW_RT_ERROR("Error in RateTransoser::new: don't use \"new TDStretch\" directly, use \"newInstance\" to create a new instance instead!");
return newInstance();
}
RateTransposer *RateTransposer::newInstance()
{
#ifdef SOUNDTOUCH_INTEGER_SAMPLES
return ::new RateTransposerInteger;
#else
return ::new RateTransposerFloat;
#endif
}
// Constructor
RateTransposer::RateTransposer() : FIFOProcessor(&outputBuffer)
{
numChannels = 2;
bUseAAFilter = TRUE;
fRate = 0;
// Instantiates the anti-alias filter with default tap length
// of 32
pAAFilter = new AAFilter(32);
}
RateTransposer::~RateTransposer()
{
delete pAAFilter;
}
/// Enables/disables the anti-alias filter. Zero to disable, nonzero to enable
void RateTransposer::enableAAFilter(BOOL newMode)
{
bUseAAFilter = newMode;
}
/// Returns nonzero if anti-alias filter is enabled.
BOOL RateTransposer::isAAFilterEnabled() const
{
return bUseAAFilter;
}
AAFilter *RateTransposer::getAAFilter()
{
return pAAFilter;
}
// Sets new target iRate. Normal iRate = 1.0, smaller values represent slower
// iRate, larger faster iRates.
void RateTransposer::setRate(float newRate)
{
double fCutoff;
fRate = newRate;
// design a new anti-alias filter
if (newRate > 1.0f)
{
fCutoff = 0.5f / newRate;
}
else
{
fCutoff = 0.5f * newRate;
}
pAAFilter->setCutoffFreq(fCutoff);
}
// Outputs as many samples of the 'outputBuffer' as possible, and if there's
// any room left, outputs also as many of the incoming samples as possible.
// The goal is to drive the outputBuffer empty.
//
// It's allowed for 'output' and 'input' parameters to point to the same
// memory position.
/*
void RateTransposer::flushStoreBuffer()
{
if (storeBuffer.isEmpty()) return;
outputBuffer.moveSamples(storeBuffer);
}
*/
// Adds 'nSamples' pcs of samples from the 'samples' memory position into
// the input of the object.
void RateTransposer::putSamples(const SAMPLETYPE *samples, uint nSamples)
{
processSamples(samples, nSamples);
}
// Transposes up the sample rate, causing the observed playback 'rate' of the
// sound to decrease
void RateTransposer::upsample(const SAMPLETYPE *src, uint nSamples)
{
uint count, sizeTemp, num;
// If the parameter 'uRate' value is smaller than 'SCALE', first transpose
// the samples and then apply the anti-alias filter to remove aliasing.
// First check that there's enough room in 'storeBuffer'
// (+16 is to reserve some slack in the destination buffer)
sizeTemp = (uint)((float)nSamples / fRate + 16.0f);
// Transpose the samples, store the result into the end of "storeBuffer"
count = transpose(storeBuffer.ptrEnd(sizeTemp), src, nSamples);
storeBuffer.putSamples(count);
// Apply the anti-alias filter to samples in "store output", output the
// result to "dest"
num = storeBuffer.numSamples();
count = pAAFilter->evaluate(outputBuffer.ptrEnd(num),
storeBuffer.ptrBegin(), num, (uint)numChannels);
outputBuffer.putSamples(count);
// Remove the processed samples from "storeBuffer"
storeBuffer.receiveSamples(count);
}
// Transposes down the sample rate, causing the observed playback 'rate' of the
// sound to increase
void RateTransposer::downsample(const SAMPLETYPE *src, uint nSamples)
{
uint count, sizeTemp;
// If the parameter 'uRate' value is larger than 'SCALE', first apply the
// anti-alias filter to remove high frequencies (prevent them from folding
// over the lover frequencies), then transpose.
// Add the new samples to the end of the storeBuffer
storeBuffer.putSamples(src, nSamples);
// Anti-alias filter the samples to prevent folding and output the filtered
// data to tempBuffer. Note : because of the FIR filter length, the
// filtering routine takes in 'filter_length' more samples than it outputs.
assert(tempBuffer.isEmpty());
sizeTemp = storeBuffer.numSamples();
count = pAAFilter->evaluate(tempBuffer.ptrEnd(sizeTemp),
storeBuffer.ptrBegin(), sizeTemp, (uint)numChannels);
if (count == 0) return;
// Remove the filtered samples from 'storeBuffer'
storeBuffer.receiveSamples(count);
// Transpose the samples (+16 is to reserve some slack in the destination buffer)
sizeTemp = (uint)((float)nSamples / fRate + 16.0f);
count = transpose(outputBuffer.ptrEnd(sizeTemp), tempBuffer.ptrBegin(), count);
outputBuffer.putSamples(count);
}
// Transposes sample rate by applying anti-alias filter to prevent folding.
// Returns amount of samples returned in the "dest" buffer.
// The maximum amount of samples that can be returned at a time is set by
// the 'set_returnBuffer_size' function.
void RateTransposer::processSamples(const SAMPLETYPE *src, uint nSamples)
{
uint count;
uint sizeReq;
if (nSamples == 0) return;
assert(pAAFilter);
// If anti-alias filter is turned off, simply transpose without applying
// the filter
if (bUseAAFilter == FALSE)
{
sizeReq = (uint)((float)nSamples / fRate + 1.0f);
count = transpose(outputBuffer.ptrEnd(sizeReq), src, nSamples);
outputBuffer.putSamples(count);
return;
}
// Transpose with anti-alias filter
if (fRate < 1.0f)
{
upsample(src, nSamples);
}
else
{
downsample(src, nSamples);
}
}
// Transposes the sample rate of the given samples using linear interpolation.
// Returns the number of samples returned in the "dest" buffer
inline uint RateTransposer::transpose(SAMPLETYPE *dest, const SAMPLETYPE *src, uint nSamples)
{
if (numChannels == 2)
{
return transposeStereo(dest, src, nSamples);
}
else
{
return transposeMono(dest, src, nSamples);
}
}
// Sets the number of channels, 1 = mono, 2 = stereo
void RateTransposer::setChannels(int nChannels)
{
assert(nChannels > 0);
if (numChannels == nChannels) return;
assert(nChannels == 1 || nChannels == 2);
numChannels = nChannels;
storeBuffer.setChannels(numChannels);
tempBuffer.setChannels(numChannels);
outputBuffer.setChannels(numChannels);
// Inits the linear interpolation registers
resetRegisters();
}
// Clears all the samples in the object
void RateTransposer::clear()
{
outputBuffer.clear();
storeBuffer.clear();
}
// Returns nonzero if there aren't any samples available for outputting.
int RateTransposer::isEmpty() const
{
int res;
res = FIFOProcessor::isEmpty();
if (res == 0) return 0;
return storeBuffer.isEmpty();
}
//////////////////////////////////////////////////////////////////////////////
//
// RateTransposerInteger - integer arithmetic implementation
//
/// fixed-point interpolation routine precision
#define SCALE 65536
// Constructor
RateTransposerInteger::RateTransposerInteger() : RateTransposer()
{
// Notice: use local function calling syntax for sake of clarity,
// to indicate the fact that C++ constructor can't call virtual functions.
RateTransposerInteger::resetRegisters();
RateTransposerInteger::setRate(1.0f);
}
RateTransposerInteger::~RateTransposerInteger()
{
}
void RateTransposerInteger::resetRegisters()
{
iSlopeCount = 0;
sPrevSampleL =
sPrevSampleR = 0;
}
// Transposes the sample rate of the given samples using linear interpolation.
// 'Mono' version of the routine. Returns the number of samples returned in
// the "dest" buffer
uint RateTransposerInteger::transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint nSamples)
{
unsigned int i, used;
LONG_SAMPLETYPE temp, vol1;
if (nSamples == 0) return 0; // no samples, no work
used = 0;
i = 0;
// Process the last sample saved from the previous call first...
while (iSlopeCount <= SCALE)
{
vol1 = (LONG_SAMPLETYPE)(SCALE - iSlopeCount);
temp = vol1 * sPrevSampleL + iSlopeCount * src[0];
dest[i] = (SAMPLETYPE)(temp / SCALE);
i++;
iSlopeCount += iRate;
}
// now always (iSlopeCount > SCALE)
iSlopeCount -= SCALE;
while (1)
{
while (iSlopeCount > SCALE)
{
iSlopeCount -= SCALE;
used ++;
if (used >= nSamples - 1) goto end;
}
vol1 = (LONG_SAMPLETYPE)(SCALE - iSlopeCount);
temp = src[used] * vol1 + iSlopeCount * src[used + 1];
dest[i] = (SAMPLETYPE)(temp / SCALE);
i++;
iSlopeCount += iRate;
}
end:
// Store the last sample for the next round
sPrevSampleL = src[nSamples - 1];
return i;
}
// Transposes the sample rate of the given samples using linear interpolation.
// 'Stereo' version of the routine. Returns the number of samples returned in
// the "dest" buffer
uint RateTransposerInteger::transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, uint nSamples)
{
unsigned int srcPos, i, used;
LONG_SAMPLETYPE temp, vol1;
if (nSamples == 0) return 0; // no samples, no work
used = 0;
i = 0;
// Process the last sample saved from the sPrevSampleLious call first...
while (iSlopeCount <= SCALE)
{
vol1 = (LONG_SAMPLETYPE)(SCALE - iSlopeCount);
temp = vol1 * sPrevSampleL + iSlopeCount * src[0];
dest[2 * i] = (SAMPLETYPE)(temp / SCALE);
temp = vol1 * sPrevSampleR + iSlopeCount * src[1];
dest[2 * i + 1] = (SAMPLETYPE)(temp / SCALE);
i++;
iSlopeCount += iRate;
}
// now always (iSlopeCount > SCALE)
iSlopeCount -= SCALE;
while (1)
{
while (iSlopeCount > SCALE)
{
iSlopeCount -= SCALE;
used ++;
if (used >= nSamples - 1) goto end;
}
srcPos = 2 * used;
vol1 = (LONG_SAMPLETYPE)(SCALE - iSlopeCount);
temp = src[srcPos] * vol1 + iSlopeCount * src[srcPos + 2];
dest[2 * i] = (SAMPLETYPE)(temp / SCALE);
temp = src[srcPos + 1] * vol1 + iSlopeCount * src[srcPos + 3];
dest[2 * i + 1] = (SAMPLETYPE)(temp / SCALE);
i++;
iSlopeCount += iRate;
}
end:
// Store the last sample for the next round
sPrevSampleL = src[2 * nSamples - 2];
sPrevSampleR = src[2 * nSamples - 1];
return i;
}
// Sets new target iRate. Normal iRate = 1.0, smaller values represent slower
// iRate, larger faster iRates.
void RateTransposerInteger::setRate(float newRate)
{
iRate = (int)(newRate * SCALE + 0.5f);
RateTransposer::setRate(newRate);
}
//////////////////////////////////////////////////////////////////////////////
//
// RateTransposerFloat - floating point arithmetic implementation
//
//////////////////////////////////////////////////////////////////////////////
// Constructor
RateTransposerFloat::RateTransposerFloat() : RateTransposer()
{
// Notice: use local function calling syntax for sake of clarity,
// to indicate the fact that C++ constructor can't call virtual functions.
RateTransposerFloat::resetRegisters();
RateTransposerFloat::setRate(1.0f);
}
RateTransposerFloat::~RateTransposerFloat()
{
}
void RateTransposerFloat::resetRegisters()
{
fSlopeCount = 0;
sPrevSampleL =
sPrevSampleR = 0;
}
// Transposes the sample rate of the given samples using linear interpolation.
// 'Mono' version of the routine. Returns the number of samples returned in
// the "dest" buffer
uint RateTransposerFloat::transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint nSamples)
{
unsigned int i, used;
used = 0;
i = 0;
// Process the last sample saved from the previous call first...
while (fSlopeCount <= 1.0f)
{
dest[i] = (SAMPLETYPE)((1.0f - fSlopeCount) * sPrevSampleL + fSlopeCount * src[0]);
i++;
fSlopeCount += fRate;
}
fSlopeCount -= 1.0f;
if (nSamples > 1)
{
while (1)
{
while (fSlopeCount > 1.0f)
{
fSlopeCount -= 1.0f;
used ++;
if (used >= nSamples - 1) goto end;
}
dest[i] = (SAMPLETYPE)((1.0f - fSlopeCount) * src[used] + fSlopeCount * src[used + 1]);
i++;
fSlopeCount += fRate;
}
}
end:
// Store the last sample for the next round
sPrevSampleL = src[nSamples - 1];
return i;
}
// Transposes the sample rate of the given samples using linear interpolation.
// 'Mono' version of the routine. Returns the number of samples returned in
// the "dest" buffer
uint RateTransposerFloat::transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, uint nSamples)
{
unsigned int srcPos, i, used;
if (nSamples == 0) return 0; // no samples, no work
used = 0;
i = 0;
// Process the last sample saved from the sPrevSampleLious call first...
while (fSlopeCount <= 1.0f)
{
dest[2 * i] = (SAMPLETYPE)((1.0f - fSlopeCount) * sPrevSampleL + fSlopeCount * src[0]);
dest[2 * i + 1] = (SAMPLETYPE)((1.0f - fSlopeCount) * sPrevSampleR + fSlopeCount * src[1]);
i++;
fSlopeCount += fRate;
}
// now always (iSlopeCount > 1.0f)
fSlopeCount -= 1.0f;
if (nSamples > 1)
{
while (1)
{
while (fSlopeCount > 1.0f)
{
fSlopeCount -= 1.0f;
used ++;
if (used >= nSamples - 1) goto end;
}
srcPos = 2 * used;
dest[2 * i] = (SAMPLETYPE)((1.0f - fSlopeCount) * src[srcPos]
+ fSlopeCount * src[srcPos + 2]);
dest[2 * i + 1] = (SAMPLETYPE)((1.0f - fSlopeCount) * src[srcPos + 1]
+ fSlopeCount * src[srcPos + 3]);
i++;
fSlopeCount += fRate;
}
}
end:
// Store the last sample for the next round
sPrevSampleL = src[2 * nSamples - 2];
sPrevSampleR = src[2 * nSamples - 1];
return i;
}

View File

@@ -1,159 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
///
/// Sample rate transposer. Changes sample rate by using linear interpolation
/// together with anti-alias filtering (first order interpolation with anti-
/// alias filtering should be quite adequate for this application).
///
/// Use either of the derived classes of 'RateTransposerInteger' or
/// 'RateTransposerFloat' for corresponding integer/floating point tranposing
/// algorithm implementation.
///
/// Author : Copyright (c) Olli Parviainen
/// Author e-mail : oparviai 'at' iki.fi
/// SoundTouch WWW: http://www.surina.net/soundtouch
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2009-02-21 13:00:14 -0300 (sáb, 21 fev 2009) $
// File revision : $Revision: 4 $
//
// $Id: RateTransposer.h 63 2009-02-21 16:00:14Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
// License :
//
// SoundTouch audio processing library
// Copyright (c) Olli Parviainen
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////////////
#ifndef RateTransposer_H
#define RateTransposer_H
#include <stddef.h>
#include "AAFilter.h"
#include "FIFOSamplePipe.h"
#include "FIFOSampleBuffer.h"
#include "STTypes.h"
namespace soundtouch
{
/// A common linear samplerate transposer class.
///
/// Note: Use function "RateTransposer::newInstance()" to create a new class
/// instance instead of the "new" operator; that function automatically
/// chooses a correct implementation depending on if integer or floating
/// arithmetics are to be used.
class RateTransposer : public FIFOProcessor
{
protected:
/// Anti-alias filter object
AAFilter *pAAFilter;
float fRate;
int numChannels;
/// Buffer for collecting samples to feed the anti-alias filter between
/// two batches
FIFOSampleBuffer storeBuffer;
/// Buffer for keeping samples between transposing & anti-alias filter
FIFOSampleBuffer tempBuffer;
/// Output sample buffer
FIFOSampleBuffer outputBuffer;
BOOL bUseAAFilter;
virtual void resetRegisters() = 0;
virtual uint transposeStereo(SAMPLETYPE *dest,
const SAMPLETYPE *src,
uint numSamples) = 0;
virtual uint transposeMono(SAMPLETYPE *dest,
const SAMPLETYPE *src,
uint numSamples) = 0;
inline uint transpose(SAMPLETYPE *dest,
const SAMPLETYPE *src,
uint numSamples);
void downsample(const SAMPLETYPE *src,
uint numSamples);
void upsample(const SAMPLETYPE *src,
uint numSamples);
/// Transposes sample rate by applying anti-alias filter to prevent folding.
/// Returns amount of samples returned in the "dest" buffer.
/// The maximum amount of samples that can be returned at a time is set by
/// the 'set_returnBuffer_size' function.
void processSamples(const SAMPLETYPE *src,
uint numSamples);
public:
RateTransposer();
virtual ~RateTransposer();
/// Operator 'new' is overloaded so that it automatically creates a suitable instance
/// depending on if we're to use integer or floating point arithmetics.
static void *operator new(size_t s);
/// Use this function instead of "new" operator to create a new instance of this class.
/// This function automatically chooses a correct implementation, depending on if
/// integer ot floating point arithmetics are to be used.
static RateTransposer *newInstance();
/// Returns the output buffer object
FIFOSamplePipe *getOutput() { return &outputBuffer; };
/// Returns the store buffer object
FIFOSamplePipe *getStore() { return &storeBuffer; };
/// Return anti-alias filter object
AAFilter *getAAFilter();
/// Enables/disables the anti-alias filter. Zero to disable, nonzero to enable
void enableAAFilter(BOOL newMode);
/// Returns nonzero if anti-alias filter is enabled.
BOOL isAAFilterEnabled() const;
/// Sets new target rate. Normal rate = 1.0, smaller values represent slower
/// rate, larger faster rates.
virtual void setRate(float newRate);
/// Sets the number of channels, 1 = mono, 2 = stereo
void setChannels(int channels);
/// Adds 'numSamples' pcs of samples from the 'samples' memory position into
/// the input of the object.
void putSamples(const SAMPLETYPE *samples, uint numSamples);
/// Clears all the samples in the object
void clear();
/// Returns nonzero if there aren't any samples available for outputting.
int isEmpty() const;
};
}
#endif

View File

@@ -1,86 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="SoundTouch" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="../../deps/debug/libsoundtouch-dbg" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="./.objs/debug" />
<Option type="2" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Compiler>
<Add option="-g" />
<Add option="-O0" />
</Compiler>
</Target>
<Target title="Devel">
<Option output="../../deps/devel/libsoundtouch-dev" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="./.objs/devel" />
<Option type="2" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Compiler>
<Add option="-O1" />
<Add option="-W" />
<Add option="-g" />
<Add option="-DNDEBUG" />
</Compiler>
</Target>
<Target title="Release">
<Option output="../../deps/libsoundtouch" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="./.objs/release" />
<Option type="2" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Compiler>
<Add option="-fexpensive-optimizations" />
<Add option="-O3" />
<Add option="-W" />
<Add option="-DNDEBUG" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-march=athlon-xp" />
<Add option="-march=prescott" />
</Compiler>
<Unit filename="AAFilter.cpp" />
<Unit filename="AAFilter.h" />
<Unit filename="BPMDetect.h" />
<Unit filename="FIFOSampleBuffer.cpp" />
<Unit filename="FIFOSampleBuffer.h" />
<Unit filename="FIFOSamplePipe.h" />
<Unit filename="FIRFilter.cpp" />
<Unit filename="FIRFilter.h" />
<Unit filename="RateTransposer.cpp" />
<Unit filename="RateTransposer.h" />
<Unit filename="STTypes.h" />
<Unit filename="SoundTouch.cpp" />
<Unit filename="SoundTouch.h" />
<Unit filename="TDStretch.cpp" />
<Unit filename="TDStretch.h" />
<Unit filename="WavFile.cpp" />
<Unit filename="WavFile.h" />
<Unit filename="cpu_detect.h" />
<Unit filename="cpu_detect_x86_gcc.cpp" />
<Unit filename="mmx_optimized.cpp" />
<Unit filename="soundtouch_config.h" />
<Unit filename="sse_optimized.cpp" />
<Extensions>
<envvars />
<code_completion />
<lib_finder disable_auto="1" />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>

View File

@@ -1,285 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="SoundTouch"
ProjectGUID="{E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}"
RootNamespace="SoundTouch"
TargetFrameworkVersion="0"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
ConfigurationType="4"
InheritedPropertySheets="..\DefaultProjectRootDir.vsprops;..\3rdparty.vsprops;..\..\common\vsprops\CodeGen_Debug.vsprops;..\..\common\vsprops\IncrementalLinking.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
WarningLevel="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="4"
InheritedPropertySheets="..\DefaultProjectRootDir.vsprops;..\3rdparty.vsprops;..\..\common\vsprops\CodeGen_Release.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
WarningLevel="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Devel|Win32"
ConfigurationType="4"
InheritedPropertySheets="..\DefaultProjectRootDir.vsprops;..\3rdparty.vsprops;..\..\common\vsprops\CodeGen_Devel.vsprops;..\..\common\vsprops\IncrementalLinking.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\3dnow_win.cpp"
>
</File>
<File
RelativePath=".\AAFilter.cpp"
>
</File>
<File
RelativePath=".\cpu_detect_x86_win.cpp"
>
</File>
<File
RelativePath=".\FIFOSampleBuffer.cpp"
>
</File>
<File
RelativePath=".\FIRFilter.cpp"
>
</File>
<File
RelativePath=".\mmx_optimized.cpp"
>
</File>
<File
RelativePath=".\RateTransposer.cpp"
>
</File>
<File
RelativePath=".\SoundTouch.cpp"
>
</File>
<File
RelativePath=".\sse_optimized.cpp"
>
</File>
<File
RelativePath=".\TDStretch.cpp"
>
</File>
<File
RelativePath=".\WavFile.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\AAFilter.h"
>
</File>
<File
RelativePath=".\BPMDetect.h"
>
</File>
<File
RelativePath=".\cpu_detect.h"
>
</File>
<File
RelativePath=".\FIFOSampleBuffer.h"
>
</File>
<File
RelativePath=".\FIFOSamplePipe.h"
>
</File>
<File
RelativePath=".\FIRFilter.h"
>
</File>
<File
RelativePath=".\RateTransposer.h"
>
</File>
<File
RelativePath=".\SoundTouch.h"
>
</File>
<File
RelativePath=".\STTypes.h"
>
</File>
<File
RelativePath=".\TDStretch.h"
>
</File>
<File
RelativePath=".\WavFile.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Devel|Win32">
<Configuration>Devel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}</ProjectGuid>
<RootNamespace>SoundTouch</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="3dnow_win.cpp" />
<ClCompile Include="AAFilter.cpp" />
<ClCompile Include="cpu_detect_x86_win.cpp" />
<ClCompile Include="FIFOSampleBuffer.cpp" />
<ClCompile Include="FIRFilter.cpp" />
<ClCompile Include="mmx_optimized.cpp" />
<ClCompile Include="RateTransposer.cpp" />
<ClCompile Include="SoundTouch.cpp" />
<ClCompile Include="sse_optimized.cpp" />
<ClCompile Include="TDStretch.cpp" />
<ClCompile Include="WavFile.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AAFilter.h" />
<ClInclude Include="BPMDetect.h" />
<ClInclude Include="cpu_detect.h" />
<ClInclude Include="FIFOSampleBuffer.h" />
<ClInclude Include="FIFOSamplePipe.h" />
<ClInclude Include="FIRFilter.h" />
<ClInclude Include="RateTransposer.h" />
<ClInclude Include="SoundTouch.h" />
<ClInclude Include="STTypes.h" />
<ClInclude Include="TDStretch.h" />
<ClInclude Include="WavFile.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="3dnow_win.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AAFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cpu_detect_x86_win.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FIFOSampleBuffer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FIRFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mmx_optimized.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RateTransposer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SoundTouch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sse_optimized.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TDStretch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="WavFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AAFilter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BPMDetect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cpu_detect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FIFOSampleBuffer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FIFOSamplePipe.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FIRFilter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RateTransposer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SoundTouch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="STTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TDStretch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="WavFile.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,116 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Devel|Win32">
<Configuration>Devel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}</ProjectGuid>
<RootNamespace>SoundTouch</RootNamespace>
<ProjectName>SoundTouch</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="3dnow_win.cpp" />
<ClCompile Include="AAFilter.cpp" />
<ClCompile Include="cpu_detect_x86_win.cpp" />
<ClCompile Include="FIFOSampleBuffer.cpp" />
<ClCompile Include="FIRFilter.cpp" />
<ClCompile Include="mmx_optimized.cpp" />
<ClCompile Include="RateTransposer.cpp" />
<ClCompile Include="SoundTouch.cpp" />
<ClCompile Include="sse_optimized.cpp" />
<ClCompile Include="TDStretch.cpp" />
<ClCompile Include="WavFile.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AAFilter.h" />
<ClInclude Include="BPMDetect.h" />
<ClInclude Include="cpu_detect.h" />
<ClInclude Include="FIFOSampleBuffer.h" />
<ClInclude Include="FIFOSamplePipe.h" />
<ClInclude Include="FIRFilter.h" />
<ClInclude Include="RateTransposer.h" />
<ClInclude Include="SoundTouch.h" />
<ClInclude Include="STTypes.h" />
<ClInclude Include="TDStretch.h" />
<ClInclude Include="WavFile.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="3dnow_win.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AAFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cpu_detect_x86_win.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FIFOSampleBuffer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FIRFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mmx_optimized.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RateTransposer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SoundTouch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sse_optimized.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TDStretch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="WavFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AAFilter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BPMDetect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cpu_detect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FIFOSampleBuffer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FIFOSamplePipe.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FIRFilter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RateTransposer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SoundTouch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="STTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TDStretch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="WavFile.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,116 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Devel|Win32">
<Configuration>Devel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}</ProjectGuid>
<RootNamespace>SoundTouch</RootNamespace>
<ProjectName>SoundTouch</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="3dnow_win.cpp" />
<ClCompile Include="AAFilter.cpp" />
<ClCompile Include="cpu_detect_x86_win.cpp" />
<ClCompile Include="FIFOSampleBuffer.cpp" />
<ClCompile Include="FIRFilter.cpp" />
<ClCompile Include="mmx_optimized.cpp" />
<ClCompile Include="RateTransposer.cpp" />
<ClCompile Include="SoundTouch.cpp" />
<ClCompile Include="sse_optimized.cpp" />
<ClCompile Include="TDStretch.cpp" />
<ClCompile Include="WavFile.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AAFilter.h" />
<ClInclude Include="BPMDetect.h" />
<ClInclude Include="cpu_detect.h" />
<ClInclude Include="FIFOSampleBuffer.h" />
<ClInclude Include="FIFOSamplePipe.h" />
<ClInclude Include="FIRFilter.h" />
<ClInclude Include="RateTransposer.h" />
<ClInclude Include="SoundTouch.h" />
<ClInclude Include="STTypes.h" />
<ClInclude Include="TDStretch.h" />
<ClInclude Include="WavFile.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="3dnow_win.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AAFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cpu_detect_x86_win.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FIFOSampleBuffer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FIRFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mmx_optimized.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RateTransposer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SoundTouch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sse_optimized.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TDStretch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="WavFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AAFilter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BPMDetect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cpu_detect.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FIFOSampleBuffer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FIFOSamplePipe.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FIRFilter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RateTransposer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SoundTouch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="STTypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TDStretch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="WavFile.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,808 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
///
/// Sampled sound tempo changer/time stretch algorithm. Changes the sound tempo
/// while maintaining the original pitch by using a time domain WSOLA-like
/// method with several performance-increasing tweaks.
///
/// Note : MMX optimized functions reside in a separate, platform-specific
/// file, e.g. 'mmx_win.cpp' or 'mmx_gcc.cpp'
///
/// Author : Copyright (c) Olli Parviainen
/// Author e-mail : oparviai 'at' iki.fi
/// SoundTouch WWW: http://www.surina.net/soundtouch
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-11-08 16:53:01 -0200 (qui, 08 nov 2012) $
// File revision : $Revision: 1.12 $
//
// $Id: TDStretch.cpp 160 2012-11-08 18:53:01Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
// License :
//
// SoundTouch audio processing library
// Copyright (c) Olli Parviainen
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////////////
#include <string.h>
#include <limits.h>
#include <assert.h>
#include <math.h>
#include <float.h>
#include "STTypes.h"
#include "cpu_detect.h"
#include "TDStretch.h"
#include <stdio.h>
using namespace soundtouch;
#define max(x, y) (((x) > (y)) ? (x) : (y))
/*****************************************************************************
*
* Constant definitions
*
*****************************************************************************/
// Table for the hierarchical mixing position seeking algorithm
static const short _scanOffsets[5][24]={
{ 124, 186, 248, 310, 372, 434, 496, 558, 620, 682, 744, 806,
868, 930, 992, 1054, 1116, 1178, 1240, 1302, 1364, 1426, 1488, 0},
{-100, -75, -50, -25, 25, 50, 75, 100, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ -20, -15, -10, -5, 5, 10, 15, 20, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ -4, -3, -2, -1, 1, 2, 3, 4, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 121, 114, 97, 114, 98, 105, 108, 32, 104, 99, 117, 111,
116, 100, 110, 117, 111, 115, 0, 0, 0, 0, 0, 0}};
/*****************************************************************************
*
* Implementation of the class 'TDStretch'
*
*****************************************************************************/
TDStretch::TDStretch() : FIFOProcessor(&outputBuffer)
{
bQuickSeek = FALSE;
channels = 2;
pMidBuffer = NULL;
pMidBufferUnaligned = NULL;
overlapLength = 0;
bAutoSeqSetting = TRUE;
bAutoSeekSetting = TRUE;
// outDebt = 0;
skipFract = 0;
tempo = 1.0f;
setParameters(44100, DEFAULT_SEQUENCE_MS, DEFAULT_SEEKWINDOW_MS, DEFAULT_OVERLAP_MS);
setTempo(1.0f);
clear();
}
TDStretch::~TDStretch()
{
delete[] pMidBufferUnaligned;
}
// Sets routine control parameters. These control are certain time constants
// defining how the sound is stretched to the desired duration.
//
// 'sampleRate' = sample rate of the sound
// 'sequenceMS' = one processing sequence length in milliseconds (default = 82 ms)
// 'seekwindowMS' = seeking window length for scanning the best overlapping
// position (default = 28 ms)
// 'overlapMS' = overlapping length (default = 12 ms)
void TDStretch::setParameters(int aSampleRate, int aSequenceMS,
int aSeekWindowMS, int aOverlapMS)
{
// accept only positive parameter values - if zero or negative, use old values instead
if (aSampleRate > 0) this->sampleRate = aSampleRate;
if (aOverlapMS > 0) this->overlapMs = aOverlapMS;
if (aSequenceMS > 0)
{
this->sequenceMs = aSequenceMS;
bAutoSeqSetting = FALSE;
}
else if (aSequenceMS == 0)
{
// if zero, use automatic setting
bAutoSeqSetting = TRUE;
}
if (aSeekWindowMS > 0)
{
this->seekWindowMs = aSeekWindowMS;
bAutoSeekSetting = FALSE;
}
else if (aSeekWindowMS == 0)
{
// if zero, use automatic setting
bAutoSeekSetting = TRUE;
}
calcSeqParameters();
calculateOverlapLength(overlapMs);
// set tempo to recalculate 'sampleReq'
setTempo(tempo);
}
/// Get routine control parameters, see setParameters() function.
/// Any of the parameters to this function can be NULL, in such case corresponding parameter
/// value isn't returned.
void TDStretch::getParameters(int *pSampleRate, int *pSequenceMs, int *pSeekWindowMs, int *pOverlapMs) const
{
if (pSampleRate)
{
*pSampleRate = sampleRate;
}
if (pSequenceMs)
{
*pSequenceMs = (bAutoSeqSetting) ? (USE_AUTO_SEQUENCE_LEN) : sequenceMs;
}
if (pSeekWindowMs)
{
*pSeekWindowMs = (bAutoSeekSetting) ? (USE_AUTO_SEEKWINDOW_LEN) : seekWindowMs;
}
if (pOverlapMs)
{
*pOverlapMs = overlapMs;
}
}
// Overlaps samples in 'midBuffer' with the samples in 'pInput'
void TDStretch::overlapMono(SAMPLETYPE *pOutput, const SAMPLETYPE *pInput) const
{
int i;
SAMPLETYPE m1, m2;
m1 = (SAMPLETYPE)0;
m2 = (SAMPLETYPE)overlapLength;
for (i = 0; i < overlapLength ; i ++)
{
pOutput[i] = (pInput[i] * m1 + pMidBuffer[i] * m2 ) / overlapLength;
m1 += 1;
m2 -= 1;
}
}
void TDStretch::clearMidBuffer()
{
memset(pMidBuffer, 0, 2 * sizeof(SAMPLETYPE) * overlapLength);
}
void TDStretch::clearInput()
{
inputBuffer.clear();
clearMidBuffer();
}
// Clears the sample buffers
void TDStretch::clear()
{
outputBuffer.clear();
clearInput();
}
// Enables/disables the quick position seeking algorithm. Zero to disable, nonzero
// to enable
void TDStretch::enableQuickSeek(BOOL enable)
{
bQuickSeek = enable;
}
// Returns nonzero if the quick seeking algorithm is enabled.
BOOL TDStretch::isQuickSeekEnabled() const
{
return bQuickSeek;
}
// Seeks for the optimal overlap-mixing position.
int TDStretch::seekBestOverlapPosition(const SAMPLETYPE *refPos)
{
if (bQuickSeek)
{
return seekBestOverlapPositionQuick(refPos);
}
else
{
return seekBestOverlapPositionFull(refPos);
}
}
// Overlaps samples in 'midBuffer' with the samples in 'pInputBuffer' at position
// of 'ovlPos'.
inline void TDStretch::overlap(SAMPLETYPE *pOutput, const SAMPLETYPE *pInput, uint ovlPos) const
{
if (channels == 2)
{
// stereo sound
overlapStereo(pOutput, pInput + 2 * ovlPos);
} else {
// mono sound.
overlapMono(pOutput, pInput + ovlPos);
}
}
// Seeks for the optimal overlap-mixing position. The 'stereo' version of the
// routine
//
// The best position is determined as the position where the two overlapped
// sample sequences are 'most alike', in terms of the highest cross-correlation
// value over the overlapping period
int TDStretch::seekBestOverlapPositionFull(const SAMPLETYPE *refPos)
{
int bestOffs;
double bestCorr, corr;
int i;
bestCorr = FLT_MIN;
bestOffs = 0;
// Scans for the best correlation value by testing each possible position
// over the permitted range.
for (i = 0; i < seekLength; i ++)
{
// Calculates correlation value for the mixing position corresponding
// to 'i'
corr = calcCrossCorr(refPos + channels * i, pMidBuffer);
// heuristic rule to slightly favour values close to mid of the range
double tmp = (double)(2 * i - seekLength) / (double)seekLength;
corr = ((corr + 0.1) * (1.0 - 0.25 * tmp * tmp));
// Checks for the highest correlation value
if (corr > bestCorr)
{
bestCorr = corr;
bestOffs = i;
}
}
// clear cross correlation routine state if necessary (is so e.g. in MMX routines).
clearCrossCorrState();
return bestOffs;
}
// Seeks for the optimal overlap-mixing position. The 'stereo' version of the
// routine
//
// The best position is determined as the position where the two overlapped
// sample sequences are 'most alike', in terms of the highest cross-correlation
// value over the overlapping period
int TDStretch::seekBestOverlapPositionQuick(const SAMPLETYPE *refPos)
{
int j;
int bestOffs;
double bestCorr, corr;
int scanCount, corrOffset, tempOffset;
bestCorr = FLT_MIN;
bestOffs = _scanOffsets[0][0];
corrOffset = 0;
tempOffset = 0;
// Scans for the best correlation value using four-pass hierarchical search.
//
// The look-up table 'scans' has hierarchical position adjusting steps.
// In first pass the routine searhes for the highest correlation with
// relatively coarse steps, then rescans the neighbourhood of the highest
// correlation with better resolution and so on.
for (scanCount = 0;scanCount < 4; scanCount ++)
{
j = 0;
while (_scanOffsets[scanCount][j])
{
tempOffset = corrOffset + _scanOffsets[scanCount][j];
if (tempOffset >= seekLength) break;
// Calculates correlation value for the mixing position corresponding
// to 'tempOffset'
corr = (double)calcCrossCorr(refPos + channels * tempOffset, pMidBuffer);
// heuristic rule to slightly favour values close to mid of the range
double tmp = (double)(2 * tempOffset - seekLength) / seekLength;
corr = ((corr + 0.1) * (1.0 - 0.25 * tmp * tmp));
// Checks for the highest correlation value
if (corr > bestCorr)
{
bestCorr = corr;
bestOffs = tempOffset;
}
j ++;
}
corrOffset = bestOffs;
}
// clear cross correlation routine state if necessary (is so e.g. in MMX routines).
clearCrossCorrState();
return bestOffs;
}
/// clear cross correlation routine state if necessary
void TDStretch::clearCrossCorrState()
{
// default implementation is empty.
}
/// Calculates processing sequence length according to tempo setting
void TDStretch::calcSeqParameters()
{
// Adjust tempo param according to tempo, so that variating processing sequence length is used
// at varius tempo settings, between the given low...top limits
#define AUTOSEQ_TEMPO_LOW 0.5 // auto setting low tempo range (-50%)
#define AUTOSEQ_TEMPO_TOP 2.0 // auto setting top tempo range (+100%)
// sequence-ms setting values at above low & top tempo
#define AUTOSEQ_AT_MIN 125.0
#define AUTOSEQ_AT_MAX 50.0
#define AUTOSEQ_K ((AUTOSEQ_AT_MAX - AUTOSEQ_AT_MIN) / (AUTOSEQ_TEMPO_TOP - AUTOSEQ_TEMPO_LOW))
#define AUTOSEQ_C (AUTOSEQ_AT_MIN - (AUTOSEQ_K) * (AUTOSEQ_TEMPO_LOW))
// seek-window-ms setting values at above low & top tempo
#define AUTOSEEK_AT_MIN 25.0
#define AUTOSEEK_AT_MAX 15.0
#define AUTOSEEK_K ((AUTOSEEK_AT_MAX - AUTOSEEK_AT_MIN) / (AUTOSEQ_TEMPO_TOP - AUTOSEQ_TEMPO_LOW))
#define AUTOSEEK_C (AUTOSEEK_AT_MIN - (AUTOSEEK_K) * (AUTOSEQ_TEMPO_LOW))
#define CHECK_LIMITS(x, mi, ma) (((x) < (mi)) ? (mi) : (((x) > (ma)) ? (ma) : (x)))
double seq, seek;
if (bAutoSeqSetting)
{
seq = AUTOSEQ_C + AUTOSEQ_K * tempo;
seq = CHECK_LIMITS(seq, AUTOSEQ_AT_MAX, AUTOSEQ_AT_MIN);
sequenceMs = (int)(seq + 0.5);
}
if (bAutoSeekSetting)
{
seek = AUTOSEEK_C + AUTOSEEK_K * tempo;
seek = CHECK_LIMITS(seek, AUTOSEEK_AT_MAX, AUTOSEEK_AT_MIN);
seekWindowMs = (int)(seek + 0.5);
}
// Update seek window lengths
seekWindowLength = (sampleRate * sequenceMs) / 1000;
if (seekWindowLength < 2 * overlapLength)
{
seekWindowLength = 2 * overlapLength;
}
seekLength = (sampleRate * seekWindowMs) / 1000;
}
// Sets new target tempo. Normal tempo = 'SCALE', smaller values represent slower
// tempo, larger faster tempo.
void TDStretch::setTempo(float newTempo)
{
int intskip;
tempo = newTempo;
// Calculate new sequence duration
calcSeqParameters();
// Calculate ideal skip length (according to tempo value)
nominalSkip = tempo * (seekWindowLength - overlapLength);
intskip = (int)(nominalSkip + 0.5f);
// Calculate how many samples are needed in the 'inputBuffer' to
// process another batch of samples
//sampleReq = max(intskip + overlapLength, seekWindowLength) + seekLength / 2;
sampleReq = max(intskip + overlapLength, seekWindowLength) + seekLength;
}
// Sets the number of channels, 1 = mono, 2 = stereo
void TDStretch::setChannels(int numChannels)
{
assert(numChannels > 0);
if (channels == numChannels) return;
assert(numChannels == 1 || numChannels == 2);
channels = numChannels;
inputBuffer.setChannels(channels);
outputBuffer.setChannels(channels);
}
// nominal tempo, no need for processing, just pass the samples through
// to outputBuffer
/*
void TDStretch::processNominalTempo()
{
assert(tempo == 1.0f);
if (bMidBufferDirty)
{
// If there are samples in pMidBuffer waiting for overlapping,
// do a single sliding overlapping with them in order to prevent a
// clicking distortion in the output sound
if (inputBuffer.numSamples() < overlapLength)
{
// wait until we've got overlapLength input samples
return;
}
// Mix the samples in the beginning of 'inputBuffer' with the
// samples in 'midBuffer' using sliding overlapping
overlap(outputBuffer.ptrEnd(overlapLength), inputBuffer.ptrBegin(), 0);
outputBuffer.putSamples(overlapLength);
inputBuffer.receiveSamples(overlapLength);
clearMidBuffer();
// now we've caught the nominal sample flow and may switch to
// bypass mode
}
// Simply bypass samples from input to output
outputBuffer.moveSamples(inputBuffer);
}
*/
#include <stdio.h>
// Processes as many processing frames of the samples 'inputBuffer', store
// the result into 'outputBuffer'
void TDStretch::processSamples()
{
int ovlSkip, offset;
int temp;
/* Removed this small optimization - can introduce a click to sound when tempo setting
crosses the nominal value
if (tempo == 1.0f)
{
// tempo not changed from the original, so bypass the processing
processNominalTempo();
return;
}
*/
// Process samples as long as there are enough samples in 'inputBuffer'
// to form a processing frame.
while ((int)inputBuffer.numSamples() >= sampleReq)
{
// If tempo differs from the normal ('SCALE'), scan for the best overlapping
// position
offset = seekBestOverlapPosition(inputBuffer.ptrBegin());
// Mix the samples in the 'inputBuffer' at position of 'offset' with the
// samples in 'midBuffer' using sliding overlapping
// ... first partially overlap with the end of the previous sequence
// (that's in 'midBuffer')
overlap(outputBuffer.ptrEnd((uint)overlapLength), inputBuffer.ptrBegin(), (uint)offset);
outputBuffer.putSamples((uint)overlapLength);
// ... then copy sequence samples from 'inputBuffer' to output:
// length of sequence
temp = (seekWindowLength - 2 * overlapLength);
// crosscheck that we don't have buffer overflow...
if ((int)inputBuffer.numSamples() < (offset + temp + overlapLength * 2))
{
continue; // just in case, shouldn't really happen
}
outputBuffer.putSamples(inputBuffer.ptrBegin() + channels * (offset + overlapLength), (uint)temp);
// Copies the end of the current sequence from 'inputBuffer' to
// 'midBuffer' for being mixed with the beginning of the next
// processing sequence and so on
assert((offset + temp + overlapLength * 2) <= (int)inputBuffer.numSamples());
memcpy(pMidBuffer, inputBuffer.ptrBegin() + channels * (offset + temp + overlapLength),
channels * sizeof(SAMPLETYPE) * overlapLength);
// Remove the processed samples from the input buffer. Update
// the difference between integer & nominal skip step to 'skipFract'
// in order to prevent the error from accumulating over time.
skipFract += nominalSkip; // real skip size
ovlSkip = (int)skipFract; // rounded to integer skip
skipFract -= ovlSkip; // maintain the fraction part, i.e. real vs. integer skip
inputBuffer.receiveSamples((uint)ovlSkip);
}
}
// Adds 'numsamples' pcs of samples from the 'samples' memory position into
// the input of the object.
void TDStretch::putSamples(const SAMPLETYPE *samples, uint nSamples)
{
// Add the samples into the input buffer
inputBuffer.putSamples(samples, nSamples);
// Process the samples in input buffer
processSamples();
}
/// Set new overlap length parameter & reallocate RefMidBuffer if necessary.
void TDStretch::acceptNewOverlapLength(int newOverlapLength)
{
int prevOvl;
assert(newOverlapLength >= 0);
prevOvl = overlapLength;
overlapLength = newOverlapLength;
if (overlapLength > prevOvl)
{
delete[] pMidBufferUnaligned;
pMidBufferUnaligned = new SAMPLETYPE[overlapLength * 2 + 16 / sizeof(SAMPLETYPE)];
// ensure that 'pMidBuffer' is aligned to 16 byte boundary for efficiency
pMidBuffer = (SAMPLETYPE *)SOUNDTOUCH_ALIGN_POINTER_16(pMidBufferUnaligned);
clearMidBuffer();
}
}
// Operator 'new' is overloaded so that it automatically creates a suitable instance
// depending on if we've a MMX/SSE/etc-capable CPU available or not.
void * TDStretch::operator new(size_t s)
{
// Notice! don't use "new TDStretch" directly, use "newInstance" to create a new instance instead!
ST_THROW_RT_ERROR("Error in TDStretch::new: Don't use 'new TDStretch' directly, use 'newInstance' member instead!");
return newInstance();
}
TDStretch * TDStretch::newInstance()
{
uint uExtensions;
uExtensions = detectCPUextensions();
// Check if MMX/SSE instruction set extensions supported by CPU
#ifdef SOUNDTOUCH_ALLOW_MMX
// MMX routines available only with integer sample types
if (uExtensions & SUPPORT_MMX)
{
return ::new TDStretchMMX;
}
else
#endif // SOUNDTOUCH_ALLOW_MMX
#ifdef SOUNDTOUCH_ALLOW_SSE
if (uExtensions & SUPPORT_SSE)
{
// SSE support
return ::new TDStretchSSE;
}
else
#endif // SOUNDTOUCH_ALLOW_SSE
{
// ISA optimizations not supported, use plain C version
return ::new TDStretch;
}
}
//////////////////////////////////////////////////////////////////////////////
//
// Integer arithmetics specific algorithm implementations.
//
//////////////////////////////////////////////////////////////////////////////
#ifdef SOUNDTOUCH_INTEGER_SAMPLES
// Overlaps samples in 'midBuffer' with the samples in 'input'. The 'Stereo'
// version of the routine.
void TDStretch::overlapStereo(short *poutput, const short *input) const
{
int i;
short temp;
int cnt2;
for (i = 0; i < overlapLength ; i ++)
{
temp = (short)(overlapLength - i);
cnt2 = 2 * i;
poutput[cnt2] = (input[cnt2] * i + pMidBuffer[cnt2] * temp ) / overlapLength;
poutput[cnt2 + 1] = (input[cnt2 + 1] * i + pMidBuffer[cnt2 + 1] * temp ) / overlapLength;
}
}
// Calculates the x having the closest 2^x value for the given value
static int _getClosest2Power(double value)
{
return (int)(log(value) / log(2.0) + 0.5);
}
/// Calculates overlap period length in samples.
/// Integer version rounds overlap length to closest power of 2
/// for a divide scaling operation.
void TDStretch::calculateOverlapLength(int aoverlapMs)
{
int newOvl;
assert(aoverlapMs >= 0);
// calculate overlap length so that it's power of 2 - thus it's easy to do
// integer division by right-shifting. Term "-1" at end is to account for
// the extra most significatnt bit left unused in result by signed multiplication
overlapDividerBits = _getClosest2Power((sampleRate * aoverlapMs) / 1000.0) - 1;
if (overlapDividerBits > 9) overlapDividerBits = 9;
if (overlapDividerBits < 3) overlapDividerBits = 3;
newOvl = (int)pow(2.0, (int)overlapDividerBits + 1); // +1 => account for -1 above
acceptNewOverlapLength(newOvl);
// calculate sloping divider so that crosscorrelation operation won't
// overflow 32-bit register. Max. sum of the crosscorrelation sum without
// divider would be 2^30*(N^3-N)/3, where N = overlap length
slopingDivider = (newOvl * newOvl - 1) / 3;
}
double TDStretch::calcCrossCorr(const short *mixingPos, const short *compare) const
{
long corr;
long norm;
int i;
corr = norm = 0;
// Same routine for stereo and mono. For stereo, unroll loop for better
// efficiency and gives slightly better resolution against rounding.
// For mono it same routine, just unrolls loop by factor of 4
for (i = 0; i < channels * overlapLength; i += 4)
{
corr += (mixingPos[i] * compare[i] +
mixingPos[i + 1] * compare[i + 1] +
mixingPos[i + 2] * compare[i + 2] +
mixingPos[i + 3] * compare[i + 3]) >> overlapDividerBits;
norm += (mixingPos[i] * mixingPos[i] +
mixingPos[i + 1] * mixingPos[i + 1] +
mixingPos[i + 2] * mixingPos[i + 2] +
mixingPos[i + 3] * mixingPos[i + 3]) >> overlapDividerBits;
}
// Normalize result by dividing by sqrt(norm) - this step is easiest
// done using floating point operation
if (norm == 0) norm = 1; // to avoid div by zero
return (double)corr / sqrt((double)norm);
}
#endif // SOUNDTOUCH_INTEGER_SAMPLES
//////////////////////////////////////////////////////////////////////////////
//
// Floating point arithmetics specific algorithm implementations.
//
#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// Overlaps samples in 'midBuffer' with the samples in 'pInput'
void TDStretch::overlapStereo(float *pOutput, const float *pInput) const
{
int i;
float fScale;
float f1;
float f2;
fScale = 1.0f / (float)overlapLength;
f1 = 0;
f2 = 1.0f;
for (i = 0; i < 2 * (int)overlapLength ; i += 2)
{
pOutput[i + 0] = pInput[i + 0] * f1 + pMidBuffer[i + 0] * f2;
pOutput[i + 1] = pInput[i + 1] * f1 + pMidBuffer[i + 1] * f2;
f1 += fScale;
f2 -= fScale;
}
}
/// Calculates overlapInMsec period length in samples.
void TDStretch::calculateOverlapLength(int overlapInMsec)
{
int newOvl;
assert(overlapInMsec >= 0);
newOvl = (sampleRate * overlapInMsec) / 1000;
if (newOvl < 16) newOvl = 16;
// must be divisible by 8
newOvl -= newOvl % 8;
acceptNewOverlapLength(newOvl);
}
double TDStretch::calcCrossCorr(const float *mixingPos, const float *compare) const
{
double corr;
double norm;
int i;
corr = norm = 0;
// Same routine for stereo and mono. For Stereo, unroll by factor of 2.
// For mono it's same routine yet unrollsd by factor of 4.
for (i = 0; i < channels * overlapLength; i += 4)
{
corr += mixingPos[i] * compare[i] +
mixingPos[i + 1] * compare[i + 1];
norm += mixingPos[i] * mixingPos[i] +
mixingPos[i + 1] * mixingPos[i + 1];
// unroll the loop for better CPU efficiency:
corr += mixingPos[i + 2] * compare[i + 2] +
mixingPos[i + 3] * compare[i + 3];
norm += mixingPos[i + 2] * mixingPos[i + 2] +
mixingPos[i + 3] * mixingPos[i + 3];
}
if (norm < 1e-9) norm = 1.0; // to avoid div by zero
return corr / sqrt(norm);
}
#endif // SOUNDTOUCH_FLOAT_SAMPLES

View File

@@ -1,745 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
///
/// Classes for easy reading & writing of WAV sound files.
///
/// For big-endian CPU, define _BIG_ENDIAN_ during compile-time to correctly
/// parse the WAV files with such processors.
///
/// Admittingly, more complete WAV reader routines may exist in public domain,
/// but the reason for 'yet another' one is that those generic WAV reader
/// libraries are exhaustingly large and cumbersome! Wanted to have something
/// simpler here, i.e. something that's not already larger than rest of the
/// SoundTouch/SoundStretch program...
///
/// Author : Copyright (c) Olli Parviainen
/// Author e-mail : oparviai 'at' iki.fi
/// SoundTouch WWW: http://www.surina.net/soundtouch
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $
// File revision : $Revision: 4 $
//
// $Id: WavFile.cpp 63 2009-02-21 16:00:14Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
// License :
//
// SoundTouch audio processing library
// Copyright (c) Olli Parviainen
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <stdexcept>
#include <string>
#include <cstring>
#include <assert.h>
#include <limits.h>
#include "WavFile.h"
using namespace std;
static const char riffStr[] = "RIFF";
static const char waveStr[] = "WAVE";
static const char fmtStr[] = "fmt ";
static const char dataStr[] = "data";
//////////////////////////////////////////////////////////////////////////////
//
// Helper functions for swapping byte order to correctly read/write WAV files
// with big-endian CPU's: Define compile-time definition _BIG_ENDIAN_ to
// turn-on the conversion if it appears necessary.
//
// For example, Intel x86 is little-endian and doesn't require conversion,
// while PowerPC of Mac's and many other RISC cpu's are big-endian.
#ifdef BYTE_ORDER
// In gcc compiler detect the byte order automatically
#if BYTE_ORDER == BIG_ENDIAN
// big-endian platform.
#define _BIG_ENDIAN_
#endif
#endif
#ifdef _BIG_ENDIAN_
// big-endian CPU, swap bytes in 16 & 32 bit words
// helper-function to swap byte-order of 32bit integer
static inline void _swap32(unsigned int &dwData)
{
dwData = ((dwData >> 24) & 0x000000FF) |
((dwData >> 8) & 0x0000FF00) |
((dwData << 8) & 0x00FF0000) |
((dwData << 24) & 0xFF000000);
}
// helper-function to swap byte-order of 16bit integer
static inline void _swap16(unsigned short &wData)
{
wData = ((wData >> 8) & 0x00FF) |
((wData << 8) & 0xFF00);
}
// helper-function to swap byte-order of buffer of 16bit integers
static inline void _swap16Buffer(unsigned short *pData, unsigned int dwNumWords)
{
unsigned long i;
for (i = 0; i < dwNumWords; i ++)
{
_swap16(pData[i]);
}
}
#else // BIG_ENDIAN
// little-endian CPU, WAV file is ok as such
// dummy helper-function
static inline void _swap32(unsigned int &dwData)
{
// do nothing
}
// dummy helper-function
static inline void _swap16(unsigned short &wData)
{
// do nothing
}
// dummy helper-function
static inline void _swap16Buffer(unsigned short *pData, unsigned int dwNumBytes)
{
// do nothing
}
#endif // BIG_ENDIAN
//////////////////////////////////////////////////////////////////////////////
//
// Class WavInFile
//
WavInFile::WavInFile(const char *fileName)
{
// Try to open the file for reading
fptr = fopen(fileName, "rb");
if (fptr == NULL)
{
// didn't succeed
string msg = "Error : Unable to open file \"";
msg += fileName;
msg += "\" for reading.";
throw runtime_error(msg);
}
init();
}
WavInFile::WavInFile(FILE *file)
{
// Try to open the file for reading
fptr = file;
if (!file)
{
// didn't succeed
string msg = "Error : Unable to access input stream for reading";
throw runtime_error(msg);
}
init();
}
/// Init the WAV file stream
void WavInFile::init()
{
int hdrsOk;
// assume file stream is already open
assert(fptr);
// Read the file headers
hdrsOk = readWavHeaders();
if (hdrsOk != 0)
{
// Something didn't match in the wav file headers
string msg = "Input file is corrupt or not a WAV file";
throw runtime_error(msg);
}
if (header.format.fixed != 1)
{
string msg = "Input file uses unsupported encoding.";
throw runtime_error(msg);
}
dataRead = 0;
}
WavInFile::~WavInFile()
{
if (fptr) fclose(fptr);
fptr = NULL;
}
void WavInFile::rewind()
{
int hdrsOk;
fseek(fptr, 0, SEEK_SET);
hdrsOk = readWavHeaders();
assert(hdrsOk == 0);
dataRead = 0;
}
int WavInFile::checkCharTags() const
{
// header.format.fmt should equal to 'fmt '
if (memcmp(fmtStr, header.format.fmt, 4) != 0) return -1;
// header.data.data_field should equal to 'data'
if (memcmp(dataStr, header.data.data_field, 4) != 0) return -1;
return 0;
}
int WavInFile::read(char *buffer, int maxElems)
{
int numBytes;
uint afterDataRead;
// ensure it's 8 bit format
if (header.format.bits_per_sample != 8)
{
throw runtime_error("Error: WavInFile::read(char*, int) works only with 8bit samples.");
}
assert(sizeof(char) == 1);
numBytes = maxElems;
afterDataRead = dataRead + numBytes;
if (afterDataRead > header.data.data_len)
{
// Don't read more samples than are marked available in header
numBytes = (int)header.data.data_len - (int)dataRead;
assert(numBytes >= 0);
}
assert(buffer);
numBytes = fread(buffer, 1, numBytes, fptr);
dataRead += numBytes;
return numBytes;
}
int WavInFile::read(short *buffer, int maxElems)
{
unsigned int afterDataRead;
int numBytes;
int numElems;
assert(buffer);
if (header.format.bits_per_sample == 8)
{
// 8 bit format
char *temp = new char[maxElems];
int i;
numElems = read(temp, maxElems);
// convert from 8 to 16 bit
for (i = 0; i < numElems; i ++)
{
buffer[i] = temp[i] << 8;
}
delete[] temp;
}
else
{
// 16 bit format
assert(header.format.bits_per_sample == 16);
assert(sizeof(short) == 2);
numBytes = maxElems * 2;
afterDataRead = dataRead + numBytes;
if (afterDataRead > header.data.data_len)
{
// Don't read more samples than are marked available in header
numBytes = (int)header.data.data_len - (int)dataRead;
assert(numBytes >= 0);
}
numBytes = fread(buffer, 1, numBytes, fptr);
dataRead += numBytes;
numElems = numBytes / 2;
// 16bit samples, swap byte order if necessary
_swap16Buffer((unsigned short *)buffer, numElems);
}
return numElems;
}
int WavInFile::read(float *buffer, int maxElems)
{
short *temp = new short[maxElems];
int num;
int i;
double fscale;
num = read(temp, maxElems);
fscale = 1.0 / 32768.0;
// convert to floats, scale to range [-1..+1[
for (i = 0; i < num; i ++)
{
buffer[i] = (float)(fscale * (double)temp[i]);
}
delete[] temp;
return num;
}
int WavInFile::eof() const
{
// return true if all data has been read or file eof has reached
return (dataRead == header.data.data_len || feof(fptr));
}
// test if character code is between a white space ' ' and little 'z'
static int isAlpha(char c)
{
return (c >= ' ' && c <= 'z') ? 1 : 0;
}
// test if all characters are between a white space ' ' and little 'z'
static int isAlphaStr(const char *str)
{
char c;
c = str[0];
while (c)
{
if (isAlpha(c) == 0) return 0;
str ++;
c = str[0];
}
return 1;
}
int WavInFile::readRIFFBlock()
{
if (fread(&(header.riff), sizeof(WavRiff), 1, fptr) != 1) return -1;
// swap 32bit data byte order if necessary
_swap32((unsigned int &)header.riff.package_len);
// header.riff.riff_char should equal to 'RIFF');
if (memcmp(riffStr, header.riff.riff_char, 4) != 0) return -1;
// header.riff.wave should equal to 'WAVE'
if (memcmp(waveStr, header.riff.wave, 4) != 0) return -1;
return 0;
}
int WavInFile::readHeaderBlock()
{
char label[5];
string sLabel;
// lead label string
if (fread(label, 1, 4, fptr) !=4) return -1;
label[4] = 0;
if (isAlphaStr(label) == 0) return -1; // not a valid label
// Decode blocks according to their label
if (strcmp(label, fmtStr) == 0)
{
int nLen, nDump;
// 'fmt ' block
memcpy(header.format.fmt, fmtStr, 4);
// read length of the format field
if (fread(&nLen, sizeof(int), 1, fptr) != 1) return -1;
// swap byte order if necessary
_swap32((unsigned int &)nLen); // int format_len;
header.format.format_len = nLen;
// calculate how much length differs from expected
nDump = nLen - ((int)sizeof(header.format) - 8);
// if format_len is larger than expected, read only as much data as we've space for
if (nDump > 0)
{
nLen = sizeof(header.format) - 8;
}
// read data
if (fread(&(header.format.fixed), nLen, 1, fptr) != 1) return -1;
// swap byte order if necessary
_swap16((unsigned short &)header.format.fixed); // short int fixed;
_swap16((unsigned short &)header.format.channel_number); // short int channel_number;
_swap32((unsigned int &)header.format.sample_rate); // int sample_rate;
_swap32((unsigned int &)header.format.byte_rate); // int byte_rate;
_swap16((unsigned short &)header.format.byte_per_sample); // short int byte_per_sample;
_swap16((unsigned short &)header.format.bits_per_sample); // short int bits_per_sample;
// if format_len is larger than expected, skip the extra data
if (nDump > 0)
{
fseek(fptr, nDump, SEEK_CUR);
}
return 0;
}
else if (strcmp(label, dataStr) == 0)
{
// 'data' block
memcpy(header.data.data_field, dataStr, 4);
if (fread(&(header.data.data_len), sizeof(uint), 1, fptr) != 1) return -1;
// swap byte order if necessary
_swap32((unsigned int &)header.data.data_len);
return 1;
}
else
{
uint len, i;
uint temp;
// unknown block
// read length
if (fread(&len, sizeof(len), 1, fptr) != 1) return -1;
// scan through the block
for (i = 0; i < len; i ++)
{
if (fread(&temp, 1, 1, fptr) != 1) return -1;
if (feof(fptr)) return -1; // unexpected eof
}
}
return 0;
}
int WavInFile::readWavHeaders()
{
int res;
memset(&header, 0, sizeof(header));
res = readRIFFBlock();
if (res) return 1;
// read header blocks until data block is found
do
{
// read header blocks
res = readHeaderBlock();
if (res < 0) return 1; // error in file structure
} while (res == 0);
// check that all required tags are legal
return checkCharTags();
}
uint WavInFile::getNumChannels() const
{
return header.format.channel_number;
}
uint WavInFile::getNumBits() const
{
return header.format.bits_per_sample;
}
uint WavInFile::getBytesPerSample() const
{
return getNumChannels() * getNumBits() / 8;
}
uint WavInFile::getSampleRate() const
{
return header.format.sample_rate;
}
uint WavInFile::getDataSizeInBytes() const
{
return header.data.data_len;
}
uint WavInFile::getNumSamples() const
{
if (header.format.byte_per_sample == 0) return 0;
return header.data.data_len / (unsigned short)header.format.byte_per_sample;
}
uint WavInFile::getLengthMS() const
{
uint numSamples;
uint sampleRate;
numSamples = getNumSamples();
sampleRate = getSampleRate();
assert(numSamples < UINT_MAX / 1000);
return (1000 * numSamples / sampleRate);
}
//////////////////////////////////////////////////////////////////////////////
//
// Class WavOutFile
//
WavOutFile::WavOutFile(const char *fileName, int sampleRate, int bits, int channels)
{
bytesWritten = 0;
fptr = fopen(fileName, "wb");
if (fptr == NULL)
{
string msg = "Error : Unable to open file \"";
msg += fileName;
msg += "\" for writing.";
//pmsg = msg.c_str;
throw runtime_error(msg);
}
fillInHeader(sampleRate, bits, channels);
writeHeader();
}
WavOutFile::WavOutFile(FILE *file, int sampleRate, int bits, int channels)
{
bytesWritten = 0;
fptr = file;
if (fptr == NULL)
{
string msg = "Error : Unable to access output file stream.";
throw runtime_error(msg);
}
fillInHeader(sampleRate, bits, channels);
writeHeader();
}
WavOutFile::~WavOutFile()
{
finishHeader();
if (fptr) fclose(fptr);
fptr = NULL;
}
void WavOutFile::fillInHeader(uint sampleRate, uint bits, uint channels)
{
// fill in the 'riff' part..
// copy string 'RIFF' to riff_char
memcpy(&(header.riff.riff_char), riffStr, 4);
// package_len unknown so far
header.riff.package_len = 0;
// copy string 'WAVE' to wave
memcpy(&(header.riff.wave), waveStr, 4);
// fill in the 'format' part..
// copy string 'fmt ' to fmt
memcpy(&(header.format.fmt), fmtStr, 4);
header.format.format_len = 0x10;
header.format.fixed = 1;
header.format.channel_number = (short)channels;
header.format.sample_rate = (int)sampleRate;
header.format.bits_per_sample = (short)bits;
header.format.byte_per_sample = (short)(bits * channels / 8);
header.format.byte_rate = header.format.byte_per_sample * (int)sampleRate;
header.format.sample_rate = (int)sampleRate;
// fill in the 'data' part..
// copy string 'data' to data_field
memcpy(&(header.data.data_field), dataStr, 4);
// data_len unknown so far
header.data.data_len = 0;
}
void WavOutFile::finishHeader()
{
// supplement the file length into the header structure
header.riff.package_len = bytesWritten + 36;
header.data.data_len = bytesWritten;
writeHeader();
}
void WavOutFile::writeHeader()
{
WavHeader hdrTemp;
int res;
// swap byte order if necessary
hdrTemp = header;
_swap32((unsigned int &)hdrTemp.riff.package_len);
_swap32((unsigned int &)hdrTemp.format.format_len);
_swap16((unsigned short &)hdrTemp.format.fixed);
_swap16((unsigned short &)hdrTemp.format.channel_number);
_swap32((unsigned int &)hdrTemp.format.sample_rate);
_swap32((unsigned int &)hdrTemp.format.byte_rate);
_swap16((unsigned short &)hdrTemp.format.byte_per_sample);
_swap16((unsigned short &)hdrTemp.format.bits_per_sample);
_swap32((unsigned int &)hdrTemp.data.data_len);
// write the supplemented header in the beginning of the file
fseek(fptr, 0, SEEK_SET);
res = fwrite(&hdrTemp, sizeof(hdrTemp), 1, fptr);
if (res != 1)
{
throw runtime_error("Error while writing to a wav file.");
}
// jump back to the end of the file
fseek(fptr, 0, SEEK_END);
}
void WavOutFile::write(const char *buffer, int numElems)
{
int res;
if (header.format.bits_per_sample != 8)
{
throw runtime_error("Error: WavOutFile::write(const char*, int) accepts only 8bit samples.");
}
assert(sizeof(char) == 1);
res = fwrite(buffer, 1, numElems, fptr);
if (res != numElems)
{
throw runtime_error("Error while writing to a wav file.");
}
bytesWritten += numElems;
}
void WavOutFile::write(const short *buffer, int numElems)
{
int res;
// 16 bit samples
if (numElems < 1) return; // nothing to do
if (header.format.bits_per_sample == 8)
{
int i;
char *temp = new char[numElems];
// convert from 16bit format to 8bit format
for (i = 0; i < numElems; i ++)
{
temp[i] = buffer[i] >> 8;
}
// write in 8bit format
write(temp, numElems);
delete[] temp;
}
else
{
// 16bit format
unsigned short *pTemp = new unsigned short[numElems];
assert(header.format.bits_per_sample == 16);
// allocate temp buffer to swap byte order if necessary
memcpy(pTemp, buffer, numElems * 2);
_swap16Buffer(pTemp, numElems);
res = fwrite(pTemp, 2, numElems, fptr);
delete[] pTemp;
if (res != numElems)
{
throw runtime_error("Error while writing to a wav file.");
}
bytesWritten += 2 * numElems;
}
}
void WavOutFile::write(const float *buffer, int numElems)
{
int i;
short *temp = new short[numElems];
int iTemp;
// convert to 16 bit integer
for (i = 0; i < numElems; i ++)
{
// convert to integer
iTemp = (int)(32768.0f * buffer[i]);
// saturate
if (iTemp < -32768) iTemp = -32768;
if (iTemp > 32767) iTemp = 32767;
temp[i] = (short)iTemp;
}
write(temp, numElems);
delete[] temp;
}

View File

@@ -1,28 +0,0 @@
#!/bin/sh
curdir=`pwd`
echo -----------------
echo Building SoundTouch
echo -----------------
if [ $# -gt 0 ] && [ $1 = "all" ]
then
aclocal
automake -a
autoconf
./configure
make clean
make install
else
make $@
fi
if [ $? -ne 0 ]
then
exit 1
fi
#cp libZeroSPU2*.so* ${PCSX2PLUGINS}

View File

@@ -1,37 +0,0 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.63])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([BPMDetect.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_RANLIB
CFLAGS=
CPPFLAGS=
CXXFLAGS=
CCASFLAGS=
CFLAGS+=" -m32 "
CPPFLAGS+=" -m32 "
CXXFLAGS+=" -m32 "
CCASFLAGS+=" -m32 "
# Checks for header files.
AC_CHECK_HEADERS([limits.h memory.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_C_RESTRICT
AC_TYPE_SIZE_T
AC_HEADER_STDBOOL
# Checks for library functions.
AC_CHECK_FUNCS([memmove memset])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View File

@@ -1,134 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
///
/// Generic version of the x86 CPU extension detection routine.
///
/// This file is for GNU & other non-Windows compilers, see 'cpu_detect_x86_win.cpp'
/// for the Microsoft compiler version.
///
/// Author : Copyright (c) Olli Parviainen
/// Author e-mail : oparviai 'at' iki.fi
/// SoundTouch WWW: http://www.surina.net/soundtouch
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2011-09-02 15:56:11 -0300 (sex, 02 set 2011) $
// File revision : $Revision: 4 $
//
// $Id: cpu_detect_x86_gcc.cpp 131 2011-09-02 18:56:11Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
// License :
//
// SoundTouch audio processing library
// Copyright (c) Olli Parviainen
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////////////
#include "cpu_detect.h"
#include "STTypes.h"
//////////////////////////////////////////////////////////////////////////////
//
// processor instructions extension detection routines
//
//////////////////////////////////////////////////////////////////////////////
// Flag variable indicating whick ISA extensions are disabled (for debugging)
static uint _dwDisabledISA = 0x00; // 0xffffffff; //<- use this to disable all extensions
// Disables given set of instruction extensions. See SUPPORT_... defines.
void disableExtensions(uint dwDisableMask)
{
_dwDisabledISA = dwDisableMask;
}
/// Checks which instruction set extensions are supported by the CPU.
uint detectCPUextensions(void)
{
#if (!(SOUNDTOUCH_ALLOW_X86_OPTIMIZATIONS) || !(__GNUC__))
return 0; // always disable extensions on non-x86 platforms.
#else
uint res = 0;
if (_dwDisabledISA == 0xffffffff) return 0;
asm volatile(
#ifndef __x86_64__
// Check if 'cpuid' instructions is available by toggling eflags bit 21.
// Skip this for x86-64 as they always have cpuid while stack manipulation
// differs from 16/32bit ISA.
"\n\txor %%esi, %%esi" // clear %%esi = result register
"\n\tpushf" // save eflags to stack
"\n\tmovl (%%esp), %%eax" // load eax from stack (with eflags)
"\n\tmovl %%eax, %%ecx" // save the original eflags values to ecx
"\n\txor $0x00200000, %%eax" // toggle bit 21
"\n\tmovl %%eax, (%%esp)" // store toggled eflags to stack
"\n\tpopf" // load eflags from stack
"\n\tpushf" // save updated eflags to stack
"\n\tmovl (%%esp), %%eax" // load eax from stack
"\n\tpopf" // pop stack to restore esp
"\n\txor %%edx, %%edx" // clear edx for defaulting no mmx
"\n\tcmp %%ecx, %%eax" // compare to original eflags values
"\n\tjz end" // jumps to 'end' if cpuid not present
#endif // __x86_64__
// cpuid instruction available, test for presence of mmx instructions
"\n\tmovl $1, %%eax"
"\n\tcpuid"
"\n\ttest $0x00800000, %%edx"
"\n\tjz end" // branch if MMX not available
"\n\tor $0x01, %%esi" // otherwise add MMX support bit
"\n\ttest $0x02000000, %%edx"
"\n\tjz test3DNow" // branch if SSE not available
"\n\tor $0x08, %%esi" // otherwise add SSE support bit
"\n\ttest3DNow:"
// test for precense of AMD extensions
"\n\tmov $0x80000000, %%eax"
"\n\tcpuid"
"\n\tcmp $0x80000000, %%eax"
"\n\tjbe end" // branch if no AMD extensions detected
// test for precense of 3DNow! extension
"\n\tmov $0x80000001, %%eax"
"\n\tcpuid"
"\n\ttest $0x80000000, %%edx"
"\n\tjz end" // branch if 3DNow! not detected
"\n\tor $0x02, %%esi" // otherwise add 3DNow support bit
"\n\tend:"
"\n\tmov %%esi, %0"
: "=r" (res)
: /* no inputs */
: "%edx", "%eax", "%ecx", "%esi" );
return res & ~_dwDisabledISA;
#endif
}

View File

@@ -1,137 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
///
/// Win32 version of the x86 CPU detect routine.
///
/// This file is to be compiled in Windows platform with Microsoft Visual C++
/// Compiler. Please see 'cpu_detect_x86_gcc.cpp' for the gcc compiler version
/// for all GNU platforms.
///
/// Author : Copyright (c) Olli Parviainen
/// Author e-mail : oparviai 'at' iki.fi
/// SoundTouch WWW: http://www.surina.net/soundtouch
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2011-07-17 07:58:40 -0300 (dom, 17 jul 2011) $
// File revision : $Revision: 4 $
//
// $Id: cpu_detect_x86_win.cpp 127 2011-07-17 10:58:40Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
// License :
//
// SoundTouch audio processing library
// Copyright (c) Olli Parviainen
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////////////
#include "cpu_detect.h"
#include "STTypes.h"
//////////////////////////////////////////////////////////////////////////////
//
// processor instructions extension detection routines
//
//////////////////////////////////////////////////////////////////////////////
// Flag variable indicating whick ISA extensions are disabled (for debugging)
static uint _dwDisabledISA = 0x00; // 0xffffffff; //<- use this to disable all extensions
// Disables given set of instruction extensions. See SUPPORT_... defines.
void disableExtensions(uint dwDisableMask)
{
_dwDisabledISA = dwDisableMask;
}
/// Checks which instruction set extensions are supported by the CPU.
uint detectCPUextensions(void)
{
uint res = 0;
if (_dwDisabledISA == 0xffffffff) return 0;
#ifndef _M_X64
// 32bit compilation, detect CPU capabilities with inline assembler.
__asm
{
; check if 'cpuid' instructions is available by toggling eflags bit 21
;
xor esi, esi ; clear esi = result register
pushfd ; save eflags to stack
mov eax,dword ptr [esp] ; load eax from stack (with eflags)
mov ecx, eax ; save the original eflags values to ecx
xor eax, 0x00200000 ; toggle bit 21
mov dword ptr [esp],eax ; store toggled eflags to stack
popfd ; load eflags from stack
pushfd ; save updated eflags to stack
mov eax,dword ptr [esp] ; load eax from stack
popfd ; pop stack to restore stack pointer
xor edx, edx ; clear edx for defaulting no mmx
cmp eax, ecx ; compare to original eflags values
jz end ; jumps to 'end' if cpuid not present
; cpuid instruction available, test for presence of mmx instructions
mov eax, 1
cpuid
test edx, 0x00800000
jz end ; branch if MMX not available
or esi, SUPPORT_MMX ; otherwise add MMX support bit
test edx, 0x02000000
jz test3DNow ; branch if SSE not available
or esi, SUPPORT_SSE ; otherwise add SSE support bit
test3DNow:
; test for precense of AMD extensions
mov eax, 0x80000000
cpuid
cmp eax, 0x80000000
jbe end ; branch if no AMD extensions detected
; test for precense of 3DNow! extension
mov eax, 0x80000001
cpuid
test edx, 0x80000000
jz end ; branch if 3DNow! not detected
or esi, SUPPORT_3DNOW ; otherwise add 3DNow support bit
end:
mov res, esi
}
#else
// Visual C++ 64bit compilation doesn't support inline assembler. However,
// all x64 compatible CPUs support MMX & SSE extensions.
res = SUPPORT_MMX | SUPPORT_SSE | SUPPORT_SSE2;
#endif
return res & ~_dwDisabledISA;
}

View File

@@ -1 +0,0 @@
/usr/share/automake-1.10/depcomp

View File

@@ -1 +0,0 @@
/usr/share/automake-1.10/install-sh

View File

@@ -1 +0,0 @@
/usr/share/automake-1.10/missing

View File

@@ -1,317 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
///
/// MMX optimized routines. All MMX optimized functions have been gathered into
/// this single source code file, regardless to their class or original source
/// code file, in order to ease porting the library to other compiler and
/// processor platforms.
///
/// The MMX-optimizations are programmed using MMX compiler intrinsics that
/// are supported both by Microsoft Visual C++ and GCC compilers, so this file
/// should compile with both toolsets.
///
/// NOTICE: If using Visual Studio 6.0, you'll need to install the "Visual C++
/// 6.0 processor pack" update to support compiler intrinsic syntax. The update
/// is available for download at Microsoft Developers Network, see here:
/// http://msdn.microsoft.com/en-us/vstudio/aa718349.aspx
///
/// Author : Copyright (c) Olli Parviainen
/// Author e-mail : oparviai 'at' iki.fi
/// SoundTouch WWW: http://www.surina.net/soundtouch
///
////////////////////////////////////////////////////////////////////////////////
//
// Last changed : $Date: 2012-11-08 16:53:01 -0200 (qui, 08 nov 2012) $
// File revision : $Revision: 4 $
//
// $Id: mmx_optimized.cpp 160 2012-11-08 18:53:01Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
// License :
//
// SoundTouch audio processing library
// Copyright (c) Olli Parviainen
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
////////////////////////////////////////////////////////////////////////////////
#include "STTypes.h"
#ifdef SOUNDTOUCH_ALLOW_MMX
// MMX routines available only with integer sample type
using namespace soundtouch;
//////////////////////////////////////////////////////////////////////////////
//
// implementation of MMX optimized functions of class 'TDStretchMMX'
//
//////////////////////////////////////////////////////////////////////////////
#include "TDStretch.h"
#include <mmintrin.h>
#include <limits.h>
#include <math.h>
// Calculates cross correlation of two buffers
double TDStretchMMX::calcCrossCorr(const short *pV1, const short *pV2) const
{
const __m64 *pVec1, *pVec2;
__m64 shifter;
__m64 accu, normaccu;
long corr, norm;
int i;
pVec1 = (__m64*)pV1;
pVec2 = (__m64*)pV2;
shifter = _m_from_int(overlapDividerBits);
normaccu = accu = _mm_setzero_si64();
// Process 4 parallel sets of 2 * stereo samples or 4 * mono samples
// during each round for improved CPU-level parallellization.
for (i = 0; i < channels * overlapLength / 16; i ++)
{
__m64 temp, temp2;
// dictionary of instructions:
// _m_pmaddwd : 4*16bit multiply-add, resulting two 32bits = [a0*b0+a1*b1 ; a2*b2+a3*b3]
// _mm_add_pi32 : 2*32bit add
// _m_psrad : 32bit right-shift
temp = _mm_add_pi32(_mm_madd_pi16(pVec1[0], pVec2[0]),
_mm_madd_pi16(pVec1[1], pVec2[1]));
temp2 = _mm_add_pi32(_mm_madd_pi16(pVec1[0], pVec1[0]),
_mm_madd_pi16(pVec1[1], pVec1[1]));
accu = _mm_add_pi32(accu, _mm_sra_pi32(temp, shifter));
normaccu = _mm_add_pi32(normaccu, _mm_sra_pi32(temp2, shifter));
temp = _mm_add_pi32(_mm_madd_pi16(pVec1[2], pVec2[2]),
_mm_madd_pi16(pVec1[3], pVec2[3]));
temp2 = _mm_add_pi32(_mm_madd_pi16(pVec1[2], pVec1[2]),
_mm_madd_pi16(pVec1[3], pVec1[3]));
accu = _mm_add_pi32(accu, _mm_sra_pi32(temp, shifter));
normaccu = _mm_add_pi32(normaccu, _mm_sra_pi32(temp2, shifter));
pVec1 += 4;
pVec2 += 4;
}
// copy hi-dword of mm0 to lo-dword of mm1, then sum mmo+mm1
// and finally store the result into the variable "corr"
accu = _mm_add_pi32(accu, _mm_srli_si64(accu, 32));
corr = _m_to_int(accu);
normaccu = _mm_add_pi32(normaccu, _mm_srli_si64(normaccu, 32));
norm = _m_to_int(normaccu);
// Clear MMS state
_m_empty();
// Normalize result by dividing by sqrt(norm) - this step is easiest
// done using floating point operation
if (norm == 0) norm = 1; // to avoid div by zero
return (double)corr / sqrt((double)norm);
// Note: Warning about the missing EMMS instruction is harmless
// as it'll be called elsewhere.
}
void TDStretchMMX::clearCrossCorrState()
{
// Clear MMS state
_m_empty();
//_asm EMMS;
}
// MMX-optimized version of the function overlapStereo
void TDStretchMMX::overlapStereo(short *output, const short *input) const
{
const __m64 *pVinput, *pVMidBuf;
__m64 *pVdest;
__m64 mix1, mix2, adder, shifter;
int i;
pVinput = (const __m64*)input;
pVMidBuf = (const __m64*)pMidBuffer;
pVdest = (__m64*)output;
// mix1 = mixer values for 1st stereo sample
// mix1 = mixer values for 2nd stereo sample
// adder = adder for updating mixer values after each round
mix1 = _mm_set_pi16(0, overlapLength, 0, overlapLength);
adder = _mm_set_pi16(1, -1, 1, -1);
mix2 = _mm_add_pi16(mix1, adder);
adder = _mm_add_pi16(adder, adder);
// Overlaplength-division by shifter. "+1" is to account for "-1" deduced in
// overlapDividerBits calculation earlier.
shifter = _m_from_int(overlapDividerBits + 1);
for (i = 0; i < overlapLength / 4; i ++)
{
__m64 temp1, temp2;
// load & shuffle data so that input & mixbuffer data samples are paired
temp1 = _mm_unpacklo_pi16(pVMidBuf[0], pVinput[0]); // = i0l m0l i0r m0r
temp2 = _mm_unpackhi_pi16(pVMidBuf[0], pVinput[0]); // = i1l m1l i1r m1r
// temp = (temp .* mix) >> shifter
temp1 = _mm_sra_pi32(_mm_madd_pi16(temp1, mix1), shifter);
temp2 = _mm_sra_pi32(_mm_madd_pi16(temp2, mix2), shifter);
pVdest[0] = _mm_packs_pi32(temp1, temp2); // pack 2*2*32bit => 4*16bit
// update mix += adder
mix1 = _mm_add_pi16(mix1, adder);
mix2 = _mm_add_pi16(mix2, adder);
// --- second round begins here ---
// load & shuffle data so that input & mixbuffer data samples are paired
temp1 = _mm_unpacklo_pi16(pVMidBuf[1], pVinput[1]); // = i2l m2l i2r m2r
temp2 = _mm_unpackhi_pi16(pVMidBuf[1], pVinput[1]); // = i3l m3l i3r m3r
// temp = (temp .* mix) >> shifter
temp1 = _mm_sra_pi32(_mm_madd_pi16(temp1, mix1), shifter);
temp2 = _mm_sra_pi32(_mm_madd_pi16(temp2, mix2), shifter);
pVdest[1] = _mm_packs_pi32(temp1, temp2); // pack 2*2*32bit => 4*16bit
// update mix += adder
mix1 = _mm_add_pi16(mix1, adder);
mix2 = _mm_add_pi16(mix2, adder);
pVinput += 2;
pVMidBuf += 2;
pVdest += 2;
}
_m_empty(); // clear MMS state
}
//////////////////////////////////////////////////////////////////////////////
//
// implementation of MMX optimized functions of class 'FIRFilter'
//
//////////////////////////////////////////////////////////////////////////////
#include "FIRFilter.h"
FIRFilterMMX::FIRFilterMMX() : FIRFilter()
{
filterCoeffsUnalign = NULL;
}
FIRFilterMMX::~FIRFilterMMX()
{
delete[] filterCoeffsUnalign;
}
// (overloaded) Calculates filter coefficients for MMX routine
void FIRFilterMMX::setCoefficients(const short *coeffs, uint newLength, uint uResultDivFactor)
{
uint i;
FIRFilter::setCoefficients(coeffs, newLength, uResultDivFactor);
// Ensure that filter coeffs array is aligned to 16-byte boundary
delete[] filterCoeffsUnalign;
filterCoeffsUnalign = new short[2 * newLength + 8];
filterCoeffsAlign = (short *)SOUNDTOUCH_ALIGN_POINTER_16(filterCoeffsUnalign);
// rearrange the filter coefficients for mmx routines
for (i = 0;i < length; i += 4)
{
filterCoeffsAlign[2 * i + 0] = coeffs[i + 0];
filterCoeffsAlign[2 * i + 1] = coeffs[i + 2];
filterCoeffsAlign[2 * i + 2] = coeffs[i + 0];
filterCoeffsAlign[2 * i + 3] = coeffs[i + 2];
filterCoeffsAlign[2 * i + 4] = coeffs[i + 1];
filterCoeffsAlign[2 * i + 5] = coeffs[i + 3];
filterCoeffsAlign[2 * i + 6] = coeffs[i + 1];
filterCoeffsAlign[2 * i + 7] = coeffs[i + 3];
}
}
// mmx-optimized version of the filter routine for stereo sound
uint FIRFilterMMX::evaluateFilterStereo(short *dest, const short *src, uint numSamples) const
{
// Create stack copies of the needed member variables for asm routines :
uint i, j;
__m64 *pVdest = (__m64*)dest;
if (length < 2) return 0;
for (i = 0; i < (numSamples - length) / 2; i ++)
{
__m64 accu1;
__m64 accu2;
const __m64 *pVsrc = (const __m64*)src;
const __m64 *pVfilter = (const __m64*)filterCoeffsAlign;
accu1 = accu2 = _mm_setzero_si64();
for (j = 0; j < lengthDiv8 * 2; j ++)
{
__m64 temp1, temp2;
temp1 = _mm_unpacklo_pi16(pVsrc[0], pVsrc[1]); // = l2 l0 r2 r0
temp2 = _mm_unpackhi_pi16(pVsrc[0], pVsrc[1]); // = l3 l1 r3 r1
accu1 = _mm_add_pi32(accu1, _mm_madd_pi16(temp1, pVfilter[0])); // += l2*f2+l0*f0 r2*f2+r0*f0
accu1 = _mm_add_pi32(accu1, _mm_madd_pi16(temp2, pVfilter[1])); // += l3*f3+l1*f1 r3*f3+r1*f1
temp1 = _mm_unpacklo_pi16(pVsrc[1], pVsrc[2]); // = l4 l2 r4 r2
accu2 = _mm_add_pi32(accu2, _mm_madd_pi16(temp2, pVfilter[0])); // += l3*f2+l1*f0 r3*f2+r1*f0
accu2 = _mm_add_pi32(accu2, _mm_madd_pi16(temp1, pVfilter[1])); // += l4*f3+l2*f1 r4*f3+r2*f1
// accu1 += l2*f2+l0*f0 r2*f2+r0*f0
// += l3*f3+l1*f1 r3*f3+r1*f1
// accu2 += l3*f2+l1*f0 r3*f2+r1*f0
// l4*f3+l2*f1 r4*f3+r2*f1
pVfilter += 2;
pVsrc += 2;
}
// accu >>= resultDivFactor
accu1 = _mm_srai_pi32(accu1, resultDivFactor);
accu2 = _mm_srai_pi32(accu2, resultDivFactor);
// pack 2*2*32bits => 4*16 bits
pVdest[0] = _mm_packs_pi32(accu1, accu2);
src += 4;
pVdest ++;
}
_m_empty(); // clear emms state
return (numSamples & 0xfffffffe) - length;
}
#endif // SOUNDTOUCH_ALLOW_MMX

View File

@@ -1,7 +0,0 @@
#ifndef SOUNDTOUCH_CONFIG_H_INCLUDED
#define SOUNDTOUCH_CONFIG_H_INCLUDED
#endif // SOUNDTOUCH_CONFIG_H_INCLUDED

327
3rdparty/bzip2/CHANGES vendored Normal file
View File

@@ -0,0 +1,327 @@
------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------
0.9.0
~~~~~
First version.
0.9.0a
~~~~~~
Removed 'ranlib' from Makefile, since most modern Unix-es
don't need it, or even know about it.
0.9.0b
~~~~~~
Fixed a problem with error reporting in bzip2.c. This does not effect
the library in any way. Problem is: versions 0.9.0 and 0.9.0a (of the
program proper) compress and decompress correctly, but give misleading
error messages (internal panics) when an I/O error occurs, instead of
reporting the problem correctly. This shouldn't give any data loss
(as far as I can see), but is confusing.
Made the inline declarations disappear for non-GCC compilers.
0.9.0c
~~~~~~
Fixed some problems in the library pertaining to some boundary cases.
This makes the library behave more correctly in those situations. The
fixes apply only to features (calls and parameters) not used by
bzip2.c, so the non-fixedness of them in previous versions has no
effect on reliability of bzip2.c.
In bzlib.c:
* made zero-length BZ_FLUSH work correctly in bzCompress().
* fixed bzWrite/bzRead to ignore zero-length requests.
* fixed bzread to correctly handle read requests after EOF.
* wrong parameter order in call to bzDecompressInit in
bzBuffToBuffDecompress. Fixed.
In compress.c:
* changed setting of nGroups in sendMTFValues() so as to
do a bit better on small files. This _does_ effect
bzip2.c.
0.9.5a
~~~~~~
Major change: add a fallback sorting algorithm (blocksort.c)
to give reasonable behaviour even for very repetitive inputs.
Nuked --repetitive-best and --repetitive-fast since they are
no longer useful.
Minor changes: mostly a whole bunch of small changes/
bugfixes in the driver (bzip2.c). Changes pertaining to the
user interface are:
allow decompression of symlink'd files to stdout
decompress/test files even without .bz2 extension
give more accurate error messages for I/O errors
when compressing/decompressing to stdout, don't catch control-C
read flags from BZIP2 and BZIP environment variables
decline to break hard links to a file unless forced with -f
allow -c flag even with no filenames
preserve file ownerships as far as possible
make -s -1 give the expected block size (100k)
add a flag -q --quiet to suppress nonessential warnings
stop decoding flags after --, so files beginning in - can be handled
resolved inconsistent naming: bzcat or bz2cat ?
bzip2 --help now returns 0
Programming-level changes are:
fixed syntax error in GET_LL4 for Borland C++ 5.02
let bzBuffToBuffDecompress return BZ_DATA_ERROR{_MAGIC}
fix overshoot of mode-string end in bzopen_or_bzdopen
wrapped bzlib.h in #ifdef __cplusplus ... extern "C" { ... }
close file handles under all error conditions
added minor mods so it compiles with DJGPP out of the box
fixed Makefile so it doesn't give problems with BSD make
fix uninitialised memory reads in dlltest.c
0.9.5b
~~~~~~
Open stdin/stdout in binary mode for DJGPP.
0.9.5c
~~~~~~
Changed BZ_N_OVERSHOOT to be ... + 2 instead of ... + 1. The + 1
version could cause the sorted order to be wrong in some extremely
obscure cases. Also changed setting of quadrant in blocksort.c.
0.9.5d
~~~~~~
The only functional change is to make bzlibVersion() in the library
return the correct string. This has no effect whatsoever on the
functioning of the bzip2 program or library. Added a couple of casts
so the library compiles without warnings at level 3 in MS Visual
Studio 6.0. Included a Y2K statement in the file Y2K_INFO. All other
changes are minor documentation changes.
1.0
~~~
Several minor bugfixes and enhancements:
* Large file support. The library uses 64-bit counters to
count the volume of data passing through it. bzip2.c
is now compiled with -D_FILE_OFFSET_BITS=64 to get large
file support from the C library. -v correctly prints out
file sizes greater than 4 gigabytes. All these changes have
been made without assuming a 64-bit platform or a C compiler
which supports 64-bit ints, so, except for the C library
aspect, they are fully portable.
* Decompression robustness. The library/program should be
robust to any corruption of compressed data, detecting and
handling _all_ corruption, instead of merely relying on
the CRCs. What this means is that the program should
never crash, given corrupted data, and the library should
always return BZ_DATA_ERROR.
* Fixed an obscure race-condition bug only ever observed on
Solaris, in which, if you were very unlucky and issued
control-C at exactly the wrong time, both input and output
files would be deleted.
* Don't run out of file handles on test/decompression when
large numbers of files have invalid magic numbers.
* Avoid library namespace pollution. Prefix all exported
symbols with BZ2_.
* Minor sorting enhancements from my DCC2000 paper.
* Advance the version number to 1.0, so as to counteract the
(false-in-this-case) impression some people have that programs
with version numbers less than 1.0 are in some way, experimental,
pre-release versions.
* Create an initial Makefile-libbz2_so to build a shared library.
Yes, I know I should really use libtool et al ...
* Make the program exit with 2 instead of 0 when decompression
fails due to a bad magic number (ie, an invalid bzip2 header).
Also exit with 1 (as the manual claims :-) whenever a diagnostic
message would have been printed AND the corresponding operation
is aborted, for example
bzip2: Output file xx already exists.
When a diagnostic message is printed but the operation is not
aborted, for example
bzip2: Can't guess original name for wurble -- using wurble.out
then the exit value 0 is returned, unless some other problem is
also detected.
I think it corresponds more closely to what the manual claims now.
1.0.1
~~~~~
* Modified dlltest.c so it uses the new BZ2_ naming scheme.
* Modified makefile-msc to fix minor build probs on Win2k.
* Updated README.COMPILATION.PROBLEMS.
There are no functionality changes or bug fixes relative to version
1.0.0. This is just a documentation update + a fix for minor Win32
build problems. For almost everyone, upgrading from 1.0.0 to 1.0.1 is
utterly pointless. Don't bother.
1.0.2
~~~~~
A bug fix release, addressing various minor issues which have appeared
in the 18 or so months since 1.0.1 was released. Most of the fixes
are to do with file-handling or documentation bugs. To the best of my
knowledge, there have been no data-loss-causing bugs reported in the
compression/decompression engine of 1.0.0 or 1.0.1.
Note that this release does not improve the rather crude build system
for Unix platforms. The general plan here is to autoconfiscate/
libtoolise 1.0.2 soon after release, and release the result as 1.1.0
or perhaps 1.2.0. That, however, is still just a plan at this point.
Here are the changes in 1.0.2. Bug-reporters and/or patch-senders in
parentheses.
* Fix an infinite segfault loop in 1.0.1 when a directory is
encountered in -f (force) mode.
(Trond Eivind Glomsrod, Nicholas Nethercote, Volker Schmidt)
* Avoid double fclose() of output file on certain I/O error paths.
(Solar Designer)
* Don't fail with internal error 1007 when fed a long stream (> 48MB)
of byte 251. Also print useful message suggesting that 1007s may be
caused by bad memory.
(noticed by Juan Pedro Vallejo, fixed by me)
* Fix uninitialised variable silly bug in demo prog dlltest.c.
(Jorj Bauer)
* Remove 512-MB limitation on recovered file size for bzip2recover
on selected platforms which support 64-bit ints. At the moment
all GCC supported platforms, and Win32.
(me, Alson van der Meulen)
* Hard-code header byte values, to give correct operation on platforms
using EBCDIC as their native character set (IBM's OS/390).
(Leland Lucius)
* Copy file access times correctly.
(Marty Leisner)
* Add distclean and check targets to Makefile.
(Michael Carmack)
* Parameterise use of ar and ranlib in Makefile. Also add $(LDFLAGS).
(Rich Ireland, Bo Thorsen)
* Pass -p (create parent dirs as needed) to mkdir during make install.
(Jeremy Fusco)
* Dereference symlinks when copying file permissions in -f mode.
(Volker Schmidt)
* Majorly simplify implementation of uInt64_qrm10.
(Bo Lindbergh)
* Check the input file still exists before deleting the output one,
when aborting in cleanUpAndFail().
(Joerg Prante, Robert Linden, Matthias Krings)
Also a bunch of patches courtesy of Philippe Troin, the Debian maintainer
of bzip2:
* Wrapper scripts (with manpages): bzdiff, bzgrep, bzmore.
* Spelling changes and minor enhancements in bzip2.1.
* Avoid race condition between creating the output file and setting its
interim permissions safely, by using fopen_output_safely().
No changes to bzip2recover since there is no issue with file
permissions there.
* do not print senseless report with -v when compressing an empty
file.
* bzcat -f works on non-bzip2 files.
* do not try to escape shell meta-characters on unix (the shell takes
care of these).
* added --fast and --best aliases for -1 -9 for gzip compatibility.
1.0.3 (15 Feb 05)
~~~~~~~~~~~~~~~~~
Fixes some minor bugs since the last version, 1.0.2.
* Further robustification against corrupted compressed data.
There are currently no known bitstreams which can cause the
decompressor to crash, loop or access memory which does not
belong to it. If you are using bzip2 or the library to
decompress bitstreams from untrusted sources, an upgrade
to 1.0.3 is recommended. This fixes CAN-2005-1260.
* The documentation has been converted to XML, from which html
and pdf can be derived.
* Various minor bugs in the documentation have been fixed.
* Fixes for various compilation warnings with newer versions of
gcc, and on 64-bit platforms.
* The BZ_NO_STDIO cpp symbol was not properly observed in 1.0.2.
This has been fixed.
1.0.4 (20 Dec 06)
~~~~~~~~~~~~~~~~~
Fixes some minor bugs since the last version, 1.0.3.
* Fix file permissions race problem (CAN-2005-0953).
* Avoid possible segfault in BZ2_bzclose. From Coverity's NetBSD
scan.
* 'const'/prototype cleanups in the C code.
* Change default install location to /usr/local, and handle multiple
'make install's without error.
* Sanitise file names more carefully in bzgrep. Fixes CAN-2005-0758
to the extent that applies to bzgrep.
* Use 'mktemp' rather than 'tempfile' in bzdiff.
* Tighten up a couple of assertions in blocksort.c following automated
analysis.
* Fix minor doc/comment bugs.
1.0.5 (10 Dec 07)
~~~~~~~~~~~~~~~~~
Security fix only. Fixes CERT-FI 20469 as it applies to bzip2.
1.0.6 (6 Sept 10)
~~~~~~~~~~~~~~~~~
* Security fix for CVE-2010-0405. This was reported by Mikolaj
Izdebski.
* Make the documentation build on Ubuntu 10.04

View File

@@ -1,55 +0,0 @@
# bzip2 library
# library name
set(Output pcsx2_bzip2)
set(CommonFlags
-march=athlon-xp
-march=prescott
)
set(OptimizationFlags
-Os
-W
)
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines
add_definitions(${CommonFlags} -g)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -g)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags})
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# variable with all sources of this library
set(bzip2Sources
blocksort.c
bzlib.c
compress.c
crctable.c
decompress.c
huffman.c
randtable.c)
# variable with all headers of this library
set(bzip2Headers
bzlib.h
bzlib_private.h)
# add library
add_library(${Output} STATIC ${bzip2Sources} ${bzip2Headers})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@@ -1,43 +1,42 @@
--------------------------------------------------------------------------
This program, "bzip2", the associated library "libbzip2", and all
documentation, are copyright (C) 1996-2006 Julian R Seward. All
rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, Cambridge, UK.
jseward@bzip.org
bzip2/libbzip2 version 1.0.4 of 20 December 2006
--------------------------------------------------------------------------
--------------------------------------------------------------------------
This program, "bzip2", the associated library "libbzip2", and all
documentation, are copyright (C) 1996-2010 Julian R Seward. All
rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Julian Seward, jseward@bzip.org
bzip2/libbzip2 version 1.0.6 of 6 September 2010
--------------------------------------------------------------------------

420
3rdparty/bzip2/README vendored
View File

@@ -1,205 +1,215 @@
This is the README for bzip2/libzip2.
This version is fully compatible with the previous public releases.
------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.4 of 20 December 2006
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in this file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------
Complete documentation is available in Postscript form (manual.ps),
PDF (manual.pdf) or html (manual.html). A plain-text version of the
manual page is available as bzip2.txt.
HOW TO BUILD -- UNIX
Type 'make'. This builds the library libbz2.a and then the programs
bzip2 and bzip2recover. Six self-tests are run. If the self-tests
complete ok, carry on to installation:
To install in /usr/local/bin, /usr/local/lib, /usr/local/man and
/usr/local/include, type
make install
To install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type
make install PREFIX=/xxx/yyy
If you are (justifiably) paranoid and want to see what 'make install'
is going to do, you can first do
make -n install or
make -n install PREFIX=/xxx/yyy respectively.
The -n instructs make to show the commands it would execute, but not
actually execute them.
HOW TO BUILD -- UNIX, shared library libbz2.so.
Do 'make -f Makefile-libbz2_so'. This Makefile seems to work for
Linux-ELF (RedHat 7.2 on an x86 box), with gcc. I make no claims
that it works for any other platform, though I suspect it probably
will work for most platforms employing both ELF and gcc.
bzip2-shared, a client of the shared library, is also built, but not
self-tested. So I suggest you also build using the normal Makefile,
since that conducts a self-test. A second reason to prefer the
version statically linked to the library is that, on x86 platforms,
building shared objects makes a valuable register (%ebx) unavailable
to gcc, resulting in a slowdown of 10%-20%, at least for bzip2.
Important note for people upgrading .so's from 0.9.0/0.9.5 to version
1.0.X. All the functions in the library have been renamed, from (eg)
bzCompress to BZ2_bzCompress, to avoid namespace pollution.
Unfortunately this means that the libbz2.so created by
Makefile-libbz2_so will not work with any program which used an older
version of the library. I do encourage library clients to make the
effort to upgrade to use version 1.0, since it is both faster and more
robust than previous versions.
HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc.
It's difficult for me to support compilation on all these platforms.
My approach is to collect binaries for these platforms, and put them
on the master web site (http://www.bzip.org). Look there. However
(FWIW), bzip2-1.0.X is very standard ANSI C and should compile
unmodified with MS Visual C. If you have difficulties building, you
might want to read README.COMPILATION.PROBLEMS.
At least using MS Visual C++ 6, you can build from the unmodified
sources by issuing, in a command shell:
nmake -f makefile.msc
(you may need to first run the MSVC-provided script VCVARS32.BAT
so as to set up paths to the MSVC tools correctly).
VALIDATION
Correct operation, in the sense that a compressed file can always be
decompressed to reproduce the original, is obviously of paramount
importance. To validate bzip2, I used a modified version of Mark
Nelson's churn program. Churn is an automated test driver which
recursively traverses a directory structure, using bzip2 to compress
and then decompress each file it encounters, and checking that the
decompressed data is the same as the original.
Please read and be aware of the following:
WARNING:
This program and library (attempts to) compress data by
performing several non-trivial transformations on it.
Unless you are 100% familiar with *all* the algorithms
contained herein, and with the consequences of modifying them,
you should NOT meddle with the compression or decompression
machinery. Incorrect changes can and very likely *will*
lead to disastrous loss of data.
DISCLAIMER:
I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE
USE OF THIS PROGRAM/LIBRARY, HOWSOEVER CAUSED.
Every compression of a file implies an assumption that the
compressed file can be decompressed to reproduce the original.
Great efforts in design, coding and testing have been made to
ensure that this program works correctly. However, the complexity
of the algorithms, and, in particular, the presence of various
special cases in the code which occur with very low but non-zero
probability make it impossible to rule out the possibility of bugs
remaining in the program. DO NOT COMPRESS ANY DATA WITH THIS
PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER
SMALL, THAT THE DATA WILL NOT BE RECOVERABLE.
That is not to say this program is inherently unreliable.
Indeed, I very much hope the opposite is true. bzip2/libbzip2
has been carefully constructed and extensively tested.
PATENTS:
To the best of my knowledge, bzip2/libbzip2 does not use any
patented algorithms. However, I do not have the resources
to carry out a patent search. Therefore I cannot give any
guarantee of the above statement.
WHAT'S NEW IN 0.9.0 (as compared to 0.1pl2) ?
* Approx 10% faster compression, 30% faster decompression
* -t (test mode) is a lot quicker
* Can decompress concatenated compressed files
* Programming interface, so programs can directly read/write .bz2 files
* Less restrictive (BSD-style) licensing
* Flag handling more compatible with GNU gzip
* Much more documentation, i.e., a proper user manual
* Hopefully, improved portability (at least of the library)
WHAT'S NEW IN 0.9.5 ?
* Compression speed is much less sensitive to the input
data than in previous versions. Specifically, the very
slow performance caused by repetitive data is fixed.
* Many small improvements in file and flag handling.
* A Y2K statement.
WHAT'S NEW IN 1.0.0 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.2 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.3 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.4 ?
See the CHANGES file.
I hope you find bzip2 useful. Feel free to contact me at
jseward@bzip.org
if you have any suggestions or queries. Many people mailed me with
comments, suggestions and patches after the releases of bzip-0.15,
bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this
feedback. I thank you for your comments.
bzip2's "home" is http://www.bzip.org/
Julian Seward
jseward@bzip.org
Cambridge, UK.
18 July 1996 (version 0.15)
25 August 1996 (version 0.21)
7 August 1997 (bzip2, version 0.1)
29 August 1997 (bzip2, version 0.1pl2)
23 August 1998 (bzip2, version 0.9.0)
8 June 1999 (bzip2, version 0.9.5)
4 Sept 1999 (bzip2, version 0.9.5d)
5 May 2000 (bzip2, version 1.0pre8)
30 December 2001 (bzip2, version 1.0.2pre1)
15 February 2005 (bzip2, version 1.0.3)
20 December 2006 (bzip2, version 1.0.4)
This is the README for bzip2/libzip2.
This version is fully compatible with the previous public releases.
------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in this file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------
Complete documentation is available in Postscript form (manual.ps),
PDF (manual.pdf) or html (manual.html). A plain-text version of the
manual page is available as bzip2.txt.
HOW TO BUILD -- UNIX
Type 'make'. This builds the library libbz2.a and then the programs
bzip2 and bzip2recover. Six self-tests are run. If the self-tests
complete ok, carry on to installation:
To install in /usr/local/bin, /usr/local/lib, /usr/local/man and
/usr/local/include, type
make install
To install somewhere else, eg, /xxx/yyy/{bin,lib,man,include}, type
make install PREFIX=/xxx/yyy
If you are (justifiably) paranoid and want to see what 'make install'
is going to do, you can first do
make -n install or
make -n install PREFIX=/xxx/yyy respectively.
The -n instructs make to show the commands it would execute, but not
actually execute them.
HOW TO BUILD -- UNIX, shared library libbz2.so.
Do 'make -f Makefile-libbz2_so'. This Makefile seems to work for
Linux-ELF (RedHat 7.2 on an x86 box), with gcc. I make no claims
that it works for any other platform, though I suspect it probably
will work for most platforms employing both ELF and gcc.
bzip2-shared, a client of the shared library, is also built, but not
self-tested. So I suggest you also build using the normal Makefile,
since that conducts a self-test. A second reason to prefer the
version statically linked to the library is that, on x86 platforms,
building shared objects makes a valuable register (%ebx) unavailable
to gcc, resulting in a slowdown of 10%-20%, at least for bzip2.
Important note for people upgrading .so's from 0.9.0/0.9.5 to version
1.0.X. All the functions in the library have been renamed, from (eg)
bzCompress to BZ2_bzCompress, to avoid namespace pollution.
Unfortunately this means that the libbz2.so created by
Makefile-libbz2_so will not work with any program which used an older
version of the library. I do encourage library clients to make the
effort to upgrade to use version 1.0, since it is both faster and more
robust than previous versions.
HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc.
It's difficult for me to support compilation on all these platforms.
My approach is to collect binaries for these platforms, and put them
on the master web site (http://www.bzip.org). Look there. However
(FWIW), bzip2-1.0.X is very standard ANSI C and should compile
unmodified with MS Visual C. If you have difficulties building, you
might want to read README.COMPILATION.PROBLEMS.
At least using MS Visual C++ 6, you can build from the unmodified
sources by issuing, in a command shell:
nmake -f makefile.msc
(you may need to first run the MSVC-provided script VCVARS32.BAT
so as to set up paths to the MSVC tools correctly).
VALIDATION
Correct operation, in the sense that a compressed file can always be
decompressed to reproduce the original, is obviously of paramount
importance. To validate bzip2, I used a modified version of Mark
Nelson's churn program. Churn is an automated test driver which
recursively traverses a directory structure, using bzip2 to compress
and then decompress each file it encounters, and checking that the
decompressed data is the same as the original.
Please read and be aware of the following:
WARNING:
This program and library (attempts to) compress data by
performing several non-trivial transformations on it.
Unless you are 100% familiar with *all* the algorithms
contained herein, and with the consequences of modifying them,
you should NOT meddle with the compression or decompression
machinery. Incorrect changes can and very likely *will*
lead to disastrous loss of data.
DISCLAIMER:
I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE
USE OF THIS PROGRAM/LIBRARY, HOWSOEVER CAUSED.
Every compression of a file implies an assumption that the
compressed file can be decompressed to reproduce the original.
Great efforts in design, coding and testing have been made to
ensure that this program works correctly. However, the complexity
of the algorithms, and, in particular, the presence of various
special cases in the code which occur with very low but non-zero
probability make it impossible to rule out the possibility of bugs
remaining in the program. DO NOT COMPRESS ANY DATA WITH THIS
PROGRAM UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER
SMALL, THAT THE DATA WILL NOT BE RECOVERABLE.
That is not to say this program is inherently unreliable.
Indeed, I very much hope the opposite is true. bzip2/libbzip2
has been carefully constructed and extensively tested.
PATENTS:
To the best of my knowledge, bzip2/libbzip2 does not use any
patented algorithms. However, I do not have the resources
to carry out a patent search. Therefore I cannot give any
guarantee of the above statement.
WHAT'S NEW IN 0.9.0 (as compared to 0.1pl2) ?
* Approx 10% faster compression, 30% faster decompression
* -t (test mode) is a lot quicker
* Can decompress concatenated compressed files
* Programming interface, so programs can directly read/write .bz2 files
* Less restrictive (BSD-style) licensing
* Flag handling more compatible with GNU gzip
* Much more documentation, i.e., a proper user manual
* Hopefully, improved portability (at least of the library)
WHAT'S NEW IN 0.9.5 ?
* Compression speed is much less sensitive to the input
data than in previous versions. Specifically, the very
slow performance caused by repetitive data is fixed.
* Many small improvements in file and flag handling.
* A Y2K statement.
WHAT'S NEW IN 1.0.0 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.2 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.3 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.4 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.5 ?
See the CHANGES file.
WHAT'S NEW IN 1.0.6 ?
See the CHANGES file.
I hope you find bzip2 useful. Feel free to contact me at
jseward@bzip.org
if you have any suggestions or queries. Many people mailed me with
comments, suggestions and patches after the releases of bzip-0.15,
bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1,
1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this
feedback. I thank you for your comments.
bzip2's "home" is http://www.bzip.org/
Julian Seward
jseward@bzip.org
Cambridge, UK.
18 July 1996 (version 0.15)
25 August 1996 (version 0.21)
7 August 1997 (bzip2, version 0.1)
29 August 1997 (bzip2, version 0.1pl2)
23 August 1998 (bzip2, version 0.9.0)
8 June 1999 (bzip2, version 0.9.5)
4 Sept 1999 (bzip2, version 0.9.5d)
5 May 2000 (bzip2, version 1.0pre8)
30 December 2001 (bzip2, version 1.0.2pre1)
15 February 2005 (bzip2, version 1.0.3)
20 December 2006 (bzip2, version 1.0.4)
10 December 2007 (bzip2, version 1.0.5)
6 Sept 2010 (bzip2, version 1.0.6)

View File

@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.4 of 20 December 2006
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.

View File

@@ -1,87 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="bzip2" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="../../deps/debug/libbzip2" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="./.objs/debug" />
<Option type="2" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Compiler>
<Add option="-g" />
<Add option="-O0" />
</Compiler>
</Target>
<Target title="Devel">
<Option output="../../deps/devel/libbzip2" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="./.objs/devel" />
<Option type="2" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Compiler>
<Add option="-O1" />
<Add option="-W" />
<Add option="-g" />
<Add option="-DNDEBUG" />
</Compiler>
</Target>
<Target title="Release">
<Option output="../../deps/release/libbzip2" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="./.objs/release" />
<Option type="2" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Compiler>
<Add option="-fexpensive-optimizations" />
<Add option="-O3" />
<Add option="-W" />
<Add option="-DNDEBUG" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-march=athlon-xp" />
<Add option="-march=prescott" />
</Compiler>
<Unit filename="blocksort.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="bzlib.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="bzlib.h" />
<Unit filename="bzlib_private.h" />
<Unit filename="compress.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="crctable.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="decompress.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="huffman.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="randtable.c">
<Option compilerVar="CC" />
</Unit>
<Extensions>
<envvars />
<code_completion />
<lib_finder disable_auto="1" />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>

View File

@@ -1,231 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="bzip2"
ProjectGUID="{F4EB4AB2-C595-4B05-8BC0-059024BC796C}"
RootNamespace="bzip2"
TargetFrameworkVersion="0"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
ConfigurationType="4"
InheritedPropertySheets="..\DefaultProjectRootDir.vsprops;..\3rdparty.vsprops;..\..\common\vsprops\CodeGen_Debug.vsprops;..\..\common\vsprops\IncrementalLinking.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="4"
InheritedPropertySheets="..\DefaultProjectRootDir.vsprops;..\3rdparty.vsprops;..\..\common\vsprops\CodeGen_Release.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Devel|Win32"
ConfigurationType="4"
InheritedPropertySheets="..\DefaultProjectRootDir.vsprops;..\3rdparty.vsprops;..\..\common\vsprops\CodeGen_Devel.vsprops;..\..\common\vsprops\IncrementalLinking.vsprops"
CharacterSet="2"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\blocksort.c"
>
</File>
<File
RelativePath=".\bzlib.c"
>
</File>
<File
RelativePath=".\compress.c"
>
</File>
<File
RelativePath=".\crctable.c"
>
</File>
<File
RelativePath=".\decompress.c"
>
</File>
<File
RelativePath=".\huffman.c"
>
</File>
<File
RelativePath=".\randtable.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\bzlib.h"
>
</File>
<File
RelativePath=".\bzlib_private.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,92 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Devel|Win32">
<Configuration>Devel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F4EB4AB2-C595-4B05-8BC0-059024BC796C}</ProjectGuid>
<RootNamespace>bzip2</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName)</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="blocksort.c" />
<ClCompile Include="bzlib.c" />
<ClCompile Include="compress.c" />
<ClCompile Include="crctable.c" />
<ClCompile Include="decompress.c" />
<ClCompile Include="huffman.c" />
<ClCompile Include="randtable.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="bzlib.h" />
<ClInclude Include="bzlib_private.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Devel|Win32">
<Configuration>Devel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F4EB4AB2-C595-4B05-8BC0-059024BC796C}</ProjectGuid>
<RootNamespace>bzip2</RootNamespace>
<ProjectName>bzip2</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName)</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="blocksort.c" />
<ClCompile Include="bzlib.c" />
<ClCompile Include="compress.c" />
<ClCompile Include="crctable.c" />
<ClCompile Include="decompress.c" />
<ClCompile Include="huffman.c" />
<ClCompile Include="randtable.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="bzlib.h" />
<ClInclude Include="bzlib_private.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,44 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="blocksort.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bzlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="compress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="crctable.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="decompress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="huffman.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="randtable.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="bzlib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="bzlib_private.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="blocksort.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bzlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="compress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="crctable.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="decompress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="huffman.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="randtable.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="bzlib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="bzlib_private.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,96 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Devel|Win32">
<Configuration>Devel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F4EB4AB2-C595-4B05-8BC0-059024BC796C}</ProjectGuid>
<RootNamespace>bzip2</RootNamespace>
<ProjectName>bzip2</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName)</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="blocksort.c" />
<ClCompile Include="bzlib.c" />
<ClCompile Include="compress.c" />
<ClCompile Include="crctable.c" />
<ClCompile Include="decompress.c" />
<ClCompile Include="huffman.c" />
<ClCompile Include="randtable.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="bzlib.h" />
<ClInclude Include="bzlib_private.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="blocksort.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bzlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="compress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="crctable.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="decompress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="huffman.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="randtable.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="bzlib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="bzlib_private.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,96 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Devel|Win32">
<Configuration>Devel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F4EB4AB2-C595-4B05-8BC0-059024BC796C}</ProjectGuid>
<RootNamespace>bzip2</RootNamespace>
<ProjectName>bzip2</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName)</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="blocksort.c" />
<ClCompile Include="bzlib.c" />
<ClCompile Include="compress.c" />
<ClCompile Include="crctable.c" />
<ClCompile Include="decompress.c" />
<ClCompile Include="huffman.c" />
<ClCompile Include="randtable.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="bzlib.h" />
<ClInclude Include="bzlib_private.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="blocksort.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bzlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="compress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="crctable.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="decompress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="huffman.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="randtable.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="bzlib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="bzlib_private.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.4 of 20 December 2006
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -48,7 +48,7 @@ void BZ2_bz__AssertH__fail ( int errcode )
"component, you should also report this bug to the author(s)\n"
"of that program. Please make an effort to report this bug;\n"
"timely and accurate bug reports eventually lead to higher\n"
"quality software. Thanks. Julian Seward, 15 February 2005.\n\n",
"quality software. Thanks. Julian Seward, 10 December 2007.\n\n",
errcode,
BZ2_bzlibVersion()
);
@@ -598,6 +598,7 @@ Bool unRLE_obuf_to_output_FAST ( DState* s )
UInt32 c_tPos = s->tPos;
char* cs_next_out = s->strm->next_out;
unsigned int cs_avail_out = s->strm->avail_out;
Int32 ro_blockSize100k = s->blockSize100k;
/* end restore */
UInt32 avail_out_INIT = cs_avail_out;

View File

@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.4 of 20 December 2006
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.

View File

@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.4 of 20 December 2006
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -36,7 +36,7 @@
/*-- General stuff. --*/
#define BZ_VERSION "1.0.4, 20-Dec-2006"
#define BZ_VERSION "1.0.6, 6-Sept-2010"
typedef char Char;
typedef unsigned char Bool;
@@ -442,11 +442,15 @@ typedef
/*-- Macros for decompression. --*/
#define BZ_GET_FAST(cccc) \
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \
s->tPos = s->tt[s->tPos]; \
cccc = (UChar)(s->tPos & 0xff); \
s->tPos >>= 8;
#define BZ_GET_FAST_C(cccc) \
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
if (c_tPos >= (UInt32)100000 * (UInt32)ro_blockSize100k) return True; \
c_tPos = c_tt[c_tPos]; \
cccc = (UChar)(c_tPos & 0xff); \
c_tPos >>= 8;
@@ -469,8 +473,10 @@ typedef
(((UInt32)s->ll16[i]) | (GET_LL4(i) << 16))
#define BZ_GET_SMALL(cccc) \
cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \
s->tPos = GET_LL(s->tPos);
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \
cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \
s->tPos = GET_LL(s->tPos);
/*-- externs for decompression. --*/

View File

@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.4 of 20 December 2006
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.

View File

@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.4 of 20 December 2006
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.

View File

@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.4 of 20 December 2006
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
@@ -381,6 +381,13 @@ Int32 BZ2_decompress ( DState* s )
es = -1;
N = 1;
do {
/* Check that N doesn't get too big, so that es doesn't
go negative. The maximum value that can be
RUNA/RUNB encoded is equal to the block size (post
the initial RLE), viz, 900k, so bounding N at 2
million should guard against overflow without
rejecting any legitimate inputs. */
if (N >= 2*1024*1024) RETURN(BZ_DATA_ERROR);
if (nextSym == BZ_RUNA) es = es + (0+1) * N; else
if (nextSym == BZ_RUNB) es = es + (1+1) * N;
N = N * 2;
@@ -485,15 +492,28 @@ Int32 BZ2_decompress ( DState* s )
RETURN(BZ_DATA_ERROR);
/*-- Set up cftab to facilitate generation of T^(-1) --*/
/* Check: unzftab entries in range. */
for (i = 0; i <= 255; i++) {
if (s->unzftab[i] < 0 || s->unzftab[i] > nblock)
RETURN(BZ_DATA_ERROR);
}
/* Actually generate cftab. */
s->cftab[0] = 0;
for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1];
for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1];
/* Check: cftab entries in range. */
for (i = 0; i <= 256; i++) {
if (s->cftab[i] < 0 || s->cftab[i] > nblock) {
/* s->cftab[i] can legitimately be == nblock */
RETURN(BZ_DATA_ERROR);
}
}
/* Check: cftab entries non-descending. */
for (i = 1; i <= 256; i++) {
if (s->cftab[i-1] > s->cftab[i]) {
RETURN(BZ_DATA_ERROR);
}
}
s->state_out_len = 0;
s->state_out_ch = 0;

View File

@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.4 of 20 December 2006
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.

View File

@@ -8,8 +8,8 @@
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.4 of 20 December 2006
Copyright (C) 1996-2006 Julian Seward <jseward@bzip.org>
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.

View File

@@ -1,261 +0,0 @@
// Copyright (c) 2005, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ----
// Author: Craig Silverstein
//
// This is just a very thin wrapper over densehashtable.h, just
// like sgi stl's stl_hash_map is a very thin wrapper over
// stl_hashtable. The major thing we define is operator[], because
// we have a concept of a data_type which stl_hashtable doesn't
// (it only has a key and a value).
//
// NOTE: this is exactly like sparse_hash_map.h, with the word
// "sparse" replaced by "dense", except for the addition of
// set_empty_key().
//
// YOU MUST CALL SET_EMPTY_KEY() IMMEDIATELY AFTER CONSTRUCTION.
//
// Otherwise your program will die in mysterious ways.
//
// In other respects, we adhere mostly to the STL semantics for
// hash-map. One important exception is that insert() invalidates
// iterators entirely. On the plus side, though, erase() doesn't
// invalidate iterators at all, or even change the ordering of elements.
//
// Here are a few "power user" tips:
//
// 1) set_deleted_key():
// If you want to use erase() you must call set_deleted_key(),
// in addition to set_empty_key(), after construction.
// The deleted and empty keys must differ.
//
// 2) resize(0):
// When an item is deleted, its memory isn't freed right
// away. This allows you to iterate over a hashtable,
// and call erase(), without invalidating the iterator.
// To force the memory to be freed, call resize(0).
//
// 3) set_resizing_parameters(0.0, 0.8):
// Setting the shrink_resize_percent to 0.0 guarantees
// that the hash table will never shrink.
//
// Guide to what kind of hash_map to use:
// (1) dense_hash_map: fastest, uses the most memory
// (2) sparse_hash_map: slowest, uses the least memory
// (3) hash_map (STL): in the middle
// Typically I use sparse_hash_map when I care about space and/or when
// I need to save the hashtable on disk. I use hash_map otherwise. I
// don't personally use dense_hash_map ever; the only use of
// dense_hash_map I know of is to work around malloc() bugs in some
// systems (dense_hash_map has a particularly simple allocation scheme).
//
// - dense_hash_map has, typically, a factor of 2 memory overhead (if your
// data takes up X bytes, the hash_map uses X more bytes in overhead).
// - sparse_hash_map has about 2 bits overhead per entry.
// - sparse_hash_map can be 3-7 times slower than the others for lookup and,
// especially, inserts. See time_hash_map.cc for details.
//
// See /usr/(local/)?doc/sparsehash-0.1/dense_hash_map.html
// for information about how to use this class.
#ifndef _DENSE_HASH_MAP_H_
#define _DENSE_HASH_MAP_H_
#include <google/sparsehash/sparseconfig.h>
#include <stdio.h> // for FILE * in read()/write()
#include <algorithm> // for the default template args
#include <functional> // for equal_to
#include <memory> // for alloc<>
#include <utility> // for pair<>
#include HASH_FUN_H // defined in config.h
#include <google/sparsehash/densehashtable.h>
_START_GOOGLE_NAMESPACE_
using STL_NAMESPACE::pair;
template <class Key, class T,
class HashFcn = SPARSEHASH_HASH<Key>, // defined in sparseconfig.h
class EqualKey = STL_NAMESPACE::equal_to<Key>,
class Alloc = STL_NAMESPACE::allocator<T> >
class dense_hash_map {
private:
// Apparently select1st is not stl-standard, so we define our own
struct SelectKey {
const Key& operator()(const pair<const Key, T>& p) const {
return p.first;
}
};
// The actual data
typedef dense_hashtable<pair<const Key, T>, Key, HashFcn,
SelectKey, EqualKey, Alloc> ht;
ht rep;
public:
typedef typename ht::key_type key_type;
typedef T data_type;
typedef T mapped_type;
typedef typename ht::value_type value_type;
typedef typename ht::hasher hasher;
typedef typename ht::key_equal key_equal;
typedef typename ht::size_type size_type;
typedef typename ht::difference_type difference_type;
typedef typename ht::pointer pointer;
typedef typename ht::const_pointer const_pointer;
typedef typename ht::reference reference;
typedef typename ht::const_reference const_reference;
typedef typename ht::iterator iterator;
typedef typename ht::const_iterator const_iterator;
// Iterator functions
iterator begin() { return rep.begin(); }
iterator end() { return rep.end(); }
const_iterator begin() const { return rep.begin(); }
const_iterator end() const { return rep.end(); }
// Accessor functions
hasher hash_funct() const { return rep.hash_funct(); }
key_equal key_eq() const { return rep.key_eq(); }
// Constructors
explicit dense_hash_map(size_type expected_max_items_in_table = 0,
const hasher& hf = hasher(),
const key_equal& eql = key_equal())
: rep(expected_max_items_in_table, hf, eql) { }
template <class InputIterator>
dense_hash_map(InputIterator f, InputIterator l,
size_type expected_max_items_in_table = 0,
const hasher& hf = hasher(),
const key_equal& eql = key_equal())
: rep(expected_max_items_in_table, hf, eql) {
rep.insert(f, l);
}
// We use the default copy constructor
// We use the default operator=()
// We use the default destructor
void clear() { rep.clear(); }
// This clears the hash map without resizing it down to the minimum
// bucket count, but rather keeps the number of buckets constant
void clear_no_resize() { rep.clear_no_resize(); }
void swap(dense_hash_map& hs) { rep.swap(hs.rep); }
// Functions concerning size
size_type size() const { return rep.size(); }
size_type max_size() const { return rep.max_size(); }
bool empty() const { return rep.empty(); }
size_type bucket_count() const { return rep.bucket_count(); }
size_type max_bucket_count() const { return rep.max_bucket_count(); }
void resize(size_type hint) { rep.resize(hint); }
void set_resizing_parameters(float shrink, float grow) {
return rep.set_resizing_parameters(shrink, grow);
}
// Lookup routines
iterator find(const key_type& key) { return rep.find(key); }
const_iterator find(const key_type& key) const { return rep.find(key); }
data_type& operator[](const key_type& key) { // This is our value-add!
iterator it = find(key);
if (it != end()) {
return it->second;
} else {
return insert(value_type(key, data_type())).first->second;
}
}
size_type count(const key_type& key) const { return rep.count(key); }
pair<iterator, iterator> equal_range(const key_type& key) {
return rep.equal_range(key);
}
pair<const_iterator, const_iterator> equal_range(const key_type& key) const {
return rep.equal_range(key);
}
// Insertion routines
pair<iterator, bool> insert(const value_type& obj) { return rep.insert(obj); }
template <class InputIterator>
void insert(InputIterator f, InputIterator l) { rep.insert(f, l); }
void insert(const_iterator f, const_iterator l) { rep.insert(f, l); }
// required for std::insert_iterator; the passed-in iterator is ignored
iterator insert(iterator, const value_type& obj) { return insert(obj).first; }
// Deletion and empty routines
// THESE ARE NON-STANDARD! I make you specify an "impossible" key
// value to identify deleted and empty buckets. You can change the
// deleted key as time goes on, or get rid of it entirely to be insert-only.
void set_empty_key(const key_type& key) { // YOU MUST CALL THIS!
rep.set_empty_key(value_type(key, data_type())); // rep wants a value
}
void set_deleted_key(const key_type& key) {
rep.set_deleted_key(value_type(key, data_type())); // rep wants a value
}
void clear_deleted_key() { rep.clear_deleted_key(); }
// These are standard
size_type erase(const key_type& key) { return rep.erase(key); }
void erase(iterator it) { rep.erase(it); }
void erase(iterator f, iterator l) { rep.erase(f, l); }
// Comparison
bool operator==(const dense_hash_map& hs) const { return rep == hs.rep; }
bool operator!=(const dense_hash_map& hs) const { return rep != hs.rep; }
// I/O -- this is an add-on for writing metainformation to disk
bool write_metadata(FILE *fp) { return rep.write_metadata(fp); }
bool read_metadata(FILE *fp) { return rep.read_metadata(fp); }
bool write_nopointer_data(FILE *fp) { return rep.write_nopointer_data(fp); }
bool read_nopointer_data(FILE *fp) { return rep.read_nopointer_data(fp); }
};
// We need a global swap as well
template <class Key, class T, class HashFcn, class EqualKey, class Alloc>
inline void swap(dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>& hm1,
dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>& hm2) {
hm1.swap(hm2);
}
_END_GOOGLE_NAMESPACE_
#endif /* _DENSE_HASH_MAP_H_ */

View File

@@ -1,245 +0,0 @@
// Copyright (c) 2005, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ---
// Author: Craig Silverstein
//
// This is just a very thin wrapper over densehashtable.h, just
// like sgi stl's stl_hash_set is a very thin wrapper over
// stl_hashtable. The major thing we define is operator[], because
// we have a concept of a data_type which stl_hashtable doesn't
// (it only has a key and a value).
//
// This is more different from dense_hash_map than you might think,
// because all iterators for sets are const (you obviously can't
// change the key, and for sets there is no value).
//
// NOTE: this is exactly like sparse_hash_set.h, with the word
// "sparse" replaced by "dense", except for the addition of
// set_empty_key().
//
// YOU MUST CALL SET_EMPTY_KEY() IMMEDIATELY AFTER CONSTRUCTION.
//
// Otherwise your program will die in mysterious ways.
//
// In other respects, we adhere mostly to the STL semantics for
// hash-set. One important exception is that insert() invalidates
// iterators entirely. On the plus side, though, erase() doesn't
// invalidate iterators at all, or even change the ordering of elements.
//
// Here are a few "power user" tips:
//
// 1) set_deleted_key():
// If you want to use erase() you must call set_deleted_key(),
// in addition to set_empty_key(), after construction.
// The deleted and empty keys must differ.
//
// 2) resize(0):
// When an item is deleted, its memory isn't freed right
// away. This allows you to iterate over a hashtable,
// and call erase(), without invalidating the iterator.
// To force the memory to be freed, call resize(0).
//
// 3) set_resizing_parameters(0.0, 0.8):
// Setting the shrink_resize_percent to 0.0 guarantees
// that the hash table will never shrink.
//
// Guide to what kind of hash_set to use:
// (1) dense_hash_set: fastest, uses the most memory
// (2) sparse_hash_set: slowest, uses the least memory
// (3) hash_set (STL): in the middle
// Typically I use sparse_hash_set when I care about space and/or when
// I need to save the hashtable on disk. I use hash_set otherwise. I
// don't personally use dense_hash_set ever; the only use of
// dense_hash_set I know of is to work around malloc() bugs in some
// systems (dense_hash_set has a particularly simple allocation scheme).
//
// - dense_hash_set has, typically, a factor of 2 memory overhead (if your
// data takes up X bytes, the hash_set uses X more bytes in overhead).
// - sparse_hash_set has about 2 bits overhead per entry.
// - sparse_hash_map can be 3-7 times slower than the others for lookup and,
// especially, inserts. See time_hash_map.cc for details.
//
// See /usr/(local/)?doc/sparsehash-0.1/dense_hash_set.html
// for information about how to use this class.
#ifndef _DENSE_HASH_SET_H_
#define _DENSE_HASH_SET_H_
#include <google/sparsehash/sparseconfig.h>
#include <stdio.h> // for FILE * in read()/write()
#include <algorithm> // for the default template args
#include <functional> // for equal_to
#include <memory> // for alloc<>
#include <utility> // for pair<>
#include HASH_FUN_H // defined in config.h
#include <google/sparsehash/densehashtable.h>
_START_GOOGLE_NAMESPACE_
using STL_NAMESPACE::pair;
template <class Value,
class HashFcn = SPARSEHASH_HASH<Value>, // defined in sparseconfig.h
class EqualKey = STL_NAMESPACE::equal_to<Value>,
class Alloc = STL_NAMESPACE::allocator<Value> >
class dense_hash_set {
private:
// Apparently identity is not stl-standard, so we define our own
struct Identity {
Value& operator()(Value& v) const { return v; }
const Value& operator()(const Value& v) const { return v; }
};
// The actual data
typedef dense_hashtable<Value, Value, HashFcn, Identity, EqualKey, Alloc> ht;
ht rep;
public:
typedef typename ht::key_type key_type;
typedef typename ht::value_type value_type;
typedef typename ht::hasher hasher;
typedef typename ht::key_equal key_equal;
typedef typename ht::size_type size_type;
typedef typename ht::difference_type difference_type;
typedef typename ht::const_pointer pointer;
typedef typename ht::const_pointer const_pointer;
typedef typename ht::const_reference reference;
typedef typename ht::const_reference const_reference;
typedef typename ht::const_iterator iterator;
typedef typename ht::const_iterator const_iterator;
// Iterator functions -- recall all iterators are const
iterator begin() const { return rep.begin(); }
iterator end() const { return rep.end(); }
// Accessor functions
hasher hash_funct() const { return rep.hash_funct(); }
key_equal key_eq() const { return rep.key_eq(); }
// Constructors
explicit dense_hash_set(size_type expected_max_items_in_table = 0,
const hasher& hf = hasher(),
const key_equal& eql = key_equal())
: rep(expected_max_items_in_table, hf, eql) { }
template <class InputIterator>
dense_hash_set(InputIterator f, InputIterator l,
size_type expected_max_items_in_table = 0,
const hasher& hf = hasher(),
const key_equal& eql = key_equal())
: rep(expected_max_items_in_table, hf, eql) {
rep.insert(f, l);
}
// We use the default copy constructor
// We use the default operator=()
// We use the default destructor
void clear() { rep.clear(); }
// This clears the hash set without resizing it down to the minimum
// bucket count, but rather keeps the number of buckets constant
void clear_no_resize() { rep.clear_no_resize(); }
void swap(dense_hash_set& hs) { rep.swap(hs.rep); }
// Functions concerning size
size_type size() const { return rep.size(); }
size_type max_size() const { return rep.max_size(); }
bool empty() const { return rep.empty(); }
size_type bucket_count() const { return rep.bucket_count(); }
size_type max_bucket_count() const { return rep.max_bucket_count(); }
void resize(size_type hint) { rep.resize(hint); }
void set_resizing_parameters(float shrink, float grow) {
return rep.set_resizing_parameters(shrink, grow);
}
// Lookup routines
iterator find(const key_type& key) const { return rep.find(key); }
size_type count(const key_type& key) const { return rep.count(key); }
pair<iterator, iterator> equal_range(const key_type& key) const {
return rep.equal_range(key);
}
// Insertion routines
pair<iterator, bool> insert(const value_type& obj) {
pair<typename ht::iterator, bool> p = rep.insert(obj);
return pair<iterator, bool>(p.first, p.second); // const to non-const
}
template <class InputIterator>
void insert(InputIterator f, InputIterator l) { rep.insert(f, l); }
void insert(const_iterator f, const_iterator l) { rep.insert(f, l); }
// required for std::insert_iterator; the passed-in iterator is ignored
iterator insert(iterator, const value_type& obj) { return insert(obj).first; }
// Deletion and empty routines
// THESE ARE NON-STANDARD! I make you specify an "impossible" key
// value to identify deleted and empty buckets. You can change the
// deleted key as time goes on, or get rid of it entirely to be insert-only.
void set_empty_key(const key_type& key) { rep.set_empty_key(key); }
void set_deleted_key(const key_type& key) { rep.set_deleted_key(key); }
void clear_deleted_key() { rep.clear_deleted_key(); }
// These are standard
size_type erase(const key_type& key) { return rep.erase(key); }
void erase(iterator it) { rep.erase(it); }
void erase(iterator f, iterator l) { rep.erase(f, l); }
// Comparison
bool operator==(const dense_hash_set& hs) const { return rep == hs.rep; }
bool operator!=(const dense_hash_set& hs) const { return rep != hs.rep; }
// I/O -- this is an add-on for writing metainformation to disk
bool write_metadata(FILE *fp) { return rep.write_metadata(fp); }
bool read_metadata(FILE *fp) { return rep.read_metadata(fp); }
bool write_nopointer_data(FILE *fp) { return rep.write_nopointer_data(fp); }
bool read_nopointer_data(FILE *fp) { return rep.read_nopointer_data(fp); }
};
template <class Val, class HashFcn, class EqualKey, class Alloc>
inline void swap(dense_hash_set<Val, HashFcn, EqualKey, Alloc>& hs1,
dense_hash_set<Val, HashFcn, EqualKey, Alloc>& hs2) {
hs1.swap(hs2);
}
_END_GOOGLE_NAMESPACE_
#endif /* _DENSE_HASH_SET_H_ */

View File

@@ -1,246 +0,0 @@
// Copyright (c) 2005, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ---
// Author: Craig Silverstein
//
// This is just a very thin wrapper over sparsehashtable.h, just
// like sgi stl's stl_hash_map is a very thin wrapper over
// stl_hashtable. The major thing we define is operator[], because
// we have a concept of a data_type which stl_hashtable doesn't
// (it only has a key and a value).
//
// We adhere mostly to the STL semantics for hash-map. One important
// exception is that insert() invalidates iterators entirely. On the
// plus side, though, delete() doesn't invalidate iterators at all, or
// even change the ordering of elements.
//
// Here are a few "power user" tips:
//
// 1) set_deleted_key():
// Unlike STL's hash_map, if you want to use erase() you
// must call set_deleted_key() after construction.
//
// 2) resize(0):
// When an item is deleted, its memory isn't freed right
// away. This is what allows you to iterate over a hashtable
// and call erase() without invalidating the iterator.
// To force the memory to be freed, call resize(0).
//
// 3) set_resizing_parameters(0.0, 0.8):
// Setting the shrink_resize_percent to 0.0 guarantees
// that the hash table will never shrink.
//
// Guide to what kind of hash_map to use:
// (1) dense_hash_map: fastest, uses the most memory
// (2) sparse_hash_map: slowest, uses the least memory
// (3) hash_map (STL): in the middle
// Typically I use sparse_hash_map when I care about space and/or when
// I need to save the hashtable on disk. I use hash_map otherwise. I
// don't personally use dense_hash_map ever; the only use of
// dense_hash_map I know of is to work around malloc() bugs in some
// systems (dense_hash_map has a particularly simple allocation scheme).
//
// - dense_hash_map has, typically, a factor of 2 memory overhead (if your
// data takes up X bytes, the hash_map uses X more bytes in overhead).
// - sparse_hash_map has about 2 bits overhead per entry.
// - sparse_hash_map can be 3-7 times slower than the others for lookup and,
// especially, inserts. See time_hash_map.cc for details.
//
// See /usr/(local/)?doc/sparsehash-0.1/sparse_hash_map.html
// for information about how to use this class.
#ifndef _SPARSE_HASH_MAP_H_
#define _SPARSE_HASH_MAP_H_
#include <google/sparsehash/sparseconfig.h>
#include <stdio.h> // for FILE * in read()/write()
#include <algorithm> // for the default template args
#include <functional> // for equal_to
#include <memory> // for alloc<>
#include <utility> // for pair<>
#include HASH_FUN_H // defined in config.h
#include <google/sparsehash/sparsehashtable.h>
_START_GOOGLE_NAMESPACE_
using STL_NAMESPACE::pair;
template <class Key, class T,
class HashFcn = SPARSEHASH_HASH<Key>, // defined in sparseconfig.h
class EqualKey = STL_NAMESPACE::equal_to<Key>,
class Alloc = STL_NAMESPACE::allocator<T> >
class sparse_hash_map {
private:
// Apparently select1st is not stl-standard, so we define our own
struct SelectKey {
const Key& operator()(const pair<const Key, T>& p) const {
return p.first;
}
};
// The actual data
typedef sparse_hashtable<pair<const Key, T>, Key, HashFcn,
SelectKey, EqualKey, Alloc> ht;
ht rep;
public:
typedef typename ht::key_type key_type;
typedef T data_type;
typedef T mapped_type;
typedef typename ht::value_type value_type;
typedef typename ht::hasher hasher;
typedef typename ht::key_equal key_equal;
typedef typename ht::size_type size_type;
typedef typename ht::difference_type difference_type;
typedef typename ht::pointer pointer;
typedef typename ht::const_pointer const_pointer;
typedef typename ht::reference reference;
typedef typename ht::const_reference const_reference;
typedef typename ht::iterator iterator;
typedef typename ht::const_iterator const_iterator;
// Iterator functions
iterator begin() { return rep.begin(); }
iterator end() { return rep.end(); }
const_iterator begin() const { return rep.begin(); }
const_iterator end() const { return rep.end(); }
// Accessor functions
hasher hash_funct() const { return rep.hash_funct(); }
key_equal key_eq() const { return rep.key_eq(); }
// Constructors
explicit sparse_hash_map(size_type expected_max_items_in_table = 0,
const hasher& hf = hasher(),
const key_equal& eql = key_equal())
: rep(expected_max_items_in_table, hf, eql) { }
template <class InputIterator>
sparse_hash_map(InputIterator f, InputIterator l,
size_type expected_max_items_in_table = 0,
const hasher& hf = hasher(),
const key_equal& eql = key_equal())
: rep(expected_max_items_in_table, hf, eql) {
rep.insert(f, l);
}
// We use the default copy constructor
// We use the default operator=()
// We use the default destructor
void clear() { rep.clear(); }
void swap(sparse_hash_map& hs) { rep.swap(hs.rep); }
// Functions concerning size
size_type size() const { return rep.size(); }
size_type max_size() const { return rep.max_size(); }
bool empty() const { return rep.empty(); }
size_type bucket_count() const { return rep.bucket_count(); }
size_type max_bucket_count() const { return rep.max_bucket_count(); }
void resize(size_type hint) { rep.resize(hint); }
void set_resizing_parameters(float shrink, float grow) {
return rep.set_resizing_parameters(shrink, grow);
}
// Lookup routines
iterator find(const key_type& key) { return rep.find(key); }
const_iterator find(const key_type& key) const { return rep.find(key); }
data_type& operator[](const key_type& key) { // This is our value-add!
iterator it = find(key);
if (it != end()) {
return it->second;
} else {
return insert(value_type(key, data_type())).first->second;
}
}
size_type count(const key_type& key) const { return rep.count(key); }
pair<iterator, iterator> equal_range(const key_type& key) {
return rep.equal_range(key);
}
pair<const_iterator, const_iterator> equal_range(const key_type& key) const {
return rep.equal_range(key);
}
// Insertion routines
pair<iterator, bool> insert(const value_type& obj) { return rep.insert(obj); }
template <class InputIterator>
void insert(InputIterator f, InputIterator l) { rep.insert(f, l); }
void insert(const_iterator f, const_iterator l) { rep.insert(f, l); }
// required for std::insert_iterator; the passed-in iterator is ignored
iterator insert(iterator, const value_type& obj) { return insert(obj).first; }
// Deletion routines
// THESE ARE NON-STANDARD! I make you specify an "impossible" key
// value to identify deleted buckets. You can change the key as
// time goes on, or get rid of it entirely to be insert-only.
void set_deleted_key(const key_type& key) {
rep.set_deleted_key(value_type(key, data_type())); // rep wants a value
}
void clear_deleted_key() { rep.clear_deleted_key(); }
// These are standard
size_type erase(const key_type& key) { return rep.erase(key); }
void erase(iterator it) { rep.erase(it); }
void erase(iterator f, iterator l) { rep.erase(f, l); }
// Comparison
bool operator==(const sparse_hash_map& hs) const { return rep == hs.rep; }
bool operator!=(const sparse_hash_map& hs) const { return rep != hs.rep; }
// I/O -- this is an add-on for writing metainformation to disk
bool write_metadata(FILE *fp) { return rep.write_metadata(fp); }
bool read_metadata(FILE *fp) { return rep.read_metadata(fp); }
bool write_nopointer_data(FILE *fp) { return rep.write_nopointer_data(fp); }
bool read_nopointer_data(FILE *fp) { return rep.read_nopointer_data(fp); }
};
// We need a global swap as well
template <class Key, class T, class HashFcn, class EqualKey, class Alloc>
inline void swap(sparse_hash_map<Key, T, HashFcn, EqualKey, Alloc>& hm1,
sparse_hash_map<Key, T, HashFcn, EqualKey, Alloc>& hm2) {
hm1.swap(hm2);
}
_END_GOOGLE_NAMESPACE_
#endif /* _SPARSE_HASH_MAP_H_ */

View File

@@ -1,231 +0,0 @@
// Copyright (c) 2005, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ---
// Author: Craig Silverstein
//
// This is just a very thin wrapper over sparsehashtable.h, just
// like sgi stl's stl_hash_set is a very thin wrapper over
// stl_hashtable. The major thing we define is operator[], because
// we have a concept of a data_type which stl_hashtable doesn't
// (it only has a key and a value).
//
// This is more different from sparse_hash_map than you might think,
// because all iterators for sets are const (you obviously can't
// change the key, and for sets there is no value).
//
// We adhere mostly to the STL semantics for hash-set. One important
// exception is that insert() invalidates iterators entirely. On the
// plus side, though, delete() doesn't invalidate iterators at all, or
// even change the ordering of elements.
//
// Here are a few "power user" tips:
//
// 1) set_deleted_key():
// Unlike STL's hash_map, if you want to use erase() you
// must call set_deleted_key() after construction.
//
// 2) resize(0):
// When an item is deleted, its memory isn't freed right
// away. This allows you to iterate over a hashtable,
// and call erase(), without invalidating the iterator.
// To force the memory to be freed, call resize(0).
//
// 3) set_resizing_parameters(0.0, 0.8):
// Setting the shrink_resize_percent to 0.0 guarantees
// that the hash table will never shrink.
//
// Guide to what kind of hash_set to use:
// (1) dense_hash_set: fastest, uses the most memory
// (2) sparse_hash_set: slowest, uses the least memory
// (3) hash_set (STL): in the middle
// Typically I use sparse_hash_set when I care about space and/or when
// I need to save the hashtable on disk. I use hash_set otherwise. I
// don't personally use dense_hash_set ever; the only use of
// dense_hash_set I know of is to work around malloc() bugs in some
// systems (dense_hash_set has a particularly simple allocation scheme).
//
// - dense_hash_set has, typically, a factor of 2 memory overhead (if your
// data takes up X bytes, the hash_set uses X more bytes in overhead).
// - sparse_hash_set has about 2 bits overhead per entry.
// - sparse_hash_map can be 3-7 times slower than the others for lookup and,
// especially, inserts. See time_hash_map.cc for details.
//
// See /usr/(local/)?doc/sparsehash-0.1/sparse_hash_set.html
// for information about how to use this class.
#ifndef _SPARSE_HASH_SET_H_
#define _SPARSE_HASH_SET_H_
#include <google/sparsehash/sparseconfig.h>
#include <stdio.h> // for FILE * in read()/write()
#include <algorithm> // for the default template args
#include <functional> // for equal_to
#include <memory> // for alloc<>
#include <utility> // for pair<>
#include HASH_FUN_H // defined in config.h
#include <google/sparsehash/sparsehashtable.h>
_START_GOOGLE_NAMESPACE_
using STL_NAMESPACE::pair;
template <class Value,
class HashFcn = SPARSEHASH_HASH<Value>, // defined in sparseconfig.h
class EqualKey = STL_NAMESPACE::equal_to<Value>,
class Alloc = STL_NAMESPACE::allocator<Value> >
class sparse_hash_set {
private:
// Apparently identity is not stl-standard, so we define our own
struct Identity {
Value& operator()(Value& v) const { return v; }
const Value& operator()(const Value& v) const { return v; }
};
// The actual data
typedef sparse_hashtable<Value, Value, HashFcn, Identity, EqualKey, Alloc> ht;
ht rep;
public:
typedef typename ht::key_type key_type;
typedef typename ht::value_type value_type;
typedef typename ht::hasher hasher;
typedef typename ht::key_equal key_equal;
typedef typename ht::size_type size_type;
typedef typename ht::difference_type difference_type;
typedef typename ht::const_pointer pointer;
typedef typename ht::const_pointer const_pointer;
typedef typename ht::const_reference reference;
typedef typename ht::const_reference const_reference;
typedef typename ht::const_iterator iterator;
typedef typename ht::const_iterator const_iterator;
// Iterator functions -- recall all iterators are const
iterator begin() const { return rep.begin(); }
iterator end() const { return rep.end(); }
// Accessor functions
hasher hash_funct() const { return rep.hash_funct(); }
key_equal key_eq() const { return rep.key_eq(); }
// Constructors
explicit sparse_hash_set(size_type expected_max_items_in_table = 0,
const hasher& hf = hasher(),
const key_equal& eql = key_equal())
: rep(expected_max_items_in_table, hf, eql) { }
template <class InputIterator>
sparse_hash_set(InputIterator f, InputIterator l,
size_type expected_max_items_in_table = 0,
const hasher& hf = hasher(),
const key_equal& eql = key_equal())
: rep(expected_max_items_in_table, hf, eql) {
rep.insert(f, l);
}
// We use the default copy constructor
// We use the default operator=()
// We use the default destructor
void clear() { rep.clear(); }
void swap(sparse_hash_set& hs) { rep.swap(hs.rep); }
// Functions concerning size
size_type size() const { return rep.size(); }
size_type max_size() const { return rep.max_size(); }
bool empty() const { return rep.empty(); }
size_type bucket_count() const { return rep.bucket_count(); }
size_type max_bucket_count() const { return rep.max_bucket_count(); }
void resize(size_type hint) { rep.resize(hint); }
void set_resizing_parameters(float shrink, float grow) {
return rep.set_resizing_parameters(shrink, grow);
}
// Lookup routines
iterator find(const key_type& key) const { return rep.find(key); }
size_type count(const key_type& key) const { return rep.count(key); }
pair<iterator, iterator> equal_range(const key_type& key) const {
return rep.equal_range(key);
}
// Insertion routines
pair<iterator, bool> insert(const value_type& obj) {
pair<typename ht::iterator, bool> p = rep.insert(obj);
return pair<iterator, bool>(p.first, p.second); // const to non-const
}
template <class InputIterator>
void insert(InputIterator f, InputIterator l) { rep.insert(f, l); }
void insert(const_iterator f, const_iterator l) { rep.insert(f, l); }
// required for std::insert_iterator; the passed-in iterator is ignored
iterator insert(iterator, const value_type& obj) { return insert(obj).first; }
// Deletion routines
// THESE ARE NON-STANDARD! I make you specify an "impossible" key
// value to identify deleted buckets. You can change the key as
// time goes on, or get rid of it entirely to be insert-only.
void set_deleted_key(const key_type& key) { rep.set_deleted_key(key); }
void clear_deleted_key() { rep.clear_deleted_key(); }
// These are standard
size_type erase(const key_type& key) { return rep.erase(key); }
void erase(iterator it) { rep.erase(it); }
void erase(iterator f, iterator l) { rep.erase(f, l); }
// Comparison
bool operator==(const sparse_hash_set& hs) const { return rep == hs.rep; }
bool operator!=(const sparse_hash_set& hs) const { return rep != hs.rep; }
// I/O -- this is an add-on for writing metainformation to disk
bool write_metadata(FILE *fp) { return rep.write_metadata(fp); }
bool read_metadata(FILE *fp) { return rep.read_metadata(fp); }
bool write_nopointer_data(FILE *fp) { return rep.write_nopointer_data(fp); }
bool read_nopointer_data(FILE *fp) { return rep.read_nopointer_data(fp); }
};
template <class Val, class HashFcn, class EqualKey, class Alloc>
inline void swap(sparse_hash_set<Val, HashFcn, EqualKey, Alloc>& hs1,
sparse_hash_set<Val, HashFcn, EqualKey, Alloc>& hs2) {
hs1.swap(hs2);
}
_END_GOOGLE_NAMESPACE_
#endif /* _SPARSE_HASH_SET_H_ */

View File

@@ -1,986 +0,0 @@
// Copyright (c) 2005, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ---
// Author: Craig Silverstein
//
// A dense hashtable is a particular implementation of
// a hashtable: one that is meant to minimize memory allocation.
// It does this by using an array to store all the data. We
// steal a value from the key space to indicate "empty" array
// elements (ie indices where no item lives) and another to indicate
// "deleted" elements.
//
// (Note it is possible to change the value of the delete key
// on the fly; you can even remove it, though after that point
// the hashtable is insert_only until you set it again. The empty
// value however can't be changed.)
//
// To minimize allocation and pointer overhead, we use internal
// probing, in which the hashtable is a single table, and collisions
// are resolved by trying to insert again in another bucket. The
// most cache-efficient internal probing schemes are linear probing
// (which suffers, alas, from clumping) and quadratic probing, which
// is what we implement by default.
//
// Type requirements: value_type is required to be Copy Constructible
// and Default Constructible. It is not required to be (and commonly
// isn't) Assignable.
//
// You probably shouldn't use this code directly. Use
// <google/dense_hash_map> or <google/dense_hash_set> instead.
// You can change the following below:
// HT_OCCUPANCY_FLT -- how full before we double size
// HT_EMPTY_FLT -- how empty before we halve size
// HT_MIN_BUCKETS -- default smallest bucket size
//
// You can also change enlarge_resize_percent (which defaults to
// HT_OCCUPANCY_FLT), and shrink_resize_percent (which defaults to
// HT_EMPTY_FLT) with set_resizing_parameters().
//
// How to decide what values to use?
// shrink_resize_percent's default of .4 * OCCUPANCY_FLT, is probably good.
// HT_MIN_BUCKETS is probably unnecessary since you can specify
// (indirectly) the starting number of buckets at construct-time.
// For enlarge_resize_percent, you can use this chart to try to trade-off
// expected lookup time to the space taken up. By default, this
// code uses quadratic probing, though you can change it to linear
// via _JUMP below if you really want to.
//
// From http://www.augustana.ca/~mohrj/courses/1999.fall/csc210/lecture_notes/hashing.html
// NUMBER OF PROBES / LOOKUP Successful Unsuccessful
// Quadratic collision resolution 1 - ln(1-L) - L/2 1/(1-L) - L - ln(1-L)
// Linear collision resolution [1+1/(1-L)]/2 [1+1/(1-L)2]/2
//
// -- enlarge_resize_percent -- 0.10 0.50 0.60 0.75 0.80 0.90 0.99
// QUADRATIC COLLISION RES.
// probes/successful lookup 1.05 1.44 1.62 2.01 2.21 2.85 5.11
// probes/unsuccessful lookup 1.11 2.19 2.82 4.64 5.81 11.4 103.6
// LINEAR COLLISION RES.
// probes/successful lookup 1.06 1.5 1.75 2.5 3.0 5.5 50.5
// probes/unsuccessful lookup 1.12 2.5 3.6 8.5 13.0 50.0 5000.0
#ifndef _DENSEHASHTABLE_H_
#define _DENSEHASHTABLE_H_
// The probing method
// Linear probing
// #define JUMP_(key, num_probes) ( 1 )
// Quadratic-ish probing
#define JUMP_(key, num_probes) ( num_probes )
// Hashtable class, used to implement the hashed associative containers
// hash_set and hash_map.
#include <google/sparsehash/sparseconfig.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h> // for abort()
#include <algorithm> // For swap(), eg
#include <iostream> // For cerr
#include <memory> // For uninitialized_fill, uninitialized_copy
#include <utility> // for pair<>
#include <iterator> // for facts about iterator tags
#include <google/type_traits.h> // for true_type, integral_constant, etc.
_START_GOOGLE_NAMESPACE_
using STL_NAMESPACE::pair;
template <class Value, class Key, class HashFcn,
class ExtractKey, class EqualKey, class Alloc>
class dense_hashtable;
template <class V, class K, class HF, class ExK, class EqK, class A>
struct dense_hashtable_iterator;
template <class V, class K, class HF, class ExK, class EqK, class A>
struct dense_hashtable_const_iterator;
// We're just an array, but we need to skip over empty and deleted elements
template <class V, class K, class HF, class ExK, class EqK, class A>
struct dense_hashtable_iterator {
public:
typedef dense_hashtable_iterator<V,K,HF,ExK,EqK,A> iterator;
typedef dense_hashtable_const_iterator<V,K,HF,ExK,EqK,A> const_iterator;
typedef STL_NAMESPACE::forward_iterator_tag iterator_category;
typedef V value_type;
typedef ptrdiff_t difference_type;
typedef size_t size_type;
typedef V& reference; // Value
typedef V* pointer;
// "Real" constructor and default constructor
dense_hashtable_iterator(const dense_hashtable<V,K,HF,ExK,EqK,A> *h,
pointer it, pointer it_end, bool advance)
: ht(h), pos(it), end(it_end) {
if (advance) advance_past_empty_and_deleted();
}
dense_hashtable_iterator() { }
// The default destructor is fine; we don't define one
// The default operator= is fine; we don't define one
// Happy dereferencer
reference operator*() const { return *pos; }
pointer operator->() const { return &(operator*()); }
// Arithmetic. The only hard part is making sure that
// we're not on an empty or marked-deleted array element
void advance_past_empty_and_deleted() {
while ( pos != end && (ht->test_empty(*this) || ht->test_deleted(*this)) )
++pos;
}
iterator& operator++() {
assert(pos != end); ++pos; advance_past_empty_and_deleted(); return *this;
}
iterator operator++(int) { iterator tmp(*this); ++*this; return tmp; }
// Comparison.
bool operator==(const iterator& it) const { return pos == it.pos; }
bool operator!=(const iterator& it) const { return pos != it.pos; }
// The actual data
const dense_hashtable<V,K,HF,ExK,EqK,A> *ht;
pointer pos, end;
};
// Now do it all again, but with const-ness!
template <class V, class K, class HF, class ExK, class EqK, class A>
struct dense_hashtable_const_iterator {
public:
typedef dense_hashtable_iterator<V,K,HF,ExK,EqK,A> iterator;
typedef dense_hashtable_const_iterator<V,K,HF,ExK,EqK,A> const_iterator;
typedef STL_NAMESPACE::forward_iterator_tag iterator_category;
typedef V value_type;
typedef ptrdiff_t difference_type;
typedef size_t size_type;
typedef const V& reference; // Value
typedef const V* pointer;
// "Real" constructor and default constructor
dense_hashtable_const_iterator(const dense_hashtable<V,K,HF,ExK,EqK,A> *h,
pointer it, pointer it_end, bool advance)
: ht(h), pos(it), end(it_end) {
if (advance) advance_past_empty_and_deleted();
}
dense_hashtable_const_iterator() { }
// This lets us convert regular iterators to const iterators
dense_hashtable_const_iterator(const iterator &it)
: ht(it.ht), pos(it.pos), end(it.end) { }
// The default destructor is fine; we don't define one
// The default operator= is fine; we don't define one
// Happy dereferencer
reference operator*() const { return *pos; }
pointer operator->() const { return &(operator*()); }
// Arithmetic. The only hard part is making sure that
// we're not on an empty or marked-deleted array element
void advance_past_empty_and_deleted() {
while ( pos != end && (ht->test_empty(*this) || ht->test_deleted(*this)) )
++pos;
}
const_iterator& operator++() {
assert(pos != end); ++pos; advance_past_empty_and_deleted(); return *this;
}
const_iterator operator++(int) { const_iterator tmp(*this); ++*this; return tmp; }
// Comparison.
bool operator==(const const_iterator& it) const { return pos == it.pos; }
bool operator!=(const const_iterator& it) const { return pos != it.pos; }
// The actual data
const dense_hashtable<V,K,HF,ExK,EqK,A> *ht;
pointer pos, end;
};
template <class Value, class Key, class HashFcn,
class ExtractKey, class EqualKey, class Alloc>
class dense_hashtable {
public:
typedef Key key_type;
typedef Value value_type;
typedef HashFcn hasher;
typedef EqualKey key_equal;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef dense_hashtable_iterator<Value, Key, HashFcn,
ExtractKey, EqualKey, Alloc>
iterator;
typedef dense_hashtable_const_iterator<Value, Key, HashFcn,
ExtractKey, EqualKey, Alloc>
const_iterator;
// How full we let the table get before we resize. Knuth says .8 is
// good -- higher causes us to probe too much, though saves memory
static const float HT_OCCUPANCY_FLT; // = 0.8;
// How empty we let the table get before we resize lower.
// (0.0 means never resize lower.)
// It should be less than OCCUPANCY_FLT / 2 or we thrash resizing
static const float HT_EMPTY_FLT; // = 0.4 * HT_OCCUPANCY_FLT
// Minimum size we're willing to let hashtables be.
// Must be a power of two, and at least 4.
// Note, however, that for a given hashtable, the initial size is a
// function of the first constructor arg, and may be >HT_MIN_BUCKETS.
static const size_t HT_MIN_BUCKETS = 4;
// By default, if you don't specify a hashtable size at
// construction-time, we use this size. Must be a power of two, and
// at least HT_MIN_BUCKETS.
static const size_t HT_DEFAULT_STARTING_BUCKETS = 32;
// ITERATOR FUNCTIONS
iterator begin() { return iterator(this, table,
table + num_buckets, true); }
iterator end() { return iterator(this, table + num_buckets,
table + num_buckets, true); }
const_iterator begin() const { return const_iterator(this, table,
table+num_buckets,true);}
const_iterator end() const { return const_iterator(this, table + num_buckets,
table+num_buckets,true);}
// ACCESSOR FUNCTIONS for the things we templatize on, basically
hasher hash_funct() const { return hash; }
key_equal key_eq() const { return equals; }
// Annoyingly, we can't copy values around, because they might have
// const components (they're probably pair<const X, Y>). We use
// explicit destructor invocation and placement new to get around
// this. Arg.
private:
void set_value(value_type* dst, const value_type& src) {
dst->~value_type();
new(dst) value_type(src);
}
void destroy_buckets(size_type first, size_type last) {
for ( ; first != last; ++first)
table[first].~value_type();
}
// DELETE HELPER FUNCTIONS
// This lets the user describe a key that will indicate deleted
// table entries. This key should be an "impossible" entry --
// if you try to insert it for real, you won't be able to retrieve it!
// (NB: while you pass in an entire value, only the key part is looked
// at. This is just because I don't know how to assign just a key.)
private:
void squash_deleted() { // gets rid of any deleted entries we have
if ( num_deleted ) { // get rid of deleted before writing
dense_hashtable tmp(*this); // copying will get rid of deleted
swap(tmp); // now we are tmp
}
assert(num_deleted == 0);
}
public:
void set_deleted_key(const value_type &val) {
// the empty indicator (if specified) and the deleted indicator
// must be different
assert(!use_empty || !equals(get_key(val), get_key(emptyval)));
// It's only safe to change what "deleted" means if we purge deleted guys
squash_deleted();
use_deleted = true;
set_value(&delval, val);
}
void clear_deleted_key() {
squash_deleted();
use_deleted = false;
}
// These are public so the iterators can use them
// True if the item at position bucknum is "deleted" marker
bool test_deleted(size_type bucknum) const {
// The num_deleted test is crucial for read(): after read(), the ht values
// are garbage, and we don't want to think some of them are deleted.
return (use_deleted && num_deleted > 0 &&
equals(get_key(delval), get_key(table[bucknum])));
}
bool test_deleted(const iterator &it) const {
return (use_deleted && num_deleted > 0 &&
equals(get_key(delval), get_key(*it)));
}
bool test_deleted(const const_iterator &it) const {
return (use_deleted && num_deleted > 0 &&
equals(get_key(delval), get_key(*it)));
}
// Set it so test_deleted is true. true if object didn't used to be deleted
// See below (at erase()) to explain why we allow const_iterators
bool set_deleted(const_iterator &it) {
assert(use_deleted); // bad if set_deleted_key() wasn't called
bool retval = !test_deleted(it);
// &* converts from iterator to value-type
set_value(const_cast<value_type*>(&(*it)), delval);
return retval;
}
// Set it so test_deleted is false. true if object used to be deleted
bool clear_deleted(const_iterator &it) {
assert(use_deleted); // bad if set_deleted_key() wasn't called
// happens automatically when we assign something else in its place
return test_deleted(it);
}
// EMPTY HELPER FUNCTIONS
// This lets the user describe a key that will indicate empty (unused)
// table entries. This key should be an "impossible" entry --
// if you try to insert it for real, you won't be able to retrieve it!
// (NB: while you pass in an entire value, only the key part is looked
// at. This is just because I don't know how to assign just a key.)
public:
// These are public so the iterators can use them
// True if the item at position bucknum is "empty" marker
bool test_empty(size_type bucknum) const {
assert(use_empty); // we always need to know what's empty!
return equals(get_key(emptyval), get_key(table[bucknum]));
}
bool test_empty(const iterator &it) const {
assert(use_empty); // we always need to know what's empty!
return equals(get_key(emptyval), get_key(*it));
}
bool test_empty(const const_iterator &it) const {
assert(use_empty); // we always need to know what's empty!
return equals(get_key(emptyval), get_key(*it));
}
private:
// You can either set a range empty or an individual element
void set_empty(size_type bucknum) {
assert(use_empty);
set_value(&table[bucknum], emptyval);
}
void fill_range_with_empty(value_type* table_start, value_type* table_end) {
// Like set_empty(range), but doesn't destroy previous contents
STL_NAMESPACE::uninitialized_fill(table_start, table_end, emptyval);
}
void set_empty(size_type buckstart, size_type buckend) {
assert(use_empty);
destroy_buckets(buckstart, buckend);
fill_range_with_empty(table + buckstart, table + buckend);
}
public:
// TODO(csilvers): change all callers of this to pass in a key instead,
// and take a const key_type instead of const value_type.
void set_empty_key(const value_type &val) {
// Once you set the empty key, you can't change it
assert(!use_empty);
// The deleted indicator (if specified) and the empty indicator
// must be different.
assert(!use_deleted || !equals(get_key(val), get_key(delval)));
use_empty = true;
set_value(&emptyval, val);
assert(!table); // must set before first use
// num_buckets was set in constructor even though table was NULL
table = (value_type *) malloc(num_buckets * sizeof(*table));
assert(table);
fill_range_with_empty(table, table + num_buckets);
}
// FUNCTIONS CONCERNING SIZE
public:
size_type size() const { return num_elements - num_deleted; }
// Buckets are always a power of 2
size_type max_size() const { return (size_type(-1) >> 1U) + 1; }
bool empty() const { return size() == 0; }
size_type bucket_count() const { return num_buckets; }
size_type max_bucket_count() const { return max_size(); }
size_type nonempty_bucket_count() const { return num_elements; }
private:
// Because of the above, size_type(-1) is never legal; use it for errors
static const size_type ILLEGAL_BUCKET = size_type(-1);
private:
// This is the smallest size a hashtable can be without being too crowded
// If you like, you can give a min #buckets as well as a min #elts
size_type min_size(size_type num_elts, size_type min_buckets_wanted) {
size_type sz = HT_MIN_BUCKETS; // min buckets allowed
while ( sz < min_buckets_wanted || num_elts >= sz * enlarge_resize_percent )
sz *= 2;
return sz;
}
// Used after a string of deletes
void maybe_shrink() {
assert(num_elements >= num_deleted);
assert((bucket_count() & (bucket_count()-1)) == 0); // is a power of two
assert(bucket_count() >= HT_MIN_BUCKETS);
// If you construct a hashtable with < HT_DEFAULT_STARTING_BUCKETS,
// we'll never shrink until you get relatively big, and we'll never
// shrink below HT_DEFAULT_STARTING_BUCKETS. Otherwise, something
// like "dense_hash_set<int> x; x.insert(4); x.erase(4);" will
// shrink us down to HT_MIN_BUCKETS buckets, which is too small.
if (shrink_threshold > 0 &&
(num_elements-num_deleted) < shrink_threshold &&
bucket_count() > HT_DEFAULT_STARTING_BUCKETS ) {
size_type sz = bucket_count() / 2; // find how much we should shrink
while ( sz > HT_DEFAULT_STARTING_BUCKETS &&
(num_elements - num_deleted) < sz * shrink_resize_percent )
sz /= 2; // stay a power of 2
dense_hashtable tmp(*this, sz); // Do the actual resizing
swap(tmp); // now we are tmp
}
consider_shrink = false; // because we just considered it
}
// We'll let you resize a hashtable -- though this makes us copy all!
// When you resize, you say, "make it big enough for this many more elements"
void resize_delta(size_type delta) {
if ( consider_shrink ) // see if lots of deletes happened
maybe_shrink();
if ( bucket_count() > HT_MIN_BUCKETS &&
(num_elements + delta) <= enlarge_threshold )
return; // we're ok as we are
// Sometimes, we need to resize just to get rid of all the
// "deleted" buckets that are clogging up the hashtable. So when
// deciding whether to resize, count the deleted buckets (which
// are currently taking up room). But later, when we decide what
// size to resize to, *don't* count deleted buckets, since they
// get discarded during the resize.
const size_type needed_size = min_size(num_elements + delta, 0);
if ( needed_size > bucket_count() ) { // we don't have enough buckets
const size_type resize_to = min_size(num_elements - num_deleted + delta,
0);
dense_hashtable tmp(*this, resize_to);
swap(tmp); // now we are tmp
}
}
// Increase number of buckets, assuming value_type has trivial copy
// constructor and destructor. (Really, we want it to have "trivial
// move", because that's what realloc does. But there's no way to
// capture that using type_traits, so we pretend that move(x, y) is
// equivalent to "x.~T(); new(x) T(y);" which is pretty much
// correct, if a bit conservative.)
void expand_array(size_t resize_to, true_type) {
table = (value_type *) realloc(table, resize_to * sizeof(value_type));
assert(table);
fill_range_with_empty(table + num_buckets, table + resize_to);
}
// Increase number of buckets, without special assumptions about value_type.
// TODO(austern): make this exception safe. Handle exceptions from
// value_type's copy constructor.
void expand_array(size_t resize_to, false_type) {
value_type* new_table =
(value_type *) malloc(resize_to * sizeof(value_type));
assert(new_table);
STL_NAMESPACE::uninitialized_copy(table, table + num_buckets, new_table);
fill_range_with_empty(new_table + num_buckets, new_table + resize_to);
destroy_buckets(0, num_buckets);
free(table);
table = new_table;
}
// Used to actually do the rehashing when we grow/shrink a hashtable
void copy_from(const dense_hashtable &ht, size_type min_buckets_wanted) {
clear(); // clear table, set num_deleted to 0
// If we need to change the size of our table, do it now
const size_type resize_to = min_size(ht.size(), min_buckets_wanted);
if ( resize_to > bucket_count() ) { // we don't have enough buckets
typedef integral_constant<bool,
(has_trivial_copy<value_type>::value &&
has_trivial_destructor<value_type>::value)>
realloc_ok; // we pretend mv(x,y) == "x.~T(); new(x) T(y)"
expand_array(resize_to, realloc_ok());
num_buckets = resize_to;
reset_thresholds();
}
// We use a normal iterator to get non-deleted bcks from ht
// We could use insert() here, but since we know there are
// no duplicates and no deleted items, we can be more efficient
assert((bucket_count() & (bucket_count()-1)) == 0); // a power of two
for ( const_iterator it = ht.begin(); it != ht.end(); ++it ) {
size_type num_probes = 0; // how many times we've probed
size_type bucknum;
const size_type bucket_count_minus_one = bucket_count() - 1;
for (bucknum = hash(get_key(*it)) & bucket_count_minus_one;
!test_empty(bucknum); // not empty
bucknum = (bucknum + JUMP_(key, num_probes)) & bucket_count_minus_one) {
++num_probes;
assert(num_probes < bucket_count()); // or else the hashtable is full
}
set_value(&table[bucknum], *it); // copies the value to here
num_elements++;
}
}
// Required by the spec for hashed associative container
public:
// Though the docs say this should be num_buckets, I think it's much
// more useful as req_elements. As a special feature, calling with
// req_elements==0 will cause us to shrink if we can, saving space.
void resize(size_type req_elements) { // resize to this or larger
if ( consider_shrink || req_elements == 0 )
maybe_shrink();
if ( req_elements > num_elements )
return resize_delta(req_elements - num_elements);
}
// Change the value of shrink_resize_percent and
// enlarge_resize_percent. The description at the beginning of this
// file explains how to choose the values. Setting the shrink
// parameter to 0.0 ensures that the table never shrinks.
void set_resizing_parameters(float shrink, float grow) {
assert(shrink >= 0.0);
assert(grow <= 1.0);
assert(shrink <= grow/2.0);
shrink_resize_percent = shrink;
enlarge_resize_percent = grow;
reset_thresholds();
}
// CONSTRUCTORS -- as required by the specs, we take a size,
// but also let you specify a hashfunction, key comparator,
// and key extractor. We also define a copy constructor and =.
// DESTRUCTOR -- needs to free the table
explicit dense_hashtable(size_type expected_max_items_in_table = 0,
const HashFcn& hf = HashFcn(),
const EqualKey& eql = EqualKey(),
const ExtractKey& ext = ExtractKey())
: hash(hf), equals(eql), get_key(ext), num_deleted(0),
use_deleted(false), use_empty(false),
delval(), emptyval(), enlarge_resize_percent(HT_OCCUPANCY_FLT),
shrink_resize_percent(HT_EMPTY_FLT), table(NULL),
num_buckets(expected_max_items_in_table == 0
? HT_DEFAULT_STARTING_BUCKETS
: min_size(expected_max_items_in_table, 0)),
num_elements(0) {
// table is NULL until emptyval is set. However, we set num_buckets
// here so we know how much space to allocate once emptyval is set
reset_thresholds();
}
// As a convenience for resize(), we allow an optional second argument
// which lets you make this new hashtable a different size than ht
dense_hashtable(const dense_hashtable& ht,
size_type min_buckets_wanted = HT_DEFAULT_STARTING_BUCKETS)
: hash(ht.hash), equals(ht.equals), get_key(ht.get_key), num_deleted(0),
use_deleted(ht.use_deleted), use_empty(ht.use_empty),
delval(ht.delval), emptyval(ht.emptyval),
enlarge_resize_percent(ht.enlarge_resize_percent),
shrink_resize_percent(ht.shrink_resize_percent), table(NULL),
num_buckets(0), num_elements(0) {
reset_thresholds();
copy_from(ht, min_buckets_wanted); // copy_from() ignores deleted entries
}
dense_hashtable& operator= (const dense_hashtable& ht) {
if (&ht == this) return *this; // don't copy onto ourselves
clear();
hash = ht.hash;
equals = ht.equals;
get_key = ht.get_key;
use_deleted = ht.use_deleted;
use_empty = ht.use_empty;
set_value(&delval, ht.delval);
set_value(&emptyval, ht.emptyval);
enlarge_resize_percent = ht.enlarge_resize_percent;
shrink_resize_percent = ht.shrink_resize_percent;
copy_from(ht, HT_MIN_BUCKETS); // sets num_deleted to 0 too
return *this;
}
~dense_hashtable() {
if (table) {
destroy_buckets(0, num_buckets);
free(table);
}
}
// Many STL algorithms use swap instead of copy constructors
void swap(dense_hashtable& ht) {
STL_NAMESPACE::swap(hash, ht.hash);
STL_NAMESPACE::swap(equals, ht.equals);
STL_NAMESPACE::swap(get_key, ht.get_key);
STL_NAMESPACE::swap(num_deleted, ht.num_deleted);
STL_NAMESPACE::swap(use_deleted, ht.use_deleted);
STL_NAMESPACE::swap(use_empty, ht.use_empty);
STL_NAMESPACE::swap(enlarge_resize_percent, ht.enlarge_resize_percent);
STL_NAMESPACE::swap(shrink_resize_percent, ht.shrink_resize_percent);
{ value_type tmp; // for annoying reasons, swap() doesn't work
set_value(&tmp, delval);
set_value(&delval, ht.delval);
set_value(&ht.delval, tmp);
}
{ value_type tmp; // for annoying reasons, swap() doesn't work
set_value(&tmp, emptyval);
set_value(&emptyval, ht.emptyval);
set_value(&ht.emptyval, tmp);
}
STL_NAMESPACE::swap(table, ht.table);
STL_NAMESPACE::swap(num_buckets, ht.num_buckets);
STL_NAMESPACE::swap(num_elements, ht.num_elements);
reset_thresholds();
ht.reset_thresholds();
}
// It's always nice to be able to clear a table without deallocating it
void clear() {
if (table)
destroy_buckets(0, num_buckets);
num_buckets = min_size(0,0); // our new size
reset_thresholds();
table = (value_type *) realloc(table, num_buckets * sizeof(*table));
assert(table);
fill_range_with_empty(table, table + num_buckets);
num_elements = 0;
num_deleted = 0;
}
// Clear the table without resizing it.
// Mimicks the stl_hashtable's behaviour when clear()-ing in that it
// does not modify the bucket count
void clear_no_resize() {
if (table) {
set_empty(0, num_buckets);
}
// don't consider to shrink before another erase()
reset_thresholds();
num_elements = 0;
num_deleted = 0;
}
// LOOKUP ROUTINES
private:
// Returns a pair of positions: 1st where the object is, 2nd where
// it would go if you wanted to insert it. 1st is ILLEGAL_BUCKET
// if object is not found; 2nd is ILLEGAL_BUCKET if it is.
// Note: because of deletions where-to-insert is not trivial: it's the
// first deleted bucket we see, as long as we don't find the key later
pair<size_type, size_type> find_position(const key_type &key) const {
size_type num_probes = 0; // how many times we've probed
const size_type bucket_count_minus_one = bucket_count() - 1;
size_type bucknum = hash(key) & bucket_count_minus_one;
size_type insert_pos = ILLEGAL_BUCKET; // where we would insert
while ( 1 ) { // probe until something happens
if ( test_empty(bucknum) ) { // bucket is empty
if ( insert_pos == ILLEGAL_BUCKET ) // found no prior place to insert
return pair<size_type,size_type>(ILLEGAL_BUCKET, bucknum);
else
return pair<size_type,size_type>(ILLEGAL_BUCKET, insert_pos);
} else if ( test_deleted(bucknum) ) {// keep searching, but mark to insert
if ( insert_pos == ILLEGAL_BUCKET )
insert_pos = bucknum;
} else if ( equals(key, get_key(table[bucknum])) ) {
return pair<size_type,size_type>(bucknum, ILLEGAL_BUCKET);
}
++num_probes; // we're doing another probe
bucknum = (bucknum + JUMP_(key, num_probes)) & bucket_count_minus_one;
assert(num_probes < bucket_count()); // don't probe too many times!
}
}
public:
iterator find(const key_type& key) {
if ( size() == 0 ) return end();
pair<size_type, size_type> pos = find_position(key);
if ( pos.first == ILLEGAL_BUCKET ) // alas, not there
return end();
else
return iterator(this, table + pos.first, table + num_buckets, false);
}
const_iterator find(const key_type& key) const {
if ( size() == 0 ) return end();
pair<size_type, size_type> pos = find_position(key);
if ( pos.first == ILLEGAL_BUCKET ) // alas, not there
return end();
else
return const_iterator(this, table + pos.first, table+num_buckets, false);
}
// Counts how many elements have key key. For maps, it's either 0 or 1.
size_type count(const key_type &key) const {
pair<size_type, size_type> pos = find_position(key);
return pos.first == ILLEGAL_BUCKET ? 0 : 1;
}
// Likewise, equal_range doesn't really make sense for us. Oh well.
pair<iterator,iterator> equal_range(const key_type& key) {
const iterator pos = find(key); // either an iterator or end
return pair<iterator,iterator>(pos, pos);
}
pair<const_iterator,const_iterator> equal_range(const key_type& key) const {
const const_iterator pos = find(key); // either an iterator or end
return pair<iterator,iterator>(pos, pos);
}
// INSERTION ROUTINES
private:
// If you know *this is big enough to hold obj, use this routine
pair<iterator, bool> insert_noresize(const value_type& obj) {
// First, double-check we're not inserting delval or emptyval
assert(!use_empty || !equals(get_key(obj), get_key(emptyval)));
assert(!use_deleted || !equals(get_key(obj), get_key(delval)));
const pair<size_type,size_type> pos = find_position(get_key(obj));
if ( pos.first != ILLEGAL_BUCKET) { // object was already there
return pair<iterator,bool>(iterator(this, table + pos.first,
table + num_buckets, false),
false); // false: we didn't insert
} else { // pos.second says where to put it
if ( test_deleted(pos.second) ) { // just replace if it's been del.
const_iterator delpos(this, table + pos.second, // shrug:
table + num_buckets, false);// shouldn't need const
clear_deleted(delpos);
assert( num_deleted > 0);
--num_deleted; // used to be, now it isn't
} else {
++num_elements; // replacing an empty bucket
}
set_value(&table[pos.second], obj);
return pair<iterator,bool>(iterator(this, table + pos.second,
table + num_buckets, false),
true); // true: we did insert
}
}
public:
// This is the normal insert routine, used by the outside world
pair<iterator, bool> insert(const value_type& obj) {
resize_delta(1); // adding an object, grow if need be
return insert_noresize(obj);
}
// When inserting a lot at a time, we specialize on the type of iterator
template <class InputIterator>
void insert(InputIterator f, InputIterator l) {
// specializes on iterator type
insert(f, l, typename STL_NAMESPACE::iterator_traits<InputIterator>::iterator_category());
}
// Iterator supports operator-, resize before inserting
template <class ForwardIterator>
void insert(ForwardIterator f, ForwardIterator l,
STL_NAMESPACE::forward_iterator_tag) {
size_type n = STL_NAMESPACE::distance(f, l); // TODO(csilvers): standard?
resize_delta(n);
for ( ; n > 0; --n, ++f)
insert_noresize(*f);
}
// Arbitrary iterator, can't tell how much to resize
template <class InputIterator>
void insert(InputIterator f, InputIterator l,
STL_NAMESPACE::input_iterator_tag) {
for ( ; f != l; ++f)
insert(*f);
}
// DELETION ROUTINES
size_type erase(const key_type& key) {
// First, double-check we're not trying to erase delval or emptyval
assert(!use_empty || !equals(key, get_key(emptyval)));
assert(!use_deleted || !equals(key, get_key(delval)));
const_iterator pos = find(key); // shrug: shouldn't need to be const
if ( pos != end() ) {
assert(!test_deleted(pos)); // or find() shouldn't have returned it
set_deleted(pos);
++num_deleted;
consider_shrink = true; // will think about shrink after next insert
return 1; // because we deleted one thing
} else {
return 0; // because we deleted nothing
}
}
// This is really evil: really it should be iterator, not const_iterator.
// But...the only reason keys are const is to allow lookup.
// Since that's a moot issue for deleted keys, we allow const_iterators
void erase(const_iterator pos) {
if ( pos == end() ) return; // sanity check
if ( set_deleted(pos) ) { // true if object has been newly deleted
++num_deleted;
consider_shrink = true; // will think about shrink after next insert
}
}
void erase(const_iterator f, const_iterator l) {
for ( ; f != l; ++f) {
if ( set_deleted(f) ) // should always be true
++num_deleted;
}
consider_shrink = true; // will think about shrink after next insert
}
// COMPARISON
bool operator==(const dense_hashtable& ht) const {
if (size() != ht.size()) {
return false;
} else if (this == &ht) {
return true;
} else {
// Iterate through the elements in "this" and see if the
// corresponding element is in ht
for ( const_iterator it = begin(); it != end(); ++it ) {
const_iterator it2 = ht.find(get_key(*it));
if ((it2 == ht.end()) || (*it != *it2)) {
return false;
}
}
return true;
}
}
bool operator!=(const dense_hashtable& ht) const {
return !(*this == ht);
}
// I/O
// We support reading and writing hashtables to disk. Alas, since
// I don't know how to write a hasher or key_equal, you have to make
// sure everything but the table is the same. We compact before writing
//
// NOTE: These functions are currently TODO. They've not been implemented.
bool write_metadata(FILE *fp) {
squash_deleted(); // so we don't have to worry about delval
return false; // TODO
}
bool read_metadata(FILE *fp) {
num_deleted = 0; // since we got rid before writing
assert(use_empty); // have to set this before calling us
if (table) free(table); // we'll make our own
// TODO: read magic number
// TODO: read num_buckets
reset_thresholds();
table = (value_type *) malloc(num_buckets * sizeof(*table));
assert(table);
fill_range_with_empty(table, table + num_buckets);
// TODO: read num_elements
for ( size_type i = 0; i < num_elements; ++i ) {
// TODO: read bucket_num
// TODO: set with non-empty, non-deleted value
}
return false; // TODO
}
// If your keys and values are simple enough, we can write them to
// disk for you. "simple enough" means value_type is a POD type
// that contains no pointers. However, we don't try to normalize
// endianness
bool write_nopointer_data(FILE *fp) const {
for ( const_iterator it = begin(); it != end(); ++it ) {
// TODO: skip empty/deleted values
if ( !fwrite(&*it, sizeof(*it), 1, fp) ) return false;
}
return false;
}
// When reading, we have to override the potential const-ness of *it
bool read_nopointer_data(FILE *fp) {
for ( iterator it = begin(); it != end(); ++it ) {
// TODO: skip empty/deleted values
if ( !fread(reinterpret_cast<void*>(&(*it)), sizeof(*it), 1, fp) )
return false;
}
return false;
}
private:
// The actual data
hasher hash; // required by hashed_associative_container
key_equal equals;
ExtractKey get_key;
size_type num_deleted; // how many occupied buckets are marked deleted
bool use_deleted; // false until delval has been set
bool use_empty; // you must do this before you start
value_type delval; // which key marks deleted entries
value_type emptyval; // which key marks unused entries
float enlarge_resize_percent; // how full before resize
float shrink_resize_percent; // how empty before resize
size_type shrink_threshold; // num_buckets * shrink_resize_percent
size_type enlarge_threshold; // num_buckets * enlarge_resize_percent
value_type *table;
size_type num_buckets;
size_type num_elements;
bool consider_shrink; // true if we should try to shrink before next insert
void reset_thresholds() {
enlarge_threshold = static_cast<size_type>(num_buckets
* enlarge_resize_percent);
shrink_threshold = static_cast<size_type>(num_buckets
* shrink_resize_percent);
consider_shrink = false; // whatever caused us to reset already considered
}
};
// We need a global swap as well
template <class V, class K, class HF, class ExK, class EqK, class A>
inline void swap(dense_hashtable<V,K,HF,ExK,EqK,A> &x,
dense_hashtable<V,K,HF,ExK,EqK,A> &y) {
x.swap(y);
}
#undef JUMP_
template <class V, class K, class HF, class ExK, class EqK, class A>
const typename dense_hashtable<V,K,HF,ExK,EqK,A>::size_type
dense_hashtable<V,K,HF,ExK,EqK,A>::ILLEGAL_BUCKET;
// How full we let the table get before we resize. Knuth says .8 is
// good -- higher causes us to probe too much, though saves memory
template <class V, class K, class HF, class ExK, class EqK, class A>
const float dense_hashtable<V,K,HF,ExK,EqK,A>::HT_OCCUPANCY_FLT = 0.5f;
// How empty we let the table get before we resize lower.
// It should be less than OCCUPANCY_FLT / 2 or we thrash resizing
template <class V, class K, class HF, class ExK, class EqK, class A>
const float dense_hashtable<V,K,HF,ExK,EqK,A>::HT_EMPTY_FLT = 0.4f *
dense_hashtable<V,K,HF,ExK,EqK,A>::HT_OCCUPANCY_FLT;
_END_GOOGLE_NAMESPACE_
#endif /* _DENSEHASHTABLE_H_ */

View File

@@ -1,74 +0,0 @@
#ifndef SPARSEHASH_SPARSECONFIG_H__
#define SPARSEHASH_SPARSECONFIG_H__
// [AIR] : I couldn't make the google "windows" folder concept work.
// This does, and we only care of GCC and MSVC right now anyway.
#if defined( _MSC_VER )
#define GOOGLE_NAMESPACE google
#define HASH_NAMESPACE stdext
#define HASH_FUN_H <hash_map>
#define SPARSEHASH_HASH HASH_NAMESPACE::hash_compare
#undef HAVE_UINT16_T
#undef HAVE_U_INT16_T
#define HAVE___UINT16 1
#define HAVE_LONG_LONG 1
#define HAVE_SYS_TYPES_H 1
#undef HAVE_STDINT_H
#undef HAVE_INTTYPES_H
#define HAVE_MEMCPY 1
#define STL_NAMESPACE std
#define _END_GOOGLE_NAMESPACE_ }
#define _START_GOOGLE_NAMESPACE_ namespace GOOGLE_NAMESPACE {
#else //if defined( GNUC )
/* Namespace for Google classes */
#define GOOGLE_NAMESPACE google
/* the location of <hash_fun.h>/<stl_hash_fun.h> */
#define HASH_FUN_H <backward/hash_fun.h>
/* the namespace of hash_map/hash_set */
#define HASH_NAMESPACE __gnu_cxx
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if the system has the type `long long'. */
#define HAVE_LONG_LONG 1
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if the system has the type `uint16_t'. */
#define HAVE_UINT16_T 1
/* Define to 1 if the system has the type `u_int16_t'. */
#define HAVE_U_INT16_T 1
/* Define to 1 if the system has the type `__uint16'. */
/* #undef HAVE___UINT16 */
/* The system-provided hash function including the namespace. */
#define SPARSEHASH_HASH HASH_NAMESPACE::hash
/* the namespace where STL code like vector<> is defined */
#define STL_NAMESPACE std
/* Stops putting the code inside the Google namespace */
#define _END_GOOGLE_NAMESPACE_ }
/* Puts following code inside the Google namespace */
#define _START_GOOGLE_NAMESPACE_ namespace google {
#endif
#endif

View File

@@ -1,941 +0,0 @@
// Copyright (c) 2005, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ---
// Author: Craig Silverstein
//
// A sparse hashtable is a particular implementation of
// a hashtable: one that is meant to minimize memory use.
// It does this by using a *sparse table* (cf sparsetable.h),
// which uses between 1 and 2 bits to store empty buckets
// (we may need another bit for hashtables that support deletion).
//
// When empty buckets are so cheap, an appealing hashtable
// implementation is internal probing, in which the hashtable
// is a single table, and collisions are resolved by trying
// to insert again in another bucket. The most cache-efficient
// internal probing schemes are linear probing (which suffers,
// alas, from clumping) and quadratic probing, which is what
// we implement by default.
//
// Deleted buckets are a bit of a pain. We have to somehow mark
// deleted buckets (the probing must distinguish them from empty
// buckets). The most principled way is to have another bitmap,
// but that's annoying and takes up space. Instead we let the
// user specify an "impossible" key. We set deleted buckets
// to have the impossible key.
//
// Note it is possible to change the value of the delete key
// on the fly; you can even remove it, though after that point
// the hashtable is insert_only until you set it again.
//
// You probably shouldn't use this code directly. Use
// <google/sparse_hash_table> or <google/sparse_hash_set> instead.
//
// You can modify the following, below:
// HT_OCCUPANCY_FLT -- how full before we double size
// HT_EMPTY_FLT -- how empty before we halve size
// HT_MIN_BUCKETS -- smallest bucket size
// HT_DEFAULT_STARTING_BUCKETS -- default bucket size at construct-time
//
// You can also change enlarge_resize_percent (which defaults to
// HT_OCCUPANCY_FLT), and shrink_resize_percent (which defaults to
// HT_EMPTY_FLT) with set_resizing_parameters().
//
// How to decide what values to use?
// shrink_resize_percent's default of .4 * OCCUPANCY_FLT, is probably good.
// HT_MIN_BUCKETS is probably unnecessary since you can specify
// (indirectly) the starting number of buckets at construct-time.
// For enlarge_resize_percent, you can use this chart to try to trade-off
// expected lookup time to the space taken up. By default, this
// code uses quadratic probing, though you can change it to linear
// via _JUMP below if you really want to.
//
// From http://www.augustana.ca/~mohrj/courses/1999.fall/csc210/lecture_notes/hashing.html
// NUMBER OF PROBES / LOOKUP Successful Unsuccessful
// Quadratic collision resolution 1 - ln(1-L) - L/2 1/(1-L) - L - ln(1-L)
// Linear collision resolution [1+1/(1-L)]/2 [1+1/(1-L)2]/2
//
// -- enlarge_resize_percent -- 0.10 0.50 0.60 0.75 0.80 0.90 0.99
// QUADRATIC COLLISION RES.
// probes/successful lookup 1.05 1.44 1.62 2.01 2.21 2.85 5.11
// probes/unsuccessful lookup 1.11 2.19 2.82 4.64 5.81 11.4 103.6
// LINEAR COLLISION RES.
// probes/successful lookup 1.06 1.5 1.75 2.5 3.0 5.5 50.5
// probes/unsuccessful lookup 1.12 2.5 3.6 8.5 13.0 50.0 5000.0
//
// The value type is required to be copy constructible and default
// constructible, but it need not be (and commonly isn't) assignable.
#ifndef _SPARSEHASHTABLE_H_
#define _SPARSEHASHTABLE_H_
#ifndef SPARSEHASH_STAT_UPDATE
#define SPARSEHASH_STAT_UPDATE(x) ((void) 0)
#endif
// The probing method
// Linear probing
// #define JUMP_(key, num_probes) ( 1 )
// Quadratic-ish probing
#define JUMP_(key, num_probes) ( num_probes )
// Hashtable class, used to implement the hashed associative containers
// hash_set and hash_map.
#include <google/sparsehash/sparseconfig.h>
#include <assert.h>
#include <algorithm> // For swap(), eg
#include <iterator> // for facts about iterator tags
#include <utility> // for pair<>
#include <google/sparsetable> // Since that's basically what we are
_START_GOOGLE_NAMESPACE_
using STL_NAMESPACE::pair;
// Alloc is completely ignored. It is present as a template parameter only
// for the sake of being compatible with the old SGI hashtable interface.
// TODO(csilvers): is that the right thing to do?
template <class Value, class Key, class HashFcn,
class ExtractKey, class EqualKey, class Alloc>
class sparse_hashtable;
template <class V, class K, class HF, class ExK, class EqK, class A>
struct sparse_hashtable_iterator;
template <class V, class K, class HF, class ExK, class EqK, class A>
struct sparse_hashtable_const_iterator;
// As far as iterating, we're basically just a sparsetable
// that skips over deleted elements.
template <class V, class K, class HF, class ExK, class EqK, class A>
struct sparse_hashtable_iterator {
public:
typedef sparse_hashtable_iterator<V,K,HF,ExK,EqK,A> iterator;
typedef sparse_hashtable_const_iterator<V,K,HF,ExK,EqK,A> const_iterator;
typedef typename sparsetable<V>::nonempty_iterator st_iterator;
typedef STL_NAMESPACE::forward_iterator_tag iterator_category;
typedef V value_type;
typedef ptrdiff_t difference_type;
typedef size_t size_type;
typedef V& reference; // Value
typedef V* pointer;
// "Real" constructor and default constructor
sparse_hashtable_iterator(const sparse_hashtable<V,K,HF,ExK,EqK,A> *h,
st_iterator it, st_iterator it_end)
: ht(h), pos(it), end(it_end) { advance_past_deleted(); }
sparse_hashtable_iterator() { } // not ever used internally
// The default destructor is fine; we don't define one
// The default operator= is fine; we don't define one
// Happy dereferencer
reference operator*() const { return *pos; }
pointer operator->() const { return &(operator*()); }
// Arithmetic. The only hard part is making sure that
// we're not on a marked-deleted array element
void advance_past_deleted() {
while ( pos != end && ht->test_deleted(*this) )
++pos;
}
iterator& operator++() {
assert(pos != end); ++pos; advance_past_deleted(); return *this;
}
iterator operator++(int) { iterator tmp(*this); ++*this; return tmp; }
// Comparison.
bool operator==(const iterator& it) const { return pos == it.pos; }
bool operator!=(const iterator& it) const { return pos != it.pos; }
// The actual data
const sparse_hashtable<V,K,HF,ExK,EqK,A> *ht;
st_iterator pos, end;
};
// Now do it all again, but with const-ness!
template <class V, class K, class HF, class ExK, class EqK, class A>
struct sparse_hashtable_const_iterator {
public:
typedef sparse_hashtable_iterator<V,K,HF,ExK,EqK,A> iterator;
typedef sparse_hashtable_const_iterator<V,K,HF,ExK,EqK,A> const_iterator;
typedef typename sparsetable<V>::const_nonempty_iterator st_iterator;
typedef STL_NAMESPACE::forward_iterator_tag iterator_category;
typedef V value_type;
typedef ptrdiff_t difference_type;
typedef size_t size_type;
typedef const V& reference; // Value
typedef const V* pointer;
// "Real" constructor and default constructor
sparse_hashtable_const_iterator(const sparse_hashtable<V,K,HF,ExK,EqK,A> *h,
st_iterator it, st_iterator it_end)
: ht(h), pos(it), end(it_end) { advance_past_deleted(); }
// This lets us convert regular iterators to const iterators
sparse_hashtable_const_iterator() { } // never used internally
sparse_hashtable_const_iterator(const iterator &it)
: ht(it.ht), pos(it.pos), end(it.end) { }
// The default destructor is fine; we don't define one
// The default operator= is fine; we don't define one
// Happy dereferencer
reference operator*() const { return *pos; }
pointer operator->() const { return &(operator*()); }
// Arithmetic. The only hard part is making sure that
// we're not on a marked-deleted array element
void advance_past_deleted() {
while ( pos != end && ht->test_deleted(*this) )
++pos;
}
const_iterator& operator++() {
assert(pos != end); ++pos; advance_past_deleted(); return *this;
}
const_iterator operator++(int) { const_iterator tmp(*this); ++*this; return tmp; }
// Comparison.
bool operator==(const const_iterator& it) const { return pos == it.pos; }
bool operator!=(const const_iterator& it) const { return pos != it.pos; }
// The actual data
const sparse_hashtable<V,K,HF,ExK,EqK,A> *ht;
st_iterator pos, end;
};
// And once again, but this time freeing up memory as we iterate
template <class V, class K, class HF, class ExK, class EqK, class A>
struct sparse_hashtable_destructive_iterator {
public:
typedef sparse_hashtable_destructive_iterator<V,K,HF,ExK,EqK,A> iterator;
typedef typename sparsetable<V>::destructive_iterator st_iterator;
typedef STL_NAMESPACE::forward_iterator_tag iterator_category;
typedef V value_type;
typedef ptrdiff_t difference_type;
typedef size_t size_type;
typedef V& reference; // Value
typedef V* pointer;
// "Real" constructor and default constructor
sparse_hashtable_destructive_iterator(const
sparse_hashtable<V,K,HF,ExK,EqK,A> *h,
st_iterator it, st_iterator it_end)
: ht(h), pos(it), end(it_end) { advance_past_deleted(); }
sparse_hashtable_destructive_iterator() { } // never used internally
// The default destructor is fine; we don't define one
// The default operator= is fine; we don't define one
// Happy dereferencer
reference operator*() const { return *pos; }
pointer operator->() const { return &(operator*()); }
// Arithmetic. The only hard part is making sure that
// we're not on a marked-deleted array element
void advance_past_deleted() {
while ( pos != end && ht->test_deleted(*this) )
++pos;
}
iterator& operator++() {
assert(pos != end); ++pos; advance_past_deleted(); return *this;
}
iterator operator++(int) { iterator tmp(*this); ++*this; return tmp; }
// Comparison.
bool operator==(const iterator& it) const { return pos == it.pos; }
bool operator!=(const iterator& it) const { return pos != it.pos; }
// The actual data
const sparse_hashtable<V,K,HF,ExK,EqK,A> *ht;
st_iterator pos, end;
};
template <class Value, class Key, class HashFcn,
class ExtractKey, class EqualKey, class Alloc>
class sparse_hashtable {
public:
typedef Key key_type;
typedef Value value_type;
typedef HashFcn hasher;
typedef EqualKey key_equal;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef sparse_hashtable_iterator<Value, Key, HashFcn,
ExtractKey, EqualKey, Alloc>
iterator;
typedef sparse_hashtable_const_iterator<Value, Key, HashFcn,
ExtractKey, EqualKey, Alloc>
const_iterator;
typedef sparse_hashtable_destructive_iterator<Value, Key, HashFcn,
ExtractKey, EqualKey, Alloc>
destructive_iterator;
// How full we let the table get before we resize. Knuth says .8 is
// good -- higher causes us to probe too much, though saves memory
static const float HT_OCCUPANCY_FLT; // = 0.8f;
// How empty we let the table get before we resize lower.
// It should be less than OCCUPANCY_FLT / 2 or we thrash resizing
static const float HT_EMPTY_FLT; // = 0.4 * HT_OCCUPANCY_FLT;
// Minimum size we're willing to let hashtables be.
// Must be a power of two, and at least 4.
// Note, however, that for a given hashtable, the minimum size is
// determined by the first constructor arg, and may be >HT_MIN_BUCKETS.
static const size_t HT_MIN_BUCKETS = 4;
// By default, if you don't specify a hashtable size at
// construction-time, we use this size. Must be a power of two, and
// at least HT_MIN_BUCKETS.
static const size_t HT_DEFAULT_STARTING_BUCKETS = 32;
// ITERATOR FUNCTIONS
iterator begin() { return iterator(this, table.nonempty_begin(),
table.nonempty_end()); }
iterator end() { return iterator(this, table.nonempty_end(),
table.nonempty_end()); }
const_iterator begin() const { return const_iterator(this,
table.nonempty_begin(),
table.nonempty_end()); }
const_iterator end() const { return const_iterator(this,
table.nonempty_end(),
table.nonempty_end()); }
// This is used when resizing
destructive_iterator destructive_begin() {
return destructive_iterator(this, table.destructive_begin(),
table.destructive_end());
}
destructive_iterator destructive_end() {
return destructive_iterator(this, table.destructive_end(),
table.destructive_end());
}
// ACCESSOR FUNCTIONS for the things we templatize on, basically
hasher hash_funct() const { return hash; }
key_equal key_eq() const { return equals; }
// We need to copy values when we set the special marker for deleted
// elements, but, annoyingly, we can't just use the copy assignment
// operator because value_type might not be assignable (it's often
// pair<const X, Y>). We use explicit destructor invocation and
// placement new to get around this. Arg.
private:
void set_value(value_type* dst, const value_type src) {
dst->~value_type(); // delete the old value, if any
new(dst) value_type(src);
}
// This is used as a tag for the copy constructor, saying to destroy its
// arg We have two ways of destructively copying: with potentially growing
// the hashtable as we copy, and without. To make sure the outside world
// can't do a destructive copy, we make the typename private.
enum MoveDontCopyT {MoveDontCopy, MoveDontGrow};
// DELETE HELPER FUNCTIONS
// This lets the user describe a key that will indicate deleted
// table entries. This key should be an "impossible" entry --
// if you try to insert it for real, you won't be able to retrieve it!
// (NB: while you pass in an entire value, only the key part is looked
// at. This is just because I don't know how to assign just a key.)
private:
void squash_deleted() { // gets rid of any deleted entries we have
if ( num_deleted ) { // get rid of deleted before writing
sparse_hashtable tmp(MoveDontGrow, *this);
swap(tmp); // now we are tmp
}
assert(num_deleted == 0);
}
public:
void set_deleted_key(const value_type &val) {
// It's only safe to change what "deleted" means if we purge deleted guys
squash_deleted();
use_deleted = true;
set_value(&delval, val); // save the key (and rest of val too)
}
void clear_deleted_key() {
squash_deleted();
use_deleted = false;
}
// These are public so the iterators can use them
// True if the item at position bucknum is "deleted" marker
bool test_deleted(size_type bucknum) const {
// The num_deleted test is crucial for read(): after read(), the ht values
// are garbage, and we don't want to think some of them are deleted.
return (use_deleted && num_deleted > 0 && table.test(bucknum) &&
equals(get_key(delval), get_key(table.get(bucknum))));
}
bool test_deleted(const iterator &it) const {
return (use_deleted && num_deleted > 0 &&
equals(get_key(delval), get_key(*it)));
}
bool test_deleted(const const_iterator &it) const {
return (use_deleted && num_deleted > 0 &&
equals(get_key(delval), get_key(*it)));
}
bool test_deleted(const destructive_iterator &it) const {
return (use_deleted && num_deleted > 0 &&
equals(get_key(delval), get_key(*it)));
}
// Set it so test_deleted is true. true if object didn't used to be deleted
// See below (at erase()) to explain why we allow const_iterators
bool set_deleted(const_iterator &it) {
assert(use_deleted); // bad if set_deleted_key() wasn't called
bool retval = !test_deleted(it);
// &* converts from iterator to value-type
set_value(const_cast<value_type*>(&(*it)), delval);
return retval;
}
// Set it so test_deleted is false. true if object used to be deleted
bool clear_deleted(const_iterator &it) {
assert(use_deleted); // bad if set_deleted_key() wasn't called
// happens automatically when we assign something else in its place
return test_deleted(it);
}
// FUNCTIONS CONCERNING SIZE
size_type size() const { return table.num_nonempty() - num_deleted; }
// Buckets are always a power of 2
size_type max_size() const { return (size_type(-1) >> 1U) + 1; }
bool empty() const { return size() == 0; }
size_type bucket_count() const { return table.size(); }
size_type max_bucket_count() const { return max_size(); }
private:
// Because of the above, size_type(-1) is never legal; use it for errors
static const size_type ILLEGAL_BUCKET = size_type(-1);
private:
// This is the smallest size a hashtable can be without being too crowded
// If you like, you can give a min #buckets as well as a min #elts
size_type min_size(size_type num_elts, size_type min_buckets_wanted) {
size_type sz = HT_MIN_BUCKETS;
while ( sz < min_buckets_wanted || num_elts >= sz * enlarge_resize_percent )
sz *= 2;
return sz;
}
// Used after a string of deletes
void maybe_shrink() {
assert(table.num_nonempty() >= num_deleted);
assert((bucket_count() & (bucket_count()-1)) == 0); // is a power of two
assert(bucket_count() >= HT_MIN_BUCKETS);
// If you construct a hashtable with < HT_DEFAULT_STARTING_BUCKETS,
// we'll never shrink until you get relatively big, and we'll never
// shrink below HT_DEFAULT_STARTING_BUCKETS. Otherwise, something
// like "dense_hash_set<int> x; x.insert(4); x.erase(4);" will
// shrink us down to HT_MIN_BUCKETS buckets, which is too small.
if (shrink_threshold > 0
&& (table.num_nonempty()-num_deleted) < shrink_threshold &&
bucket_count() > HT_DEFAULT_STARTING_BUCKETS ) {
size_type sz = bucket_count() / 2; // find how much we should shrink
while ( sz > HT_DEFAULT_STARTING_BUCKETS &&
(table.num_nonempty() - num_deleted) <= sz *
shrink_resize_percent )
sz /= 2; // stay a power of 2
sparse_hashtable tmp(MoveDontCopy, *this, sz);
swap(tmp); // now we are tmp
}
consider_shrink = false; // because we just considered it
}
// We'll let you resize a hashtable -- though this makes us copy all!
// When you resize, you say, "make it big enough for this many more elements"
void resize_delta(size_type delta) {
if ( consider_shrink ) // see if lots of deletes happened
maybe_shrink();
if ( bucket_count() >= HT_MIN_BUCKETS &&
(table.num_nonempty() + delta) <= enlarge_threshold )
return; // we're ok as we are
// Sometimes, we need to resize just to get rid of all the
// "deleted" buckets that are clogging up the hashtable. So when
// deciding whether to resize, count the deleted buckets (which
// are currently taking up room). But later, when we decide what
// size to resize to, *don't* count deleted buckets, since they
// get discarded during the resize.
const size_type needed_size = min_size(table.num_nonempty() + delta, 0);
if ( needed_size > bucket_count() ) { // we don't have enough buckets
const size_type resize_to = min_size(table.num_nonempty() - num_deleted
+ delta, 0);
sparse_hashtable tmp(MoveDontCopy, *this, resize_to);
swap(tmp); // now we are tmp
}
}
// Used to actually do the rehashing when we grow/shrink a hashtable
void copy_from(const sparse_hashtable &ht, size_type min_buckets_wanted) {
clear(); // clear table, set num_deleted to 0
// If we need to change the size of our table, do it now
const size_type resize_to = min_size(ht.size(), min_buckets_wanted);
if ( resize_to > bucket_count() ) { // we don't have enough buckets
table.resize(resize_to); // sets the number of buckets
reset_thresholds();
}
// We use a normal iterator to get non-deleted bcks from ht
// We could use insert() here, but since we know there are
// no duplicates and no deleted items, we can be more efficient
assert( (bucket_count() & (bucket_count()-1)) == 0); // a power of two
for ( const_iterator it = ht.begin(); it != ht.end(); ++it ) {
size_type num_probes = 0; // how many times we've probed
size_type bucknum;
const size_type bucket_count_minus_one = bucket_count() - 1;
for (bucknum = hash(get_key(*it)) & bucket_count_minus_one;
table.test(bucknum); // not empty
bucknum = (bucknum + JUMP_(key, num_probes)) & bucket_count_minus_one) {
++num_probes;
assert(num_probes < bucket_count()); // or else the hashtable is full
}
table.set(bucknum, *it); // copies the value to here
}
}
// Implementation is like copy_from, but it destroys the table of the
// "from" guy by freeing sparsetable memory as we iterate. This is
// useful in resizing, since we're throwing away the "from" guy anyway.
void move_from(MoveDontCopyT mover, sparse_hashtable &ht,
size_type min_buckets_wanted) {
clear(); // clear table, set num_deleted to 0
// If we need to change the size of our table, do it now
size_t resize_to;
if ( mover == MoveDontGrow )
resize_to = ht.bucket_count(); // keep same size as old ht
else // MoveDontCopy
resize_to = min_size(ht.size(), min_buckets_wanted);
if ( resize_to > bucket_count() ) { // we don't have enough buckets
table.resize(resize_to); // sets the number of buckets
reset_thresholds();
}
// We use a normal iterator to get non-deleted bcks from ht
// We could use insert() here, but since we know there are
// no duplicates and no deleted items, we can be more efficient
assert( (bucket_count() & (bucket_count()-1)) == 0); // a power of two
// THIS IS THE MAJOR LINE THAT DIFFERS FROM COPY_FROM():
for ( destructive_iterator it = ht.destructive_begin();
it != ht.destructive_end(); ++it ) {
size_type num_probes = 0; // how many times we've probed
size_type bucknum;
for ( bucknum = hash(get_key(*it)) & (bucket_count()-1); // h % buck_cnt
table.test(bucknum); // not empty
bucknum = (bucknum + JUMP_(key, num_probes)) & (bucket_count()-1) ) {
++num_probes;
assert(num_probes < bucket_count()); // or else the hashtable is full
}
table.set(bucknum, *it); // copies the value to here
}
}
// Required by the spec for hashed associative container
public:
// Though the docs say this should be num_buckets, I think it's much
// more useful as num_elements. As a special feature, calling with
// req_elements==0 will cause us to shrink if we can, saving space.
void resize(size_type req_elements) { // resize to this or larger
if ( consider_shrink || req_elements == 0 )
maybe_shrink();
if ( req_elements > table.num_nonempty() ) // we only grow
resize_delta(req_elements - table.num_nonempty());
}
// Change the value of shrink_resize_percent and
// enlarge_resize_percent. The description at the beginning of this
// file explains how to choose the values. Setting the shrink
// parameter to 0.0 ensures that the table never shrinks.
void set_resizing_parameters(float shrink, float grow) {
assert(shrink >= 0.0);
assert(grow <= 1.0);
assert(shrink <= grow/2.0);
shrink_resize_percent = shrink;
enlarge_resize_percent = grow;
reset_thresholds();
}
// CONSTRUCTORS -- as required by the specs, we take a size,
// but also let you specify a hashfunction, key comparator,
// and key extractor. We also define a copy constructor and =.
// DESTRUCTOR -- the default is fine, surprisingly.
explicit sparse_hashtable(size_type expected_max_items_in_table = 0,
const HashFcn& hf = HashFcn(),
const EqualKey& eql = EqualKey(),
const ExtractKey& ext = ExtractKey())
: hash(hf), equals(eql), get_key(ext), num_deleted(0), use_deleted(false),
delval(), enlarge_resize_percent(HT_OCCUPANCY_FLT),
shrink_resize_percent(HT_EMPTY_FLT),
table(expected_max_items_in_table == 0
? HT_DEFAULT_STARTING_BUCKETS
: min_size(expected_max_items_in_table, 0)) {
reset_thresholds();
}
// As a convenience for resize(), we allow an optional second argument
// which lets you make this new hashtable a different size than ht.
// We also provide a mechanism of saying you want to "move" the ht argument
// into us instead of copying.
sparse_hashtable(const sparse_hashtable& ht,
size_type min_buckets_wanted = HT_DEFAULT_STARTING_BUCKETS)
: hash(ht.hash), equals(ht.equals), get_key(ht.get_key),
num_deleted(0), use_deleted(ht.use_deleted), delval(ht.delval),
enlarge_resize_percent(ht.enlarge_resize_percent),
shrink_resize_percent(ht.shrink_resize_percent),
table() {
reset_thresholds();
copy_from(ht, min_buckets_wanted); // copy_from() ignores deleted entries
}
sparse_hashtable(MoveDontCopyT mover, sparse_hashtable& ht,
size_type min_buckets_wanted = HT_DEFAULT_STARTING_BUCKETS)
: hash(ht.hash), equals(ht.equals), get_key(ht.get_key),
num_deleted(0), use_deleted(ht.use_deleted), delval(ht.delval),
enlarge_resize_percent(ht.enlarge_resize_percent),
shrink_resize_percent(ht.shrink_resize_percent),
table() {
reset_thresholds();
move_from(mover, ht, min_buckets_wanted); // ignores deleted entries
}
sparse_hashtable& operator= (const sparse_hashtable& ht) {
if (&ht == this) return *this; // don't copy onto ourselves
clear();
hash = ht.hash;
equals = ht.equals;
get_key = ht.get_key;
use_deleted = ht.use_deleted;
set_value(&delval, ht.delval);
copy_from(ht, HT_MIN_BUCKETS); // sets num_deleted to 0 too
return *this;
}
// Many STL algorithms use swap instead of copy constructors
void swap(sparse_hashtable& ht) {
STL_NAMESPACE::swap(hash, ht.hash);
STL_NAMESPACE::swap(equals, ht.equals);
STL_NAMESPACE::swap(get_key, ht.get_key);
STL_NAMESPACE::swap(num_deleted, ht.num_deleted);
STL_NAMESPACE::swap(use_deleted, ht.use_deleted);
STL_NAMESPACE::swap(enlarge_resize_percent, ht.enlarge_resize_percent);
STL_NAMESPACE::swap(shrink_resize_percent, ht.shrink_resize_percent);
{ value_type tmp; // for annoying reasons, swap() doesn't work
set_value(&tmp, delval);
set_value(&delval, ht.delval);
set_value(&ht.delval, tmp);
}
table.swap(ht.table);
reset_thresholds();
ht.reset_thresholds();
}
// It's always nice to be able to clear a table without deallocating it
void clear() {
table.clear();
reset_thresholds();
num_deleted = 0;
}
// LOOKUP ROUTINES
private:
// Returns a pair of positions: 1st where the object is, 2nd where
// it would go if you wanted to insert it. 1st is ILLEGAL_BUCKET
// if object is not found; 2nd is ILLEGAL_BUCKET if it is.
// Note: because of deletions where-to-insert is not trivial: it's the
// first deleted bucket we see, as long as we don't find the key later
pair<size_type, size_type> find_position(const key_type &key) const {
size_type num_probes = 0; // how many times we've probed
const size_type bucket_count_minus_one = bucket_count() - 1;
size_type bucknum = hash(key) & bucket_count_minus_one;
size_type insert_pos = ILLEGAL_BUCKET; // where we would insert
SPARSEHASH_STAT_UPDATE(total_lookups += 1);
while ( 1 ) { // probe until something happens
if ( !table.test(bucknum) ) { // bucket is empty
SPARSEHASH_STAT_UPDATE(total_probes += num_probes);
if ( insert_pos == ILLEGAL_BUCKET ) // found no prior place to insert
return pair<size_type,size_type>(ILLEGAL_BUCKET, bucknum);
else
return pair<size_type,size_type>(ILLEGAL_BUCKET, insert_pos);
} else if ( test_deleted(bucknum) ) {// keep searching, but mark to insert
if ( insert_pos == ILLEGAL_BUCKET )
insert_pos = bucknum;
} else if ( equals(key, get_key(table.get(bucknum))) ) {
SPARSEHASH_STAT_UPDATE(total_probes += num_probes);
return pair<size_type,size_type>(bucknum, ILLEGAL_BUCKET);
}
++num_probes; // we're doing another probe
bucknum = (bucknum + JUMP_(key, num_probes)) & bucket_count_minus_one;
assert(num_probes < bucket_count()); // don't probe too many times!
}
}
public:
iterator find(const key_type& key) {
if ( size() == 0 ) return end();
pair<size_type, size_type> pos = find_position(key);
if ( pos.first == ILLEGAL_BUCKET ) // alas, not there
return end();
else
return iterator(this, table.get_iter(pos.first), table.nonempty_end());
}
const_iterator find(const key_type& key) const {
if ( size() == 0 ) return end();
pair<size_type, size_type> pos = find_position(key);
if ( pos.first == ILLEGAL_BUCKET ) // alas, not there
return end();
else
return const_iterator(this,
table.get_iter(pos.first), table.nonempty_end());
}
// Counts how many elements have key key. For maps, it's either 0 or 1.
size_type count(const key_type &key) const {
pair<size_type, size_type> pos = find_position(key);
return pos.first == ILLEGAL_BUCKET ? 0 : 1;
}
// Likewise, equal_range doesn't really make sense for us. Oh well.
pair<iterator,iterator> equal_range(const key_type& key) {
const iterator pos = find(key); // either an iterator or end
return pair<iterator,iterator>(pos, pos);
}
pair<const_iterator,const_iterator> equal_range(const key_type& key) const {
const const_iterator pos = find(key); // either an iterator or end
return pair<iterator,iterator>(pos, pos);
}
// INSERTION ROUTINES
private:
// If you know *this is big enough to hold obj, use this routine
pair<iterator, bool> insert_noresize(const value_type& obj) {
// First, double-check we're not inserting delval
assert(!use_deleted || !equals(get_key(obj), get_key(delval)));
const pair<size_type,size_type> pos = find_position(get_key(obj));
if ( pos.first != ILLEGAL_BUCKET) { // object was already there
return pair<iterator,bool>(iterator(this, table.get_iter(pos.first),
table.nonempty_end()),
false); // false: we didn't insert
} else { // pos.second says where to put it
if ( test_deleted(pos.second) ) { // just replace if it's been del.
// The set() below will undelete this object. We just worry about stats
assert(num_deleted > 0);
--num_deleted; // used to be, now it isn't
}
table.set(pos.second, obj);
return pair<iterator,bool>(iterator(this, table.get_iter(pos.second),
table.nonempty_end()),
true); // true: we did insert
}
}
public:
// This is the normal insert routine, used by the outside world
pair<iterator, bool> insert(const value_type& obj) {
resize_delta(1); // adding an object, grow if need be
return insert_noresize(obj);
}
// When inserting a lot at a time, we specialize on the type of iterator
template <class InputIterator>
void insert(InputIterator f, InputIterator l) {
// specializes on iterator type
insert(f, l, typename STL_NAMESPACE::iterator_traits<InputIterator>::iterator_category());
}
// Iterator supports operator-, resize before inserting
template <class ForwardIterator>
void insert(ForwardIterator f, ForwardIterator l,
STL_NAMESPACE::forward_iterator_tag) {
size_type n = STL_NAMESPACE::distance(f, l); // TODO(csilvers): standard?
resize_delta(n);
for ( ; n > 0; --n, ++f)
insert_noresize(*f);
}
// Arbitrary iterator, can't tell how much to resize
template <class InputIterator>
void insert(InputIterator f, InputIterator l,
STL_NAMESPACE::input_iterator_tag) {
for ( ; f != l; ++f)
insert(*f);
}
// DELETION ROUTINES
size_type erase(const key_type& key) {
// First, double-check we're not erasing delval
assert(!use_deleted || !equals(key, get_key(delval)));
const_iterator pos = find(key); // shrug: shouldn't need to be const
if ( pos != end() ) {
assert(!test_deleted(pos)); // or find() shouldn't have returned it
set_deleted(pos);
++num_deleted;
consider_shrink = true; // will think about shrink after next insert
return 1; // because we deleted one thing
} else {
return 0; // because we deleted nothing
}
}
// This is really evil: really it should be iterator, not const_iterator.
// But...the only reason keys are const is to allow lookup.
// Since that's a moot issue for deleted keys, we allow const_iterators
void erase(const_iterator pos) {
if ( pos == end() ) return; // sanity check
if ( set_deleted(pos) ) { // true if object has been newly deleted
++num_deleted;
consider_shrink = true; // will think about shrink after next insert
}
}
void erase(const_iterator f, const_iterator l) {
for ( ; f != l; ++f) {
if ( set_deleted(f) ) // should always be true
++num_deleted;
}
consider_shrink = true; // will think about shrink after next insert
}
// COMPARISON
bool operator==(const sparse_hashtable& ht) const {
// We really want to check that the hash functions are the same
// but alas there's no way to do this. We just hope.
return ( num_deleted == ht.num_deleted && table == ht.table );
}
bool operator!=(const sparse_hashtable& ht) const {
return !(*this == ht);
}
// I/O
// We support reading and writing hashtables to disk. NOTE that
// this only stores the hashtable metadata, not the stuff you've
// actually put in the hashtable! Alas, since I don't know how to
// write a hasher or key_equal, you have to make sure everything
// but the table is the same. We compact before writing.
bool write_metadata(FILE *fp) {
squash_deleted(); // so we don't have to worry about delkey
return table.write_metadata(fp);
}
bool read_metadata(FILE *fp) {
num_deleted = 0; // since we got rid before writing
bool result = table.read_metadata(fp);
reset_thresholds();
return result;
}
// Only meaningful if value_type is a POD.
bool write_nopointer_data(FILE *fp) {
return table.write_nopointer_data(fp);
}
// Only meaningful if value_type is a POD.
bool read_nopointer_data(FILE *fp) {
return table.read_nopointer_data(fp);
}
private:
// The actual data
hasher hash; // required by hashed_associative_container
key_equal equals;
ExtractKey get_key;
size_type num_deleted; // how many occupied buckets are marked deleted
bool use_deleted; // false until delval has been set
value_type delval; // which key marks deleted entries
float enlarge_resize_percent; // how full before resize
float shrink_resize_percent; // how empty before resize
size_type shrink_threshold; // table.size() * shrink_resize_percent
size_type enlarge_threshold; // table.size() * enlarge_resize_percent
sparsetable<value_type> table; // holds num_buckets and num_elements too
bool consider_shrink; // true if we should try to shrink before next insert
void reset_thresholds() {
enlarge_threshold = static_cast<size_type>(table.size()
* enlarge_resize_percent);
shrink_threshold = static_cast<size_type>(table.size()
* shrink_resize_percent);
consider_shrink = false; // whatever caused us to reset already considered
}
};
// We need a global swap as well
template <class V, class K, class HF, class ExK, class EqK, class A>
inline void swap(sparse_hashtable<V,K,HF,ExK,EqK,A> &x,
sparse_hashtable<V,K,HF,ExK,EqK,A> &y) {
x.swap(y);
}
#undef JUMP_
template <class V, class K, class HF, class ExK, class EqK, class A>
const typename sparse_hashtable<V,K,HF,ExK,EqK,A>::size_type
sparse_hashtable<V,K,HF,ExK,EqK,A>::ILLEGAL_BUCKET;
// How full we let the table get before we resize. Knuth says .8 is
// good -- higher causes us to probe too much, though saves memory
template <class V, class K, class HF, class ExK, class EqK, class A>
const float sparse_hashtable<V,K,HF,ExK,EqK,A>::HT_OCCUPANCY_FLT = 0.8f;
// How empty we let the table get before we resize lower.
// It should be less than OCCUPANCY_FLT / 2 or we thrash resizing
template <class V, class K, class HF, class ExK, class EqK, class A>
const float sparse_hashtable<V,K,HF,ExK,EqK,A>::HT_EMPTY_FLT = 0.4f *
sparse_hashtable<V,K,HF,ExK,EqK,A>::HT_OCCUPANCY_FLT;
_END_GOOGLE_NAMESPACE_
#endif /* _SPARSEHASHTABLE_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,250 +0,0 @@
// Copyright (c) 2006, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ----
// Author: Matt Austern
//
// Define a small subset of tr1 type traits. The traits we define are:
// is_integral
// is_floating_point
// is_pointer
// is_reference
// is_pod
// has_trivial_constructor
// has_trivial_copy
// has_trivial_assign
// has_trivial_destructor
// remove_const
// remove_volatile
// remove_cv
// remove_reference
// remove_pointer
// is_convertible
// We can add more type traits as required.
#ifndef BASE_TYPE_TRAITS_H_
#define BASE_TYPE_TRAITS_H_
#include <google/sparsehash/sparseconfig.h>
#include <utility> // For pair
_START_GOOGLE_NAMESPACE_
// integral_constant, defined in tr1, is a wrapper for an integer
// value. We don't really need this generality; we could get away
// with hardcoding the integer type to bool. We use the fully
// general integer_constant for compatibility with tr1.
template<class T, T v>
struct integral_constant {
static const T value = v;
typedef T value_type;
typedef integral_constant<T, v> type;
};
template <class T, T v> const T integral_constant<T, v>::value;
// Abbreviations: true_type and false_type are structs that represent
// boolean true and false values.
typedef integral_constant<bool, true> true_type;
typedef integral_constant<bool, false> false_type;
// Types small_ and big_ are guaranteed such that sizeof(small_) <
// sizeof(big_)
typedef char small_;
struct big_ {
char dummy[2];
};
// is_integral is false except for the built-in integer types.
template <class T> struct is_integral : false_type { };
template<> struct is_integral<bool> : true_type { };
template<> struct is_integral<char> : true_type { };
template<> struct is_integral<unsigned char> : true_type { };
template<> struct is_integral<signed char> : true_type { };
#if defined(_MSC_VER)
// wchar_t is not by default a distinct type from unsigned short in
// Microsoft C.
// See http://msdn2.microsoft.com/en-us/library/dh8che7s(VS.80).aspx
template<> struct is_integral<__wchar_t> : true_type { };
#else
template<> struct is_integral<wchar_t> : true_type { };
#endif
template<> struct is_integral<short> : true_type { };
template<> struct is_integral<unsigned short> : true_type { };
template<> struct is_integral<int> : true_type { };
template<> struct is_integral<unsigned int> : true_type { };
template<> struct is_integral<long> : true_type { };
template<> struct is_integral<unsigned long> : true_type { };
#ifdef HAVE_LONG_LONG
template<> struct is_integral<long long> : true_type { };
template<> struct is_integral<unsigned long long> : true_type { };
#endif
// is_floating_point is false except for the built-in floating-point types.
template <class T> struct is_floating_point : false_type { };
template<> struct is_floating_point<float> : true_type { };
template<> struct is_floating_point<double> : true_type { };
template<> struct is_floating_point<long double> : true_type { };
// is_pointer is false except for pointer types.
template <class T> struct is_pointer : false_type { };
template <class T> struct is_pointer<T*> : true_type { };
// is_reference is false except for reference types.
template<typename T> struct is_reference : false_type {};
template<typename T> struct is_reference<T&> : true_type {};
// We can't get is_pod right without compiler help, so fail conservatively.
// We will assume it's false except for arithmetic types and pointers,
// and const versions thereof. Note that std::pair is not a POD.
template <class T> struct is_pod
: integral_constant<bool, (is_integral<T>::value ||
is_floating_point<T>::value ||
is_pointer<T>::value)> { };
template <class T> struct is_pod<const T> : is_pod<T> { };
// We can't get has_trivial_constructor right without compiler help, so
// fail conservatively. We will assume it's false except for: (1) types
// for which is_pod is true. (2) std::pair of types with trivial
// constructors. (3) array of a type with a trivial constructor.
// (4) const versions thereof.
template <class T> struct has_trivial_constructor : is_pod<T> { };
template <class T, class U> struct has_trivial_constructor<std::pair<T, U> >
: integral_constant<bool,
(has_trivial_constructor<T>::value &&
has_trivial_constructor<U>::value)> { };
template <class A, int N> struct has_trivial_constructor<A[N]>
: has_trivial_constructor<A> { };
template <class T> struct has_trivial_constructor<const T>
: has_trivial_constructor<T> { };
// We can't get has_trivial_copy right without compiler help, so fail
// conservatively. We will assume it's false except for: (1) types
// for which is_pod is true. (2) std::pair of types with trivial copy
// constructors. (3) array of a type with a trivial copy constructor.
// (4) const versions thereof.
template <class T> struct has_trivial_copy : is_pod<T> { };
template <class T, class U> struct has_trivial_copy<std::pair<T, U> >
: integral_constant<bool,
(has_trivial_copy<T>::value &&
has_trivial_copy<U>::value)> { };
template <class A, int N> struct has_trivial_copy<A[N]>
: has_trivial_copy<A> { };
template <class T> struct has_trivial_copy<const T> : has_trivial_copy<T> { };
// We can't get has_trivial_assign right without compiler help, so fail
// conservatively. We will assume it's false except for: (1) types
// for which is_pod is true. (2) std::pair of types with trivial copy
// constructors. (3) array of a type with a trivial assign constructor.
template <class T> struct has_trivial_assign : is_pod<T> { };
template <class T, class U> struct has_trivial_assign<std::pair<T, U> >
: integral_constant<bool,
(has_trivial_assign<T>::value &&
has_trivial_assign<U>::value)> { };
template <class A, int N> struct has_trivial_assign<A[N]>
: has_trivial_assign<A> { };
// We can't get has_trivial_destructor right without compiler help, so
// fail conservatively. We will assume it's false except for: (1) types
// for which is_pod is true. (2) std::pair of types with trivial
// destructors. (3) array of a type with a trivial destructor.
// (4) const versions thereof.
template <class T> struct has_trivial_destructor : is_pod<T> { };
template <class T, class U> struct has_trivial_destructor<std::pair<T, U> >
: integral_constant<bool,
(has_trivial_destructor<T>::value &&
has_trivial_destructor<U>::value)> { };
template <class A, int N> struct has_trivial_destructor<A[N]>
: has_trivial_destructor<A> { };
template <class T> struct has_trivial_destructor<const T>
: has_trivial_destructor<T> { };
// Specified by TR1 [4.7.1]
template<typename T> struct remove_const { typedef T type; };
template<typename T> struct remove_const<T const> { typedef T type; };
template<typename T> struct remove_volatile { typedef T type; };
template<typename T> struct remove_volatile<T volatile> { typedef T type; };
template<typename T> struct remove_cv {
typedef typename remove_const<typename remove_volatile<T>::type>::type type;
};
// Specified by TR1 [4.7.2]
template<typename T> struct remove_reference { typedef T type; };
template<typename T> struct remove_reference<T&> { typedef T type; };
// Specified by TR1 [4.7.4] Pointer modifications.
template<typename T> struct remove_pointer { typedef T type; };
template<typename T> struct remove_pointer<T*> { typedef T type; };
template<typename T> struct remove_pointer<T* const> { typedef T type; };
template<typename T> struct remove_pointer<T* volatile> { typedef T type; };
template<typename T> struct remove_pointer<T* const volatile> {
typedef T type; };
// Specified by TR1 [4.6] Relationships between types
#ifndef _MSC_VER
namespace internal {
// This class is an implementation detail for is_convertible, and you
// don't need to know how it works to use is_convertible. For those
// who care: we declare two different functions, one whose argument is
// of type To and one with a variadic argument list. We give them
// return types of different size, so we can use sizeof to trick the
// compiler into telling us which function it would have chosen if we
// had called it with an argument of type From. See Alexandrescu's
// _Modern C++ Design_ for more details on this sort of trick.
template <typename From, typename To>
struct ConvertHelper {
static small_ Test(To);
static big_ Test(...);
static From Create();
};
} // namespace internal
// Inherits from true_type if From is convertible to To, false_type otherwise.
template <typename From, typename To>
struct is_convertible
: integral_constant<bool,
sizeof(internal::ConvertHelper<From, To>::Test(
internal::ConvertHelper<From, To>::Create()))
== sizeof(small_)> {
};
#endif
_END_GOOGLE_NAMESPACE_
#endif // BASE_TYPE_TRAITS_H_

View File

@@ -1,442 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="libjpeg7"
ProjectGUID="{BC236261-77E8-4567-8D09-45CD02965EB6}"
RootNamespace="libjpeg"
Keyword="Win32Proj"
TargetFrameworkVersion="0"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
<DefaultToolFile
FileName="masm.rules"
/>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
ConfigurationType="4"
InheritedPropertySheets="..\DefaultProjectRootDir.vsprops;..\3rdparty.vsprops;..\..\common\vsprops\CodeGen_Debug.vsprops;..\..\common\vsprops\IncrementalLinking.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="MASM"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="4"
InheritedPropertySheets="..\DefaultProjectRootDir.vsprops;..\3rdparty.vsprops;..\..\common\vsprops\CodeGen_Release.vsprops"
CharacterSet="1"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="MASM"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
WholeProgramOptimization="false"
UsePrecompiledHeader="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Devel|Win32"
ConfigurationType="4"
InheritedPropertySheets="..\DefaultProjectRootDir.vsprops;..\3rdparty.vsprops;..\..\common\vsprops\CodeGen_Devel.vsprops;..\..\common\vsprops\IncrementalLinking.vsprops"
CharacterSet="1"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="MASM"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\jaricom.c"
>
</File>
<File
RelativePath=".\jcapimin.c"
>
</File>
<File
RelativePath=".\jcapistd.c"
>
</File>
<File
RelativePath=".\jcarith.c"
>
</File>
<File
RelativePath=".\jccoefct.c"
>
</File>
<File
RelativePath=".\jccolor.c"
>
</File>
<File
RelativePath=".\jcdctmgr.c"
>
</File>
<File
RelativePath=".\jchuff.c"
>
</File>
<File
RelativePath=".\jcinit.c"
>
</File>
<File
RelativePath=".\jcmainct.c"
>
</File>
<File
RelativePath=".\jcmarker.c"
>
</File>
<File
RelativePath=".\jcmaster.c"
>
</File>
<File
RelativePath=".\jcomapi.c"
>
</File>
<File
RelativePath=".\jconfig.h"
>
</File>
<File
RelativePath=".\jcparam.c"
>
</File>
<File
RelativePath=".\jcprepct.c"
>
</File>
<File
RelativePath=".\jcsample.c"
>
</File>
<File
RelativePath=".\jctrans.c"
>
</File>
<File
RelativePath=".\jdapimin.c"
>
</File>
<File
RelativePath=".\jdapistd.c"
>
</File>
<File
RelativePath=".\jdarith.c"
>
</File>
<File
RelativePath=".\jdatadst.c"
>
</File>
<File
RelativePath=".\jdatasrc.c"
>
</File>
<File
RelativePath=".\jdcoefct.c"
>
</File>
<File
RelativePath=".\jdcolor.c"
>
</File>
<File
RelativePath=".\jdct.h"
>
</File>
<File
RelativePath=".\jddctmgr.c"
>
</File>
<File
RelativePath=".\jdhuff.c"
>
</File>
<File
RelativePath=".\jdinput.c"
>
</File>
<File
RelativePath=".\jdmainct.c"
>
</File>
<File
RelativePath=".\jdmarker.c"
>
</File>
<File
RelativePath=".\jdmaster.c"
>
</File>
<File
RelativePath=".\jdmerge.c"
>
</File>
<File
RelativePath=".\jdpostct.c"
>
</File>
<File
RelativePath=".\jdsample.c"
>
</File>
<File
RelativePath=".\jdtrans.c"
>
</File>
<File
RelativePath=".\jerror.c"
>
</File>
<File
RelativePath=".\jerror.h"
>
</File>
<File
RelativePath=".\jfdctflt.c"
>
</File>
<File
RelativePath=".\jfdctfst.c"
>
</File>
<File
RelativePath=".\jfdctint.c"
>
</File>
<File
RelativePath=".\jidctflt.c"
>
</File>
<File
RelativePath=".\jidctfst.c"
>
</File>
<File
RelativePath=".\jidctint.c"
>
</File>
<File
RelativePath=".\jinclude.h"
>
</File>
<File
RelativePath=".\jmemansi.c"
>
</File>
<File
RelativePath=".\jmemmgr.c"
>
</File>
<File
RelativePath=".\jmemsys.h"
>
</File>
<File
RelativePath=".\jmorecfg.h"
>
</File>
<File
RelativePath=".\jpegint.h"
>
</File>
<File
RelativePath=".\jpeglib.h"
>
</File>
<File
RelativePath=".\jquant1.c"
>
</File>
<File
RelativePath=".\jquant2.c"
>
</File>
<File
RelativePath=".\jutils.c"
>
</File>
<File
RelativePath=".\jversion.h"
>
</File>
</Filter>
<File
RelativePath=".\change.log"
>
</File>
<File
RelativePath=".\filelist.txt"
>
</File>
<File
RelativePath=".\README"
>
</File>
<File
RelativePath=".\readme.pcsx2.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -1,163 +1,166 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Devel|Win32">
<Configuration>Devel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>libjpeg7</ProjectName>
<ProjectGuid>{BC236261-77E8-4567-8D09-45CD02965EB6}</ProjectGuid>
<RootNamespace>libjpeg</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="jaricom.c" />
<ClCompile Include="jcapimin.c" />
<ClCompile Include="jcapistd.c" />
<ClCompile Include="jcarith.c" />
<ClCompile Include="jccoefct.c" />
<ClCompile Include="jccolor.c" />
<ClCompile Include="jcdctmgr.c" />
<ClCompile Include="jchuff.c" />
<ClCompile Include="jcinit.c" />
<ClCompile Include="jcmainct.c" />
<ClCompile Include="jcmarker.c" />
<ClCompile Include="jcmaster.c" />
<ClCompile Include="jcomapi.c" />
<ClCompile Include="jcparam.c" />
<ClCompile Include="jcprepct.c" />
<ClCompile Include="jcsample.c" />
<ClCompile Include="jctrans.c" />
<ClCompile Include="jdapimin.c" />
<ClCompile Include="jdapistd.c" />
<ClCompile Include="jdarith.c" />
<ClCompile Include="jdatadst.c" />
<ClCompile Include="jdatasrc.c" />
<ClCompile Include="jdcoefct.c" />
<ClCompile Include="jdcolor.c" />
<ClCompile Include="jddctmgr.c" />
<ClCompile Include="jdhuff.c" />
<ClCompile Include="jdinput.c" />
<ClCompile Include="jdmainct.c" />
<ClCompile Include="jdmarker.c" />
<ClCompile Include="jdmaster.c" />
<ClCompile Include="jdmerge.c" />
<ClCompile Include="jdpostct.c" />
<ClCompile Include="jdsample.c" />
<ClCompile Include="jdtrans.c" />
<ClCompile Include="jerror.c" />
<ClCompile Include="jfdctflt.c" />
<ClCompile Include="jfdctfst.c" />
<ClCompile Include="jfdctint.c" />
<ClCompile Include="jidctflt.c" />
<ClCompile Include="jidctfst.c" />
<ClCompile Include="jidctint.c" />
<ClCompile Include="jmemansi.c" />
<ClCompile Include="jmemmgr.c" />
<ClCompile Include="jquant1.c" />
<ClCompile Include="jquant2.c" />
<ClCompile Include="jutils.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h" />
<ClInclude Include="jdct.h" />
<ClInclude Include="jerror.h" />
<ClInclude Include="jinclude.h" />
<ClInclude Include="jmemsys.h" />
<ClInclude Include="jmorecfg.h" />
<ClInclude Include="jpegint.h" />
<ClInclude Include="jpeglib.h" />
<ClInclude Include="jversion.h" />
</ItemGroup>
<ItemGroup>
<None Include="change.log" />
<None Include="filelist.txt" />
<None Include="README" />
<None Include="readme.pcsx2.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Devel|Win32">
<Configuration>Devel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>libjpeg7</ProjectName>
<ProjectGuid>{BC236261-77E8-4567-8D09-45CD02965EB6}</ProjectGuid>
<RootNamespace>libjpeg</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>$(DefaultPlatformToolset)_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="jaricom.c" />
<ClCompile Include="jcapimin.c" />
<ClCompile Include="jcapistd.c" />
<ClCompile Include="jcarith.c" />
<ClCompile Include="jccoefct.c" />
<ClCompile Include="jccolor.c" />
<ClCompile Include="jcdctmgr.c" />
<ClCompile Include="jchuff.c" />
<ClCompile Include="jcinit.c" />
<ClCompile Include="jcmainct.c" />
<ClCompile Include="jcmarker.c" />
<ClCompile Include="jcmaster.c" />
<ClCompile Include="jcomapi.c" />
<ClCompile Include="jcparam.c" />
<ClCompile Include="jcprepct.c" />
<ClCompile Include="jcsample.c" />
<ClCompile Include="jctrans.c" />
<ClCompile Include="jdapimin.c" />
<ClCompile Include="jdapistd.c" />
<ClCompile Include="jdarith.c" />
<ClCompile Include="jdatadst.c" />
<ClCompile Include="jdatasrc.c" />
<ClCompile Include="jdcoefct.c" />
<ClCompile Include="jdcolor.c" />
<ClCompile Include="jddctmgr.c" />
<ClCompile Include="jdhuff.c" />
<ClCompile Include="jdinput.c" />
<ClCompile Include="jdmainct.c" />
<ClCompile Include="jdmarker.c" />
<ClCompile Include="jdmaster.c" />
<ClCompile Include="jdmerge.c" />
<ClCompile Include="jdpostct.c" />
<ClCompile Include="jdsample.c" />
<ClCompile Include="jdtrans.c" />
<ClCompile Include="jerror.c" />
<ClCompile Include="jfdctflt.c" />
<ClCompile Include="jfdctfst.c" />
<ClCompile Include="jfdctint.c" />
<ClCompile Include="jidctflt.c" />
<ClCompile Include="jidctfst.c" />
<ClCompile Include="jidctint.c" />
<ClCompile Include="jmemansi.c" />
<ClCompile Include="jmemmgr.c" />
<ClCompile Include="jquant1.c" />
<ClCompile Include="jquant2.c" />
<ClCompile Include="jutils.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h" />
<ClInclude Include="jdct.h" />
<ClInclude Include="jerror.h" />
<ClInclude Include="jinclude.h" />
<ClInclude Include="jmemsys.h" />
<ClInclude Include="jmorecfg.h" />
<ClInclude Include="jpegint.h" />
<ClInclude Include="jpeglib.h" />
<ClInclude Include="jversion.h" />
</ItemGroup>
<ItemGroup>
<None Include="change.log" />
<None Include="filelist.txt" />
<None Include="README" />
<None Include="readme.pcsx2.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
</Project>

View File

@@ -1,184 +1,184 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="jaricom.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcdctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jchuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcinit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcomapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcparam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcprepct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jctrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatadst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatasrc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jddctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdhuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdinput.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmerge.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdpostct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdtrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jerror.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemansi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jutils.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jdct.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jmemsys.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jpegint.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="change.log" />
<None Include="filelist.txt" />
<None Include="README" />
<None Include="readme.pcsx2.txt" />
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="jaricom.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcdctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jchuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcinit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcomapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcparam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcprepct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jctrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatadst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatasrc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jddctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdhuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdinput.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmerge.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdpostct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdtrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jerror.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemansi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jutils.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jdct.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jmemsys.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jpegint.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="change.log" />
<None Include="filelist.txt" />
<None Include="README" />
<None Include="readme.pcsx2.txt" />
</ItemGroup>
</Project>

View File

@@ -1,165 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Devel|Win32">
<Configuration>Devel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>libjpeg7</ProjectName>
<ProjectGuid>{BC236261-77E8-4567-8D09-45CD02965EB6}</ProjectGuid>
<RootNamespace>libjpeg</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="jaricom.c" />
<ClCompile Include="jcapimin.c" />
<ClCompile Include="jcapistd.c" />
<ClCompile Include="jcarith.c" />
<ClCompile Include="jccoefct.c" />
<ClCompile Include="jccolor.c" />
<ClCompile Include="jcdctmgr.c" />
<ClCompile Include="jchuff.c" />
<ClCompile Include="jcinit.c" />
<ClCompile Include="jcmainct.c" />
<ClCompile Include="jcmarker.c" />
<ClCompile Include="jcmaster.c" />
<ClCompile Include="jcomapi.c" />
<ClCompile Include="jcparam.c" />
<ClCompile Include="jcprepct.c" />
<ClCompile Include="jcsample.c" />
<ClCompile Include="jctrans.c" />
<ClCompile Include="jdapimin.c" />
<ClCompile Include="jdapistd.c" />
<ClCompile Include="jdarith.c" />
<ClCompile Include="jdatadst.c" />
<ClCompile Include="jdatasrc.c" />
<ClCompile Include="jdcoefct.c" />
<ClCompile Include="jdcolor.c" />
<ClCompile Include="jddctmgr.c" />
<ClCompile Include="jdhuff.c" />
<ClCompile Include="jdinput.c" />
<ClCompile Include="jdmainct.c" />
<ClCompile Include="jdmarker.c" />
<ClCompile Include="jdmaster.c" />
<ClCompile Include="jdmerge.c" />
<ClCompile Include="jdpostct.c" />
<ClCompile Include="jdsample.c" />
<ClCompile Include="jdtrans.c" />
<ClCompile Include="jerror.c" />
<ClCompile Include="jfdctflt.c" />
<ClCompile Include="jfdctfst.c" />
<ClCompile Include="jfdctint.c" />
<ClCompile Include="jidctflt.c" />
<ClCompile Include="jidctfst.c" />
<ClCompile Include="jidctint.c" />
<ClCompile Include="jmemansi.c" />
<ClCompile Include="jmemmgr.c" />
<ClCompile Include="jquant1.c" />
<ClCompile Include="jquant2.c" />
<ClCompile Include="jutils.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h" />
<ClInclude Include="jdct.h" />
<ClInclude Include="jerror.h" />
<ClInclude Include="jinclude.h" />
<ClInclude Include="jmemsys.h" />
<ClInclude Include="jmorecfg.h" />
<ClInclude Include="jpegint.h" />
<ClInclude Include="jpeglib.h" />
<ClInclude Include="jversion.h" />
</ItemGroup>
<ItemGroup>
<None Include="change.log" />
<None Include="filelist.txt" />
<None Include="README" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
</Project>

View File

@@ -1,183 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="jaricom.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcdctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jchuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcinit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcomapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcparam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcprepct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jctrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatadst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatasrc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jddctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdhuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdinput.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmerge.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdpostct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdtrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jerror.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemansi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jutils.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jdct.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jmemsys.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jpegint.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="change.log" />
<None Include="filelist.txt" />
<None Include="README" />
</ItemGroup>
</Project>

View File

@@ -1,166 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Devel|Win32">
<Configuration>Devel</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>libjpeg7</ProjectName>
<ProjectGuid>{BC236261-77E8-4567-8D09-45CD02965EB6}</ProjectGuid>
<RootNamespace>libjpeg</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Devel.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\DefaultProjectRootDir.props" />
<Import Project="..\3rdparty.props" />
<Import Project="..\..\common\vsprops\CodeGen_Debug.props" />
<Import Project="..\..\common\vsprops\IncrementalLinking.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">$(ProjectName)-dev</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Devel|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="jaricom.c" />
<ClCompile Include="jcapimin.c" />
<ClCompile Include="jcapistd.c" />
<ClCompile Include="jcarith.c" />
<ClCompile Include="jccoefct.c" />
<ClCompile Include="jccolor.c" />
<ClCompile Include="jcdctmgr.c" />
<ClCompile Include="jchuff.c" />
<ClCompile Include="jcinit.c" />
<ClCompile Include="jcmainct.c" />
<ClCompile Include="jcmarker.c" />
<ClCompile Include="jcmaster.c" />
<ClCompile Include="jcomapi.c" />
<ClCompile Include="jcparam.c" />
<ClCompile Include="jcprepct.c" />
<ClCompile Include="jcsample.c" />
<ClCompile Include="jctrans.c" />
<ClCompile Include="jdapimin.c" />
<ClCompile Include="jdapistd.c" />
<ClCompile Include="jdarith.c" />
<ClCompile Include="jdatadst.c" />
<ClCompile Include="jdatasrc.c" />
<ClCompile Include="jdcoefct.c" />
<ClCompile Include="jdcolor.c" />
<ClCompile Include="jddctmgr.c" />
<ClCompile Include="jdhuff.c" />
<ClCompile Include="jdinput.c" />
<ClCompile Include="jdmainct.c" />
<ClCompile Include="jdmarker.c" />
<ClCompile Include="jdmaster.c" />
<ClCompile Include="jdmerge.c" />
<ClCompile Include="jdpostct.c" />
<ClCompile Include="jdsample.c" />
<ClCompile Include="jdtrans.c" />
<ClCompile Include="jerror.c" />
<ClCompile Include="jfdctflt.c" />
<ClCompile Include="jfdctfst.c" />
<ClCompile Include="jfdctint.c" />
<ClCompile Include="jidctflt.c" />
<ClCompile Include="jidctfst.c" />
<ClCompile Include="jidctint.c" />
<ClCompile Include="jmemansi.c" />
<ClCompile Include="jmemmgr.c" />
<ClCompile Include="jquant1.c" />
<ClCompile Include="jquant2.c" />
<ClCompile Include="jutils.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h" />
<ClInclude Include="jdct.h" />
<ClInclude Include="jerror.h" />
<ClInclude Include="jinclude.h" />
<ClInclude Include="jmemsys.h" />
<ClInclude Include="jmorecfg.h" />
<ClInclude Include="jpegint.h" />
<ClInclude Include="jpeglib.h" />
<ClInclude Include="jversion.h" />
</ItemGroup>
<ItemGroup>
<None Include="change.log" />
<None Include="filelist.txt" />
<None Include="README" />
<None Include="readme.pcsx2.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
</Project>

View File

@@ -1,184 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="jaricom.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jccolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcdctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jchuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcinit.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcomapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcparam.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcprepct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jcsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jctrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapimin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdapistd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdarith.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatadst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdatasrc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcoefct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdcolor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jddctmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdhuff.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdinput.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmainct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmarker.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmaster.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdmerge.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdpostct.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdsample.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jdtrans.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jerror.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jfdctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctflt.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctfst.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jidctint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemansi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jmemmgr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jquant2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="jutils.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="jconfig.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jdct.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jerror.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jinclude.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jmemsys.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jmorecfg.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jpegint.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jpeglib.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="jversion.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="change.log" />
<None Include="filelist.txt" />
<None Include="README" />
<None Include="readme.pcsx2.txt" />
</ItemGroup>
</Project>

72
3rdparty/libpng/ANNOUNCE vendored Normal file
View File

@@ -0,0 +1,72 @@
Libpng 1.6.17 - March 26, 2015
This is a public release of libpng, intended for use in production codes.
Files available for download:
Source files with LF line endings (for Unix/Linux) and with a
"configure" script
libpng-1.6.17.tar.xz (LZMA-compressed, recommended)
libpng-1.6.17.tar.gz
Source files with CRLF line endings (for Windows), without the
"configure" script
lpng1617.7z (LZMA-compressed, recommended)
lpng1617.zip
Other information:
libpng-1.6.17-README.txt
libpng-1.6.17-LICENSE.txt
libpng-1.6.17-*.asc (armored detached GPG signatures)
Changes since the last public release (1.6.16):
Removed duplicate PNG_SAFE_LIMITS_SUPPORTED handling from pngconf.h
Corrected the width limit calculation in png_check_IHDR().
Removed user limits from pngfix. Also pass NULL pointers to
png_read_row to skip the unnecessary row de-interlace stuff.
Added testing of png_set_packing() to pngvalid.c
Regenerated configure scripts in the *.tar distributions with libtool-2.4.4
Implement previously untested cases of libpng transforms in pngvalid.c
Fixed byte order in 2-byte filler, in png_do_read_filler().
Made the check for out-of-range values in png_set_tRNS() detect
values that are exactly 2^bit_depth, and work on 16-bit platforms.
Merged some parts of libpng-1.6.17beta01 and libpng-1.7.0beta47.
Added #ifndef __COVERITY__ where needed in png.c, pngrutil.c and
pngset.c to avoid warnings about dead code.
Do not build png_product2() when it is unused.
Display user limits in the output from pngtest.
Eliminated the PNG_SAFE_LIMITS macro and restored the 1-million-column
and 1-million-row default limits in pnglibconf.dfa, that can be reset
by the user at build time or run time. This provides a more robust
defense against DOS and as-yet undiscovered overflows.
Added PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED macro, on by default.
Allow user to call png_get_IHDR() with NULL arguments (Reuben Hawkins).
Rebuilt configure scripts with automake-1.15 and libtool-2.4.6
Moved png_set_filter() prototype into a PNG_WRITE_SUPPORTED block
of png.h.
Avoid runtime checks when converting integer to png_byte with
Visual Studio (Sergey Kosarevsky)
Removed some comments that the configure script did not handle
properly from scripts/pnglibconf.dfa and pnglibconf.h.prebuilt.
Free the unknown_chunks structure even when it contains no data.
Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF
for consistency, and remove some useless tests (Alexey Petruchik).
Remove pnglibconf.h, pnglibconf.c, pnglibconf.pre, pnglibconf.dfn,
and pnglibconf.out instead of pnglibconf.* in "make clean" (Cosmin).
Fixed simplified 8-bit-linear to sRGB alpha. The calculated alpha
value was wrong. It's not clear if this affected the final stored
value; in the obvious code path the upper and lower 8-bits of the
alpha value were identical and the alpha was truncated to 8-bits
rather than dividing by 257 (John Bowler).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe)
or to glennrp at users.sourceforge.net
Glenn R-P

5214
3rdparty/libpng/CHANGES vendored Normal file

File diff suppressed because it is too large Load Diff

387
3rdparty/libpng/INSTALL vendored Normal file
View File

@@ -0,0 +1,387 @@
Installing libpng
Contents
I. Simple installation
II. Rebuilding the configure scripts
III. Using scripts/makefile*
IV. Using cmake
V. Directory structure
VI. Building with project files
VII. Building with makefiles
VIII. Configuring libpng for 16-bit platforms
IX. Configuring for DOS
X. Configuring for Medium Model
XI. Prepending a prefix to exported symbols
XII. Configuring for compiler xxx:
XIII. Removing unwanted object code
XIV. Changes to the build and configuration of libpng in libpng-1.5.x
XV. Setjmp/longjmp issues
XVI. Other sources of information about libpng
I. Simple installation
On Unix/Linux and similar systems, you can simply type
./configure [--prefix=/path]
make check
make install
and ignore the rest of this document. "/path" is the path to the directory
where you want to install the libpng "lib", "include", and "bin"
subdirectories.
If you downloaded a GIT clone, you will need to run ./autogen.sh before
running ./configure, to create "configure" and "Makefile.in" which are
not included in the GIT repository.
Note that "configure" is only included in the "*.tar" distributions and not
in the "*.zip" or "*.7z" distributions. If you downloaded one of those
distributions, see "Building with project files" or "Building with makefiles",
below.
II. Rebuilding the configure scripts
If configure does not work on your system, or if you have a need to
change configure.ac or Makefile.am, and you have a reasonably
up-to-date set of tools, running ./autogen.sh in a git clone before
running ./configure may fix the problem. To be really sure that you
aren't using any of the included pre-built scripts, you can do this:
./configure --enable-maintainer-mode
make maintainer-clean
./autogen.sh --maintainer --clean
./autogen.sh --maintainer
./configure [--prefix=/path] [other options]
make
make install
make check
III. Using scripts/makefile*
Instead, you can use one of the custom-built makefiles in the
"scripts" directory
cp scripts/pnglibconf.h.prebuilt pnglibconf.h
cp scripts/makefile.system makefile
make test
make install
The files that are presently available in the scripts directory
are listed and described in scripts/README.txt.
Or you can use one of the "projects" in the "projects" directory.
Before installing libpng, you must first install zlib, if it
is not already on your system. zlib can usually be found
wherever you got libpng; otherwise go to http://zlib.net. You can place
zlib in in the same directory as libpng or in another directory.
If your system already has a preinstalled zlib you will still need
to have access to the zlib.h and zconf.h include files that
correspond to the version of zlib that's installed.
If you wish to test with a particular zlib that is not first in the
standard library search path, put ZLIBLIB, ZLIBINC, CPPFLAGS, LDFLAGS,
and LD_LIBRARY_PATH in your environment before running "make test"
or "make distcheck":
ZLIBLIB=/path/to/lib export ZLIBLIB
ZLIBINC=/path/to/include export ZLIBINC
CPPFLAGS="-I$ZLIBINC" export CPPFLAGS
LDFLAGS="-L$ZLIBLIB" export LDFLAGS
LD_LIBRARY_PATH="$ZLIBLIB:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH
If you are using one of the makefile scripts, put ZLIBLIB and ZLIBINC
in your environment and type "make ZLIBLIB=$ZLIBLIB ZLIBINC=$ZLIBINC test".
IV. Using cmake
If you want to use "cmake" (see www.cmake.org), type
cmake . -DCMAKE_INSTALL_PREFIX=/path
make
make install
As when using the simple configure method described above, "/path" points to
the installation directory where you want to put the libpng "lib", "include",
and "bin" subdirectories.
V. Directory structure
You can rename the directories that you downloaded (they
might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.8"
or "zlib128") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this:
.. (the parent directory)
libpng (this directory)
INSTALL (this file)
README
*.h, *.c => libpng source files
CMakeLists.txt => "cmake" script
configuration files:
configure.ac, configure, Makefile.am, Makefile.in,
autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
libpng-config.in, aclocal.m4, config.h.in, config.sub,
depcomp, install-sh, mkinstalldirs, test-pngtest.sh
contrib
arm-neon, conftest, examples, gregbook, libtests, pngminim,
pngminus, pngsuite, tools, visupng
projects
cbuilder5, owatcom, visualc71, vstudio, xcode
scripts
makefile.*
*.def (module definition files)
etc.
pngtest.png
etc.
zlib
README, *.h, *.c contrib, etc.
If the line endings in the files look funny, you may wish to get the other
distribution of libpng. It is available in both tar.gz (UNIX style line
endings) and zip (DOS style line endings) formats.
VI. Building with project files
If you are building libpng with MSVC, you can enter the
libpng projects\visualc71 or vstudio directory and follow the instructions
in README.txt.
Otherwise enter the zlib directory and follow the instructions in zlib/README,
then come back here and run "configure" or choose the appropriate
makefile.sys in the scripts directory.
VII. Building with makefiles
Copy the file (or files) that you need from the
scripts directory into this directory, for example
MSDOS example: copy scripts\makefile.msc makefile
copy scripts\pnglibconf.h.prebuilt pnglibconf.h
UNIX example: cp scripts/makefile.std makefile
cp scripts/pnglibconf.h.prebuilt pnglibconf.h
Read the makefile to see if you need to change any source or
target directories to match your preferences.
Then read pnglibconf.dfa to see if you want to make any configuration
changes.
Then just run "make" which will create the libpng library in
this directory and "make test" which will run a quick test that reads
the "pngtest.png" file and writes a "pngout.png" file that should be
identical to it. Look for "9782 zero samples" in the output of the
test. For more confidence, you can run another test by typing
"pngtest pngnow.png" and looking for "289 zero samples" in the output.
Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
your output with the result shown in contrib/pngsuite/README.
Most of the makefiles will allow you to run "make install" to
put the library in its final resting place (if you want to
do that, run "make install" in the zlib directory first if necessary).
Some also allow you to run "make test-installed" after you have
run "make install".
VIII. Configuring libpng for 16-bit platforms
You will want to look into zconf.h to tell zlib (and thus libpng) that
it cannot allocate more than 64K at a time. Even if you can, the memory
won't be accessible. So limit zlib and libpng to 64K by defining MAXSEG_64K.
IX. Configuring for DOS
For DOS users who only have access to the lower 640K, you will
have to limit zlib's memory usage via a png_set_compression_mem_level()
call. See zlib.h or zconf.h in the zlib library for more information.
X. Configuring for Medium Model
Libpng's support for medium model has been tested on most of the popular
compilers. Make sure MAXSEG_64K gets defined, USE_FAR_KEYWORD gets
defined, and FAR gets defined to far in pngconf.h, and you should be
all set. Everything in the library (except for zlib's structure) is
expecting far data. You must use the typedefs with the p or pp on
the end for pointers (or at least look at them and be careful). Make
note that the rows of data are defined as png_bytepp, which is
an "unsigned char far * far *".
XI. Prepending a prefix to exported symbols
Starting with libpng-1.6.0, you can configure libpng (when using the
"configure" script) to prefix all exported symbols by means of the
configuration option "--with-libpng-prefix=FOO_", where FOO_ can be any
string beginning with a letter and containing only uppercase
and lowercase letters, digits, and the underscore (i.e., a C language
identifier). This creates a set of macros in pnglibconf.h, so this is
transparent to applications; their function calls get transformed by
the macros to use the modified names.
XII. Configuring for compiler xxx:
All includes for libpng are in pngconf.h. If you need to add, change
or delete an include, this is the place to do it.
The includes that are not needed outside libpng are placed in pngpriv.h,
which is only used by the routines inside libpng itself.
The files in libpng proper only include pngpriv.h and png.h, which
in turn includes pngconf.h and, as of libpng-1.5.0, pnglibconf.h.
As of libpng-1.5.0, pngpriv.h also includes three other private header
files, pngstruct.h, pnginfo.h, and pngdebug.h, which contain material
that previously appeared in the public headers.
XIII. Removing unwanted object code
There are a bunch of #define's in pngconf.h that control what parts of
libpng are compiled. All the defines end in _SUPPORTED. If you are
never going to use a capability, you can change the #define to #undef
before recompiling libpng and save yourself code and data space, or
you can turn off individual capabilities with defines that begin with
PNG_NO_.
In libpng-1.5.0 and later, the #define's are in pnglibconf.h instead.
You can also turn all of the transforms and ancillary chunk capabilities
off en masse with compiler directives that define
PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS,
or all four, along with directives to turn on any of the capabilities that
you do want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable the
extra transformations but still leave the library fully capable of reading
and writing PNG files with all known public chunks. Use of the
PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive produces a library
that is incapable of reading or writing ancillary chunks. If you are
not using the progressive reading capability, you can turn that off
with PNG_NO_PROGRESSIVE_READ (don't confuse this with the INTERLACING
capability, which you'll still have).
All the reading and writing specific code are in separate files, so the
linker should only grab the files it needs. However, if you want to
make sure, or if you are building a stand alone library, all the
reading files start with "pngr" and all the writing files start with "pngw".
The files that don't match either (like png.c, pngtrans.c, etc.)
are used for both reading and writing, and always need to be included.
The progressive reader is in pngpread.c
If you are creating or distributing a dynamically linked library (a .so
or DLL file), you should not remove or disable any parts of the library,
as this will cause applications linked with different versions of the
library to fail if they call functions not available in your library.
The size of the library itself should not be an issue, because only
those sections that are actually used will be loaded into memory.
XIV. Changes to the build and configuration of libpng in libpng-1.5.x
Details of internal changes to the library code can be found in the CHANGES
file and in the GIT repository logs. These will be of no concern to the vast
majority of library users or builders; however, the few who configure libpng
to a non-default feature set may need to change how this is done.
There should be no need for library builders to alter build scripts if
these use the distributed build support - configure or the makefiles -
however, users of the makefiles may care to update their build scripts
to build pnglibconf.h where the corresponding makefile does not do so.
Building libpng with a non-default configuration has changed completely.
The old method using pngusr.h should still work correctly even though the
way pngusr.h is used in the build has been changed; however, library
builders will probably want to examine the changes to take advantage of
new capabilities and to simplify their build system.
A. Specific changes to library configuration capabilities
The exact mechanism used to control attributes of API functions has
changed. A single set of operating system independent macro definitions
is used and operating system specific directives are defined in
pnglibconf.h
As part of this the mechanism used to choose procedure call standards on
those systems that allow a choice has been changed. At present this only
affects certain Microsoft (DOS, Windows) and IBM (OS/2) operating systems
running on Intel processors. As before, PNGAPI is defined where required
to control the exported API functions; however, two new macros, PNGCBAPI
and PNGCAPI, are used instead for callback functions (PNGCBAPI) and
(PNGCAPI) for functions that must match a C library prototype (currently
only png_longjmp_ptr, which must match the C longjmp function.) The new
approach is documented in pngconf.h
Despite these changes, libpng 1.5.0 only supports the native C function
calling standard on those platforms tested so far (__cdecl on Microsoft
Windows). This is because the support requirements for alternative
calling conventions seem to no longer exist. Developers who find it
necessary to set PNG_API_RULE to 1 should advise the mailing list
(png-mng-implement) of this and library builders who use Openwatcom and
therefore set PNG_API_RULE to 2 should also contact the mailing list.
B. Changes to the configuration mechanism
Prior to libpng-1.5.0 library builders who needed to configure libpng
had either to modify the exported pngconf.h header file to add system
specific configuration or had to write feature selection macros into
pngusr.h and cause this to be included into pngconf.h by defining
PNG_USER_CONFIG. The latter mechanism had the disadvantage that an
application built without PNG_USER_CONFIG defined would see the
unmodified, default, libpng API and thus would probably fail to link.
These mechanisms still work in the configure build and in any makefile
build that builds pnglibconf.h, although the feature selection macros
have changed somewhat as described above. In 1.5.0, however, pngusr.h is
processed only once, at the time the exported header file pnglibconf.h is
built. pngconf.h no longer includes pngusr.h; therefore, pngusr.h is ignored
after the build of pnglibconf.h and it is never included in an application
build.
The formerly used alternative of adding a list of feature macros to the
CPPFLAGS setting in the build also still works; however, the macros will be
copied to pnglibconf.h and this may produce macro redefinition warnings
when the individual C files are compiled.
All configuration now only works if pnglibconf.h is built from
scripts/pnglibconf.dfa. This requires the program awk. Brian Kernighan
(the original author of awk) maintains C source code of that awk and this
and all known later implementations (often called by subtly different
names - nawk and gawk for example) are adequate to build pnglibconf.h.
The Sun Microsystems (now Oracle) program 'awk' is an earlier version
and does not work; this may also apply to other systems that have a
functioning awk called 'nawk'.
Configuration options are now documented in scripts/pnglibconf.dfa. This
file also includes dependency information that ensures a configuration is
consistent; that is, if a feature is switched off, dependent features are
also switched off. As a recommended alternative to using feature macros in
pngusr.h a system builder may also define equivalent options in pngusr.dfa
(or, indeed, any file) and add that to the configuration by setting
DFA_XTRA to the file name. The makefiles in contrib/pngminim illustrate
how to do this, and also illustrate a case where pngusr.h is still required.
After you have built libpng, the definitions that were recorded in
pnglibconf.h are available to your application (pnglibconf.h is included
in png.h and gets installed alongside png.h and pngconf.h in your
$PREFIX/include directory). Do not edit pnglibconf.h after you have built
libpng, because than the settings would not accurately reflect the settings
that were used to build libpng.
XV. Setjmp/longjmp issues
Libpng uses setjmp()/longjmp() for error handling. Unfortunately setjmp()
is known to be not thread-safe on some platforms and we don't know of
any platform where it is guaranteed to be thread-safe. Therefore, if
your application is going to be using multiple threads, you should
configure libpng with PNG_NO_SETJMP in your pngusr.dfa file, with
-DPNG_NO_SETJMP on your compile line, or with
#undef PNG_SETJMP_SUPPORTED
in your pnglibconf.h or pngusr.h.
Starting with libpng-1.6.0, the library included a "simplified API".
This requires setjmp/longjmp, so you must either build the library
with PNG_SETJMP_SUPPORTED defined, or with PNG_SIMPLIFIED_READ_SUPPORTED
and PNG_SIMPLIFIED_WRITE_SUPPORTED undefined.
XVI. Other sources of information about libpng:
Further information can be found in the README and libpng-manual.txt
files, in the individual makefiles, in png.h, and the manual pages
libpng.3 and png.5.

View File

@@ -1,111 +1,111 @@
This copy of the libpng notices is provided for your convenience. In case of
any discrepancy between this copy and the notices in the file png.h that is
included in the libpng distribution, the latter shall prevail.
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.2.39, August 13, 2009, are
Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
Cosmin Truta
libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.0.6
with the following individuals added to the list of Contributing Authors
Simon-Pierre Cadieux
Eric S. Raymond
Gilles Vollant
and with the following additions to the disclaimer:
There is no warranty against interference with your enjoyment of the
library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is with
the user.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-0.96,
with the following individuals added to the list of Contributing Authors:
Tom Lane
Glenn Randers-Pehrson
Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996, 1997 Andreas Dilger
Distributed according to the same disclaimer and license as libpng-0.88,
with the following individuals added to the list of Contributing Authors:
John Bowler
Kevin Bracey
Sam Bushell
Magnus Holmgren
Greg Roelofs
Tom Tanner
libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
Andreas Dilger
Dave Martindale
Guy Eric Schalnat
Paul Schmidt
Tim Wegner
The PNG Reference Library is supplied "AS IS". The Contributing Authors
and Group 42, Inc. disclaim all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and of
fitness for any purpose. The Contributing Authors and Group 42, Inc.
assume no liability for direct, indirect, incidental, special, exemplary,
or consequential damages, which may result from the use of the PNG
Reference Library, even if advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:
1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.
A "png_get_copyright" function is available, for convenient use in "about"
boxes and the like:
printf("%s",png_get_copyright(NULL));
Also, the PNG logo (in PNG format, of course) is supplied in the
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
August 13, 2009
This copy of the libpng notices is provided for your convenience. In case of
any discrepancy between this copy and the notices in the file png.h that is
included in the libpng distribution, the latter shall prevail.
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.6.17, March 26, 2015, are
Copyright (c) 2004, 2006-2015 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
Cosmin Truta
libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.0.6
with the following individuals added to the list of Contributing Authors
Simon-Pierre Cadieux
Eric S. Raymond
Gilles Vollant
and with the following additions to the disclaimer:
There is no warranty against interference with your enjoyment of the
library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is with
the user.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-0.96,
with the following individuals added to the list of Contributing Authors:
Tom Lane
Glenn Randers-Pehrson
Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996, 1997 Andreas Dilger
Distributed according to the same disclaimer and license as libpng-0.88,
with the following individuals added to the list of Contributing Authors:
John Bowler
Kevin Bracey
Sam Bushell
Magnus Holmgren
Greg Roelofs
Tom Tanner
libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
Andreas Dilger
Dave Martindale
Guy Eric Schalnat
Paul Schmidt
Tim Wegner
The PNG Reference Library is supplied "AS IS". The Contributing Authors
and Group 42, Inc. disclaim all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and of
fitness for any purpose. The Contributing Authors and Group 42, Inc.
assume no liability for direct, indirect, incidental, special, exemplary,
or consequential damages, which may result from the use of the PNG
Reference Library, even if advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:
1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.
A "png_get_copyright" function is available, for convenient use in "about"
boxes and the like:
printf("%s",png_get_copyright(NULL));
Also, the PNG logo (in PNG format, of course) is supplied in the
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
March 26, 2015

215
3rdparty/libpng/README vendored Normal file
View File

@@ -0,0 +1,215 @@
README for libpng version 1.6.17 - March 26, 2015 (shared library 16.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
Libpng comes in several distribution formats. Get libpng-*.tar.gz or
libpng-*.tar.xz or if you want UNIX-style line endings in the text files,
or lpng*.7z or lpng*.zip if you want DOS-style line endings.
Version 0.89 was the first official release of libpng. Don't let the
fact that it's the first release fool you. The libpng library has been in
extensive use and testing since mid-1995. By late 1997 it had
finally gotten to the stage where there hadn't been significant
changes to the API in some time, and people have a bad feeling about
libraries with versions < 1.0. Version 1.0.0 was released in
March 1998.
****
Note that some of the changes to the png_info structure render this
version of the library binary incompatible with libpng-0.89 or
earlier versions if you are using a shared library. The type of the
"filler" parameter for png_set_filler() has changed from png_byte to
png_uint_32, which will affect shared-library applications that use
this function.
To avoid problems with changes to the internals of png info_struct,
new APIs have been made available in 0.95 to avoid direct application
access to info_ptr. These functions are the png_set_<chunk> and
png_get_<chunk> functions. These functions should be used when
accessing/storing the info_struct data, rather than manipulating it
directly, to avoid such problems in the future.
It is important to note that the APIs did not make current programs
that access the info struct directly incompatible with the new
library, through libpng-1.2.x. In libpng-1.4.x, which was meant to
be a transitional release, members of the png_struct and the
info_struct can still be accessed, but the compiler will issue a
warning about deprecated usage. Since libpng-1.5.0, direct access
to these structs is not allowed, and the definitions of the structs
reside in private pngstruct.h and pnginfo.h header files that are not
accessible to applications. It is strongly suggested that new
programs use the new APIs (as shown in example.c and pngtest.c), and
older programs be converted to the new format, to facilitate upgrades
in the future.
****
Additions since 0.90 include the ability to compile libpng as a
Windows DLL, and new APIs for accessing data in the info struct.
Experimental functions include the ability to set weighting and cost
factors for row filter selection, direct reads of integers from buffers
on big-endian processors that support misaligned data access, faster
methods of doing alpha composition, and more accurate 16->8 bit color
conversion.
The additions since 0.89 include the ability to read from a PNG stream
which has had some (or all) of the signature bytes read by the calling
application. This also allows the reading of embedded PNG streams that
do not have the PNG file signature. As well, it is now possible to set
the library action on the detection of chunk CRC errors. It is possible
to set different actions based on whether the CRC error occurred in a
critical or an ancillary chunk.
The changes made to the library, and bugs fixed are based on discussions
on the PNG-implement mailing list and not on material submitted
privately to Guy, Andreas, or Glenn. They will forward any good
suggestions to the list.
For a detailed description on using libpng, read libpng-manual.txt. For
examples of libpng in a program, see example.c and pngtest.c. For usage
information and restrictions (what little they are) on libpng, see
png.h. For a description on using zlib (the compression library used by
libpng) and zlib's restrictions, see zlib.h
I have included a general makefile, as well as several machine and
compiler specific ones, but you may have to modify one for your own needs.
You should use zlib 1.0.4 or later to run this, but it MAY work with
versions as old as zlib 0.95. Even so, there are bugs in older zlib
versions which can cause the output of invalid compression streams for
some images. You will definitely need zlib 1.0.4 or later if you are
taking advantage of the MS-DOS "far" structure allocation for the small
and medium memory models. You should also note that zlib is a
compression library that is useful for more things than just PNG files.
You can use zlib as a drop-in replacement for fread() and fwrite() if
you are so inclined.
zlib should be available at the same place that libpng is, or at zlib.net.
You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
these at http://www.libpng.org/pub/png/documents/
This code is currently being archived at libpng.sf.net in the
[DOWNLOAD] area, and at ftp://ftp.simplesystems.org. If you can't find it
in any of those places, e-mail me, and I'll help you find it.
I am not a lawyer, but I believe that the Export Control Classification
Number (ECCN) for libpng is EAR99, which means not subject to export
controls or International Traffic in Arms Regulations (ITAR) because it
is open source, publicly available software, that does not contain any
encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b).
If you have any code changes, requests, problems, etc., please e-mail
them to me. Also, I'd appreciate any make files or project files,
and any modifications you needed to make to get libpng to compile,
along with a #define variable to tell what compiler/system you are on.
If you needed to add transformations to libpng, or wish libpng would
provide the image in a different way, drop me a note (and code, if
possible), so I can consider supporting the transformation.
Finally, if you get any warning messages when compiling libpng
(note: not zlib), and they are easy to fix, I'd appreciate the
fix. Please mention "libpng" somewhere in the subject line. Thanks.
This release was created and will be supported by myself (of course
based in a large way on Guy's and Andreas' earlier work), and the PNG
development group.
Send comments/corrections/commendations to png-mng-implement at
lists.sourceforge.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe) or to glennrp at users.sourceforge.net
You can't reach Guy, the original libpng author, at the addresses
given in previous versions of this document. He and Andreas will
read mail addressed to the png-implement list, however.
Please do not send general questions about PNG. Send them to
png-mng-misc at lists.sf.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
subscribe). If you have a question about something
in the PNG specification that is related to using libpng, send it
to me. Send me any questions that start with "I was using libpng,
and ...". If in doubt, send questions to me. I'll bounce them
to others, if necessary.
Please do not send suggestions on how to change PNG. We have
been discussing PNG for nineteen years now, and it is official and
finished. If you have suggestions for libpng, however, I'll
gladly listen. Even if your suggestion is not used immediately,
it may be used later.
Files in this distribution:
ANNOUNCE => Announcement of this version, with recent changes
CHANGES => Description of changes between libpng versions
KNOWNBUG => List of known bugs and deficiencies
LICENSE => License to use and redistribute libpng
README => This file
TODO => Things not implemented in the current library
Y2KINFO => Statement of Y2K compliance
example.c => Example code for using libpng functions
libpng.3 => manual page for libpng (includes libpng-manual.txt)
libpng-manual.txt => Description of libpng and its functions
libpngpf.3 => manual page for libpng's private functions
png.5 => manual page for the PNG format
png.c => Basic interface functions common to library
png.h => Library function and interface declarations (public)
pngpriv.h => Library function and interface declarations (private)
pngconf.h => System specific library configuration (public)
pngstruct.h => png_struct declaration (private)
pnginfo.h => png_info struct declaration (private)
pngdebug.h => debugging macros (private)
pngerror.c => Error/warning message I/O functions
pngget.c => Functions for retrieving info from struct
pngmem.c => Memory handling functions
pngbar.png => PNG logo, 88x31
pngnow.png => PNG logo, 98x31
pngpread.c => Progressive reading functions
pngread.c => Read data/helper high-level functions
pngrio.c => Lowest-level data read I/O functions
pngrtran.c => Read data transformation functions
pngrutil.c => Read data utility functions
pngset.c => Functions for storing data into the info_struct
pngtest.c => Library test program
pngtest.png => Library test sample image
pngtrans.c => Common data transformation functions
pngwio.c => Lowest-level write I/O functions
pngwrite.c => High-level write functions
pngwtran.c => Write data transformations
pngwutil.c => Write utility functions
arm => Contains optimized code for the ARM platform
contrib => Contributions
examples => Example programs
gregbook => source code for PNG reading and writing, from
Greg Roelofs' "PNG: The Definitive Guide",
O'Reilly, 1999
libtests => Test programs
pngminim => Minimal decoder, encoder, and progressive decoder
programs demonstrating use of pngusr.dfa
pngminus => Simple pnm2png and png2pnm programs
pngsuite => Test images
tools => Various tools
visupng => Contains a MSVC workspace for VisualPng
projects => Contains project files and workspaces for
building a DLL
owatcom => Contains a WATCOM project for building libpng
visualc71 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
vstudio => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
scripts => Directory containing scripts for building libpng:
(see scripts/README.txt for the list of scripts)
Good luck, and happy coding.
-Glenn Randers-Pehrson (current maintainer, since 1998)
Internet: glennrp at users.sourceforge.net
-Andreas Eric Dilger (former maintainer, 1996-1997)
Internet: adilger at enel.ucalgary.ca
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
-Guy Eric Schalnat (original author and former maintainer, 1995-1996)
(formerly of Group 42, Inc)
Internet: gschal at infinet.com

29
3rdparty/libpng/TODO vendored Normal file
View File

@@ -0,0 +1,29 @@
/*
TODO - list of things to do for libpng:
Final bug fixes.
Better C++ wrapper/full C++ implementation?
Fix problem with C++ and EXTERN "C".
cHRM transformation.
Remove setjmp/longjmp usage in favor of returning error codes.
Palette creation.
Add "grayscale->palette" transformation and "palette->grayscale" detection.
Improved dithering.
Multi-lingual error and warning message support.
Complete sRGB transformation (presently it simply uses gamma=0.45455).
Make profile checking optional via a png_set_something() call.
Man pages for function calls.
Better documentation.
Better filter selection
(counting huffman bits/precompression? filter inertia? filter costs?).
Histogram creation.
Text conversion between different code pages (Latin-1 -> Mac and DOS).
Avoid building gamma tables whenever possible.
Use greater precision when changing to linear gamma for compositing against
background and doing rgb-to-gray transformation.
Investigate pre-incremented loop counters and other loop constructions.
Add interpolated method of handling interlacing.
Switch to the simpler zlib (zlib/libpng) license if legally possible.
Extend pngvalid.c to validate more of the libpng transformations.
*/

19
3rdparty/libpng/configure vendored Executable file
View File

@@ -0,0 +1,19 @@
echo "
There is no \"configure\" script in this distribution (*.zip or *.7z) of
libpng-1.6.17.
Instead, please copy the appropriate makefile for your system from the
\"scripts\" directory. Read the INSTALL file for more details.
Update, July 2004: you can get a \"configure\" based distribution
from the libpng distribution sites. Download the file
libpng-1.6.17.tar.gz or libpng-1.6.17.tar.xz.
If the line endings in the files look funny, which is likely to be the
case if you were trying to run \"configure\" on a Linux machine, you may
wish to get the other distribution of libpng. It is available in both
tar.gz/tar.xz (UNIX style line endings, with \"configure\") and .7z/.zip
(DOS style line endings, without \"configure\") formats.
"

1061
3rdparty/libpng/example.c vendored Normal file

File diff suppressed because it is too large Load Diff

127
3rdparty/libpng/libpng-config.in vendored Executable file
View File

@@ -0,0 +1,127 @@
#! /bin/sh
# libpng-config
# provides configuration info for libpng.
# Copyright (C) 2002, 2004, 2006, 2007 Glenn Randers-Pehrson
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# Modeled after libxml-config.
version="@PNGLIB_VERSION@"
prefix="@prefix@"
exec_prefix="@exec_prefix@"
libdir="@libdir@"
includedir="@includedir@/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@"
libs="-lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@"
all_libs="-lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ @LIBS@"
I_opts="-I${includedir}"
L_opts="-L${libdir}"
R_opts=""
cppflags=""
ccopts=""
ldopts=""
usage()
{
cat <<EOF
Usage: $0 [OPTION] ...
Known values for OPTION are:
--prefix print libpng prefix
--libdir print path to directory containing library
--libs print library linking information
--ccopts print compiler options
--cppflags print pre-processor flags
--cflags print preprocessor flags, I_opts, and compiler options
--I_opts print "-I" include options
--L_opts print linker "-L" flags for dynamic linking
--R_opts print dynamic linker "-R" or "-rpath" flags
--ldopts print linker options
--ldflags print linker flags (ldopts, L_opts, R_opts, and libs)
--static revise subsequent outputs for static linking
--help print this help and exit
--version print version information
EOF
exit $1
}
if test $# -eq 0; then
usage 1
fi
while test $# -gt 0; do
case "$1" in
--prefix)
echo ${prefix}
;;
--version)
echo ${version}
exit 0
;;
--help)
usage 0
;;
--ccopts)
echo ${ccopts}
;;
--cppflags)
echo ${cppflags}
;;
--cflags)
echo ${I_opts} ${cppflags} ${ccopts}
;;
--libdir)
echo ${libdir}
;;
--libs)
echo ${libs}
;;
--I_opts)
echo ${I_opts}
;;
--L_opts)
echo ${L_opts}
;;
--R_opts)
echo ${R_opts}
;;
--ldopts)
echo ${ldopts}
;;
--ldflags)
echo ${ldopts} ${L_opts} ${R_opts} ${libs}
;;
--static)
R_opts=""
libs=${all_libs}
;;
*)
usage
exit 1
;;
esac
shift
done
exit 0

5335
3rdparty/libpng/libpng-manual.txt vendored Normal file

File diff suppressed because it is too large Load Diff

6228
3rdparty/libpng/libpng.3 vendored Normal file

File diff suppressed because it is too large Load Diff

11
3rdparty/libpng/libpng.pc.in vendored Normal file
View File

@@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@/libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
Name: libpng
Description: Loads and saves PNG files
Version: @PNGLIB_VERSION@
Libs: -L${libdir} -lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
Libs.private: @LIBS@
Cflags: -I${includedir}

18
3rdparty/libpng/libpngpf.3 vendored Normal file
View File

@@ -0,0 +1,18 @@
.TH LIBPNGPF 3 "March 26, 2015"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.17
(private functions)
.SH SYNOPSIS
\fB#include \fI"pngpriv.h"
\fBAs of libpng version \fP\fI1.5.1\fP\fB, this section is no longer \fP\fImaintained\fP\fB, now that the private function prototypes are hidden in pngpriv.h and not accessible to applications. Look in pngpriv.h for the prototypes and a short description of each \fIfunction.
.SH DESCRIPTION
The functions previously listed here are used privately by libpng and are not
available for use by applications. They are not "exported" to applications
using shared libraries.
.SH SEE ALSO
.BR "png"(5), " libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.SH AUTHOR
Glenn Randers-Pehrson

74
3rdparty/libpng/png.5 vendored Normal file
View File

@@ -0,0 +1,74 @@
.TH PNG 5 "March 26, 2015"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION
PNG (Portable Network Graphics) is an extensible file format for the
lossless, portable, well-compressed storage of raster images. PNG provides
a patent-free replacement for GIF and can also replace many
common uses of TIFF. Indexed-color, grayscale, and truecolor images are
supported, plus an optional alpha channel. Sample depths range from
1 to 16 bits.
.br
PNG is designed to work well in online viewing applications, such as the
World Wide Web, so it is fully streamable with a progressive display
option. PNG is robust, providing both full file integrity checking and
fast, simple detection of common transmission errors. Also, PNG can store
gamma and chromaticity data for improved color matching on heterogeneous
platforms.
.SH "SEE ALSO"
.BR "libpng"(3), " libpngpf"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.LP
PNG specification (second edition), November 2003:
.IP
.br
<http://www.w3.org/TR/2003/REC-PNG-20031110/
PNG 1.2 specification, July 1999:
.IP
.br
http://www.libpng.org/pub/png
.LP
PNG 1.0 specification, October 1996:
.IP
.br
RFC 2083
.IP
.br
ftp://ds.internic.net/rfc/rfc2083.txt
.br
or (as a W3C Recommendation) at
.br
http://www.w3.org/TR/REC-png.html
.SH AUTHORS
This man page: Glenn Randers-Pehrson
.LP
Portable Network Graphics (PNG) Specification (Second Edition)
Information technology - Computer graphics and image processing -
Portable Network Graphics (PNG): Functional specification.
ISO/IEC 15948:2003 (E) (November 10, 2003): David Duce and others.
.LP
Portable Network Graphics (PNG) Specification Version 1.2 (July 8, 1999):
Glenn Randers-Pehrson and others (png-list).
.LP
Portable Network Graphics (PNG) Specification Version 1.0 (October 1, 1996):
Thomas Boutell and others (png-list).
.LP
.SH COPYRIGHT NOTICE
.LP
This man page is Copyright (c) 1998-2006 Glenn Randers-Pehrson. See png.h
for conditions of use and distribution.
.LP
The PNG Specification (Second Edition) is
Copyright (c) 2003 W3C. (MIT, ERCIM, Keio), All Rights Reserved.
.LP
The PNG-1.2 specification is copyright (c) 1999 Glenn Randers-Pehrson.
See the specification for conditions of use and distribution.
.LP
The PNG-1.0 specification is copyright (c) 1996 Massachusetts Institute of
Technology. See the specification for conditions of use and distribution.
.LP
.\" end of man page

4490
3rdparty/libpng/png.c vendored Normal file

File diff suppressed because it is too large Load Diff

3292
3rdparty/libpng/png.h vendored Normal file

File diff suppressed because it is too large Load Diff

BIN
3rdparty/libpng/pngbar.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
3rdparty/libpng/pngbar.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

622
3rdparty/libpng/pngconf.h vendored Normal file
View File

@@ -0,0 +1,622 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.6.17, March 26, 2015
*
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
* Any machine specific code is near the front of this file, so if you
* are configuring libpng for a machine, you may want to read the section
* starting here down to where it starts to typedef png_color, png_text,
* and png_info.
*/
#ifndef PNGCONF_H
#define PNGCONF_H
#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */
/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C
* compiler for correct compilation. The following header files are required by
* the standard. If your compiler doesn't provide these header files, or they
* do not match the standard, you will need to provide/improve them.
*/
#include <limits.h>
#include <stddef.h>
/* Library header files. These header files are all defined by ISOC90; libpng
* expects conformant implementations, however, an ISOC90 conformant system need
* not provide these header files if the functionality cannot be implemented.
* In this case it will be necessary to disable the relevant parts of libpng in
* the build of pnglibconf.h.
*
* Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not
* include this unnecessary header file.
*/
#ifdef PNG_STDIO_SUPPORTED
/* Required for the definition of FILE: */
# include <stdio.h>
#endif
#ifdef PNG_SETJMP_SUPPORTED
/* Required for the definition of jmp_buf and the declaration of longjmp: */
# include <setjmp.h>
#endif
#ifdef PNG_CONVERT_tIME_SUPPORTED
/* Required for struct tm: */
# include <time.h>
#endif
#endif /* PNG_BUILDING_SYMBOL_TABLE */
/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using
* PNG_NO_CONST; this is no longer supported except for data declarations which
* apparently still cause problems in 2011 on some compilers.
*/
#define PNG_CONST const /* backward compatibility only */
/* This controls optimization of the reading of 16 and 32 bit values
* from PNG files. It can be set on a per-app-file basis - it
* just changes whether a macro is used when the function is called.
* The library builder sets the default; if read functions are not
* built into the library the macro implementation is forced on.
*/
#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
# define PNG_USE_READ_MACROS
#endif
#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
# if PNG_DEFAULT_READ_MACROS
# define PNG_USE_READ_MACROS
# endif
#endif
/* COMPILER SPECIFIC OPTIONS.
*
* These options are provided so that a variety of difficult compilers
* can be used. Some are fixed at build time (e.g. PNG_API_RULE
* below) but still have compiler specific implementations, others
* may be changed on a per-file basis when compiling against libpng.
*/
/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect
* against legacy (pre ISOC90) compilers that did not understand function
* prototypes. It is not required for modern C compilers.
*/
#ifndef PNGARG
# define PNGARG(arglist) arglist
#endif
/* Function calling conventions.
* =============================
* Normally it is not necessary to specify to the compiler how to call
* a function - it just does it - however on x86 systems derived from
* Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems
* and some others) there are multiple ways to call a function and the
* default can be changed on the compiler command line. For this reason
* libpng specifies the calling convention of every exported function and
* every function called via a user supplied function pointer. This is
* done in this file by defining the following macros:
*
* PNGAPI Calling convention for exported functions.
* PNGCBAPI Calling convention for user provided (callback) functions.
* PNGCAPI Calling convention used by the ANSI-C library (required
* for longjmp callbacks and sometimes used internally to
* specify the calling convention for zlib).
*
* These macros should never be overridden. If it is necessary to
* change calling convention in a private build this can be done
* by setting PNG_API_RULE (which defaults to 0) to one of the values
* below to select the correct 'API' variants.
*
* PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.
* This is correct in every known environment.
* PNG_API_RULE=1 Use the operating system convention for PNGAPI and
* the 'C' calling convention (from PNGCAPI) for
* callbacks (PNGCBAPI). This is no longer required
* in any known environment - if it has to be used
* please post an explanation of the problem to the
* libpng mailing list.
*
* These cases only differ if the operating system does not use the C
* calling convention, at present this just means the above cases
* (x86 DOS/Windows sytems) and, even then, this does not apply to
* Cygwin running on those systems.
*
* Note that the value must be defined in pnglibconf.h so that what
* the application uses to call the library matches the conventions
* set when building the library.
*/
/* Symbol export
* =============
* When building a shared library it is almost always necessary to tell
* the compiler which symbols to export. The png.h macro 'PNG_EXPORT'
* is used to mark the symbols. On some systems these symbols can be
* extracted at link time and need no special processing by the compiler,
* on other systems the symbols are flagged by the compiler and just
* the declaration requires a special tag applied (unfortunately) in a
* compiler dependent way. Some systems can do either.
*
* A small number of older systems also require a symbol from a DLL to
* be flagged to the program that calls it. This is a problem because
* we do not know in the header file included by application code that
* the symbol will come from a shared library, as opposed to a statically
* linked one. For this reason the application must tell us by setting
* the magic flag PNG_USE_DLL to turn on the special processing before
* it includes png.h.
*
* Four additional macros are used to make this happen:
*
* PNG_IMPEXP The magic (if any) to cause a symbol to be exported from
* the build or imported if PNG_USE_DLL is set - compiler
* and system specific.
*
* PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to
* 'type', compiler specific.
*
* PNG_DLL_EXPORT Set to the magic to use during a libpng build to
* make a symbol exported from the DLL. Not used in the
* public header files; see pngpriv.h for how it is used
* in the libpng build.
*
* PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come
* from a DLL - used to define PNG_IMPEXP when
* PNG_USE_DLL is set.
*/
/* System specific discovery.
* ==========================
* This code is used at build time to find PNG_IMPEXP, the API settings
* and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL
* import processing is possible. On Windows systems it also sets
* compiler-specific macros to the values required to change the calling
* conventions of the various functions.
*/
#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
/* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or
* MinGW on any architecture currently supported by Windows. Also includes
* Watcom builds but these need special treatment because they are not
* compatible with GCC or Visual C because of different calling conventions.
*/
# if PNG_API_RULE == 2
/* If this line results in an error, either because __watcall is not
* understood or because of a redefine just below you cannot use *this*
* build of the library with the compiler you are using. *This* build was
* build using Watcom and applications must also be built using Watcom!
*/
# define PNGCAPI __watcall
# endif
# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))
# define PNGCAPI __cdecl
# if PNG_API_RULE == 1
/* If this line results in an error __stdcall is not understood and
* PNG_API_RULE should not have been set to '1'.
*/
# define PNGAPI __stdcall
# endif
# else
/* An older compiler, or one not detected (erroneously) above,
* if necessary override on the command line to get the correct
* variants for the compiler.
*/
# ifndef PNGCAPI
# define PNGCAPI _cdecl
# endif
# if PNG_API_RULE == 1 && !defined(PNGAPI)
# define PNGAPI _stdcall
# endif
# endif /* compiler/api */
/* NOTE: PNGCBAPI always defaults to PNGCAPI. */
# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
# error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed"
# endif
# if (defined(_MSC_VER) && _MSC_VER < 800) ||\
(defined(__BORLANDC__) && __BORLANDC__ < 0x500)
/* older Borland and MSC
* compilers used '__export' and required this to be after
* the type.
*/
# ifndef PNG_EXPORT_TYPE
# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
# endif
# define PNG_DLL_EXPORT __export
# else /* newer compiler */
# define PNG_DLL_EXPORT __declspec(dllexport)
# ifndef PNG_DLL_IMPORT
# define PNG_DLL_IMPORT __declspec(dllimport)
# endif
# endif /* compiler */
#else /* !Windows */
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
# define PNGAPI _System
# else /* !Windows/x86 && !OS/2 */
/* Use the defaults, or define PNG*API on the command line (but
* this will have to be done for every compile!)
*/
# endif /* other system, !OS/2 */
#endif /* !Windows/x86 */
/* Now do all the defaulting . */
#ifndef PNGCAPI
# define PNGCAPI
#endif
#ifndef PNGCBAPI
# define PNGCBAPI PNGCAPI
#endif
#ifndef PNGAPI
# define PNGAPI PNGCAPI
#endif
/* PNG_IMPEXP may be set on the compilation system command line or (if not set)
* then in an internal header file when building the library, otherwise (when
* using the library) it is set here.
*/
#ifndef PNG_IMPEXP
# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)
/* This forces use of a DLL, disallowing static linking */
# define PNG_IMPEXP PNG_DLL_IMPORT
# endif
# ifndef PNG_IMPEXP
# define PNG_IMPEXP
# endif
#endif
/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat
* 'attributes' as a storage class - the attributes go at the start of the
* function definition, and attributes are always appended regardless of the
* compiler. This considerably simplifies these macros but may cause problems
* if any compilers both need function attributes and fail to handle them as
* a storage class (this is unlikely.)
*/
#ifndef PNG_FUNCTION
# define PNG_FUNCTION(type, name, args, attributes) attributes type name args
#endif
#ifndef PNG_EXPORT_TYPE
# define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
#endif
/* The ordinal value is only relevant when preprocessing png.h for symbol
* table entries, so we discard it here. See the .dfn files in the
* scripts directory.
*/
#ifndef PNG_EXPORTA
# define PNG_EXPORTA(ordinal, type, name, args, attributes)\
PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
extern attributes)
#endif
/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
* so make something non-empty to satisfy the requirement:
*/
#define PNG_EMPTY /*empty list*/
#define PNG_EXPORT(ordinal, type, name, args)\
PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
/* Use PNG_REMOVED to comment out a removed interface. */
#ifndef PNG_REMOVED
# define PNG_REMOVED(ordinal, type, name, args, attributes)
#endif
#ifndef PNG_CALLBACK
# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
#endif
/* Support for compiler specific function attributes. These are used
* so that where compiler support is available incorrect use of API
* functions in png.h will generate compiler warnings.
*
* Added at libpng-1.2.41.
*/
#ifndef PNG_NO_PEDANTIC_WARNINGS
# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
# define PNG_PEDANTIC_WARNINGS_SUPPORTED
# endif
#endif
#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
/* Support for compiler specific function attributes. These are used
* so that where compiler support is available, incorrect use of API
* functions in png.h will generate compiler warnings. Added at libpng
* version 1.2.41. Disabling these removes the warnings but may also produce
* less efficient code.
*/
# if defined(__clang__) && defined(__has_attribute)
/* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */
# if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__)
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
# endif
# if !defined(PNG_NORETURN) && __has_attribute(__noreturn__)
# define PNG_NORETURN __attribute__((__noreturn__))
# endif
# if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__)
# define PNG_ALLOCATED __attribute__((__malloc__))
# endif
# if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__)
# define PNG_DEPRECATED __attribute__((__deprecated__))
# endif
# if !defined(PNG_PRIVATE)
# ifdef __has_extension
# if __has_extension(attribute_unavailable_with_message)
# define PNG_PRIVATE __attribute__((__unavailable__(\
"This function is not exported by libpng.")))
# endif
# endif
# endif
# ifndef PNG_RESTRICT
# define PNG_RESTRICT __restrict
# endif
# elif defined(__GNUC__)
# ifndef PNG_USE_RESULT
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
# endif
# ifndef PNG_NORETURN
# define PNG_NORETURN __attribute__((__noreturn__))
# endif
# if __GNUC__ >= 3
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __attribute__((__malloc__))
# endif
# ifndef PNG_DEPRECATED
# define PNG_DEPRECATED __attribute__((__deprecated__))
# endif
# ifndef PNG_PRIVATE
# if 0 /* Doesn't work so we use deprecated instead*/
# define PNG_PRIVATE \
__attribute__((warning("This function is not exported by libpng.")))
# else
# define PNG_PRIVATE \
__attribute__((__deprecated__))
# endif
# endif
# if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))
# ifndef PNG_RESTRICT
# define PNG_RESTRICT __restrict
# endif
# endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */
# endif /* __GNUC__ >= 3 */
# elif defined(_MSC_VER) && (_MSC_VER >= 1300)
# ifndef PNG_USE_RESULT
# define PNG_USE_RESULT /* not supported */
# endif
# ifndef PNG_NORETURN
# define PNG_NORETURN __declspec(noreturn)
# endif
# ifndef PNG_ALLOCATED
# if (_MSC_VER >= 1400)
# define PNG_ALLOCATED __declspec(restrict)
# endif
# endif
# ifndef PNG_DEPRECATED
# define PNG_DEPRECATED __declspec(deprecated)
# endif
# ifndef PNG_PRIVATE
# define PNG_PRIVATE __declspec(deprecated)
# endif
# ifndef PNG_RESTRICT
# if (_MSC_VER >= 1400)
# define PNG_RESTRICT __restrict
# endif
# endif
# elif defined(__WATCOMC__)
# ifndef PNG_RESTRICT
# define PNG_RESTRICT __restrict
# endif
# endif
#endif /* PNG_PEDANTIC_WARNINGS */
#ifndef PNG_DEPRECATED
# define PNG_DEPRECATED /* Use of this function is deprecated */
#endif
#ifndef PNG_USE_RESULT
# define PNG_USE_RESULT /* The result of this function must be checked */
#endif
#ifndef PNG_NORETURN
# define PNG_NORETURN /* This function does not return */
#endif
#ifndef PNG_ALLOCATED
# define PNG_ALLOCATED /* The result of the function is new memory */
#endif
#ifndef PNG_PRIVATE
# define PNG_PRIVATE /* This is a private libpng function */
#endif
#ifndef PNG_RESTRICT
# define PNG_RESTRICT /* The C99 "restrict" feature */
#endif
#ifndef PNG_FP_EXPORT /* A floating point API. */
# ifdef PNG_FLOATING_POINT_SUPPORTED
# define PNG_FP_EXPORT(ordinal, type, name, args)\
PNG_EXPORT(ordinal, type, name, args);
# else /* No floating point APIs */
# define PNG_FP_EXPORT(ordinal, type, name, args)
# endif
#endif
#ifndef PNG_FIXED_EXPORT /* A fixed point API. */
# ifdef PNG_FIXED_POINT_SUPPORTED
# define PNG_FIXED_EXPORT(ordinal, type, name, args)\
PNG_EXPORT(ordinal, type, name, args);
# else /* No fixed point APIs */
# define PNG_FIXED_EXPORT(ordinal, type, name, args)
# endif
#endif
#ifndef PNG_BUILDING_SYMBOL_TABLE
/* Some typedefs to get us started. These should be safe on most of the common
* platforms.
*
* png_uint_32 and png_int_32 may, currently, be larger than required to hold a
* 32-bit value however this is not normally advisable.
*
* png_uint_16 and png_int_16 should always be two bytes in size - this is
* verified at library build time.
*
* png_byte must always be one byte in size.
*
* The checks below use constants from limits.h, as defined by the ISOC90
* standard.
*/
#if CHAR_BIT == 8 && UCHAR_MAX == 255
typedef unsigned char png_byte;
#else
# error "libpng requires 8 bit bytes"
#endif
#if INT_MIN == -32768 && INT_MAX == 32767
typedef int png_int_16;
#elif SHRT_MIN == -32768 && SHRT_MAX == 32767
typedef short png_int_16;
#else
# error "libpng requires a signed 16 bit type"
#endif
#if UINT_MAX == 65535
typedef unsigned int png_uint_16;
#elif USHRT_MAX == 65535
typedef unsigned short png_uint_16;
#else
# error "libpng requires an unsigned 16 bit type"
#endif
#if INT_MIN < -2147483646 && INT_MAX > 2147483646
typedef int png_int_32;
#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
typedef long int png_int_32;
#else
# error "libpng requires a signed 32 bit (or more) type"
#endif
#if UINT_MAX > 4294967294
typedef unsigned int png_uint_32;
#elif ULONG_MAX > 4294967294
typedef unsigned long int png_uint_32;
#else
# error "libpng requires an unsigned 32 bit (or more) type"
#endif
/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,
* requires an ISOC90 compiler and relies on consistent behavior of sizeof.
*/
typedef size_t png_size_t;
typedef ptrdiff_t png_ptrdiff_t;
/* libpng needs to know the maximum value of 'size_t' and this controls the
* definition of png_alloc_size_t, below. This maximum value of size_t limits
* but does not control the maximum allocations the library makes - there is
* direct application control of this through png_set_user_limits().
*/
#ifndef PNG_SMALL_SIZE_T
/* Compiler specific tests for systems where size_t is known to be less than
* 32 bits (some of these systems may no longer work because of the lack of
* 'far' support; see above.)
*/
# if (defined(__TURBOC__) && !defined(__FLAT__)) ||\
(defined(_MSC_VER) && defined(MAXSEG_64K))
# define PNG_SMALL_SIZE_T
# endif
#endif
/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no
* smaller than png_uint_32. Casts from png_size_t or png_uint_32 to
* png_alloc_size_t are not necessary; in fact, it is recommended not to use
* them at all so that the compiler can complain when something turns out to be
* problematic.
*
* Casts in the other direction (from png_alloc_size_t to png_size_t or
* png_uint_32) should be explicitly applied; however, we do not expect to
* encounter practical situations that require such conversions.
*
* PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than
* 4294967295 - i.e. less than the maximum value of png_uint_32.
*/
#ifdef PNG_SMALL_SIZE_T
typedef png_uint_32 png_alloc_size_t;
#else
typedef png_size_t png_alloc_size_t;
#endif
/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler
* implementations of Intel CPU specific support of user-mode segmented address
* spaces, where 16-bit pointers address more than 65536 bytes of memory using
* separate 'segment' registers. The implementation requires two different
* types of pointer (only one of which includes the segment value.)
*
* If required this support is available in version 1.2 of libpng and may be
* available in versions through 1.5, although the correctness of the code has
* not been verified recently.
*/
/* Typedef for floating-point numbers that are converted to fixed-point with a
* multiple of 100,000, e.g., gamma
*/
typedef png_int_32 png_fixed_point;
/* Add typedefs for pointers */
typedef void * png_voidp;
typedef const void * png_const_voidp;
typedef png_byte * png_bytep;
typedef const png_byte * png_const_bytep;
typedef png_uint_32 * png_uint_32p;
typedef const png_uint_32 * png_const_uint_32p;
typedef png_int_32 * png_int_32p;
typedef const png_int_32 * png_const_int_32p;
typedef png_uint_16 * png_uint_16p;
typedef const png_uint_16 * png_const_uint_16p;
typedef png_int_16 * png_int_16p;
typedef const png_int_16 * png_const_int_16p;
typedef char * png_charp;
typedef const char * png_const_charp;
typedef png_fixed_point * png_fixed_point_p;
typedef const png_fixed_point * png_const_fixed_point_p;
typedef png_size_t * png_size_tp;
typedef const png_size_t * png_const_size_tp;
#ifdef PNG_STDIO_SUPPORTED
typedef FILE * png_FILE_p;
#endif
#ifdef PNG_FLOATING_POINT_SUPPORTED
typedef double * png_doublep;
typedef const double * png_const_doublep;
#endif
/* Pointers to pointers; i.e. arrays */
typedef png_byte * * png_bytepp;
typedef png_uint_32 * * png_uint_32pp;
typedef png_int_32 * * png_int_32pp;
typedef png_uint_16 * * png_uint_16pp;
typedef png_int_16 * * png_int_16pp;
typedef const char * * png_const_charpp;
typedef char * * png_charpp;
typedef png_fixed_point * * png_fixed_point_pp;
#ifdef PNG_FLOATING_POINT_SUPPORTED
typedef double * * png_doublepp;
#endif
/* Pointers to pointers to pointers; i.e., pointer to array */
typedef char * * * png_charppp;
#endif /* PNG_BUILDING_SYMBOL_TABLE */
#endif /* PNGCONF_H */

153
3rdparty/libpng/pngdebug.h vendored Normal file
View File

@@ -0,0 +1,153 @@
/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
*
* Last changed in libpng 1.6.8 [December 19, 2013]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* Define PNG_DEBUG at compile time for debugging information. Higher
* numbers for PNG_DEBUG mean more debugging information. This has
* only been added since version 0.95 so it is not implemented throughout
* libpng yet, but more support will be added as needed.
*
* png_debug[1-2]?(level, message ,arg{0-2})
* Expands to a statement (either a simple expression or a compound
* do..while(0) statement) that outputs a message with parameter
* substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG
* is undefined, 0 or 1 every png_debug expands to a simple expression
* (actually ((void)0)).
*
* level: level of detail of message, starting at 0. A level 'n'
* message is preceded by 'n' 3-space indentations (not implemented
* on Microsoft compilers unless PNG_DEBUG_FILE is also
* defined, to allow debug DLL compilation with no standard IO).
* message: a printf(3) style text string. A trailing '\n' is added
* to the message.
* arg: 0 to 2 arguments for printf(3) style substitution in message.
*/
#ifndef PNGDEBUG_H
#define PNGDEBUG_H
/* These settings control the formatting of messages in png.c and pngerror.c */
/* Moved to pngdebug.h at 1.5.0 */
# ifndef PNG_LITERAL_SHARP
# define PNG_LITERAL_SHARP 0x23
# endif
# ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET
# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b
# endif
# ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET
# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d
# endif
# ifndef PNG_STRING_NEWLINE
# define PNG_STRING_NEWLINE "\n"
# endif
#ifdef PNG_DEBUG
# if (PNG_DEBUG > 0)
# if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)
# include <crtdbg.h>
# if (PNG_DEBUG > 1)
# ifndef _DEBUG
# define _DEBUG
# endif
# ifndef png_debug
# define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
_RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2)
# endif
# endif
# else /* PNG_DEBUG_FILE || !_MSC_VER */
# ifndef PNG_STDIO_SUPPORTED
# include <stdio.h> /* not included yet */
# endif
# ifndef PNG_DEBUG_FILE
# define PNG_DEBUG_FILE stderr
# endif /* PNG_DEBUG_FILE */
# if (PNG_DEBUG > 1)
# ifdef __STDC__
# ifndef png_debug
# define png_debug(l,m) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
(num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \
} while (0)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \
} while (0)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \
(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\
} while (0)
# endif
# else /* __STDC __ */
# ifndef png_debug
# define png_debug(l,m) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format); \
} while (0)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format,p1); \
} while (0)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format,p1,p2); \
} while (0)
# endif
# endif /* __STDC __ */
# endif /* (PNG_DEBUG > 1) */
# endif /* _MSC_VER */
# endif /* (PNG_DEBUG > 0) */
#endif /* PNG_DEBUG */
#ifndef png_debug
# define png_debug(l, m) ((void)0)
#endif
#ifndef png_debug1
# define png_debug1(l, m, p1) ((void)0)
#endif
#ifndef png_debug2
# define png_debug2(l, m, p1, p2) ((void)0)
#endif
#endif /* PNGDEBUG_H */

963
3rdparty/libpng/pngerror.c vendored Normal file
View File

@@ -0,0 +1,963 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
* Last changed in libpng 1.6.15 [November 20, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
* This file provides a location for all error handling. Users who
* need special error handling are expected to write replacement functions
* and use png_set_error_fn() to use those functions. See the instructions
* at each function.
*/
#include "pngpriv.h"
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
static PNG_FUNCTION(void, png_default_error,PNGARG((png_const_structrp png_ptr,
png_const_charp error_message)),PNG_NORETURN);
#ifdef PNG_WARNINGS_SUPPORTED
static void /* PRIVATE */
png_default_warning PNGARG((png_const_structrp png_ptr,
png_const_charp warning_message));
#endif /* WARNINGS */
/* This function is called whenever there is a fatal error. This function
* should not be changed. If there is a need to handle errors differently,
* you should supply a replacement error function and use png_set_error_fn()
* to replace the error function at run-time.
*/
#ifdef PNG_ERROR_TEXT_SUPPORTED
PNG_FUNCTION(void,PNGAPI
png_error,(png_const_structrp png_ptr, png_const_charp error_message),
PNG_NORETURN)
{
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
char msg[16];
if (png_ptr != NULL)
{
if ((png_ptr->flags &
(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) != 0
{
if (*error_message == PNG_LITERAL_SHARP)
{
/* Strip "#nnnn " from beginning of error message. */
int offset;
for (offset = 1; offset<15; offset++)
if (error_message[offset] == ' ')
break;
if ((png_ptr->flags & PNG_FLAG_STRIP_ERROR_TEXT) != 0)
{
int i;
for (i = 0; i < offset - 1; i++)
msg[i] = error_message[i + 1];
msg[i - 1] = '\0';
error_message = msg;
}
else
error_message += offset;
}
else
{
if ((png_ptr->flags & PNG_FLAG_STRIP_ERROR_TEXT) != 0)
{
msg[0] = '0';
msg[1] = '\0';
error_message = msg;
}
}
}
}
#endif
if (png_ptr != NULL && png_ptr->error_fn != NULL)
(*(png_ptr->error_fn))(png_constcast(png_structrp,png_ptr),
error_message);
/* If the custom handler doesn't exist, or if it returns,
use the default handler, which will not return. */
png_default_error(png_ptr, error_message);
}
#else
PNG_FUNCTION(void,PNGAPI
png_err,(png_const_structrp png_ptr),PNG_NORETURN)
{
/* Prior to 1.5.2 the error_fn received a NULL pointer, expressed
* erroneously as '\0', instead of the empty string "". This was
* apparently an error, introduced in libpng-1.2.20, and png_default_error
* will crash in this case.
*/
if (png_ptr != NULL && png_ptr->error_fn != NULL)
(*(png_ptr->error_fn))(png_constcast(png_structrp,png_ptr), "");
/* If the custom handler doesn't exist, or if it returns,
use the default handler, which will not return. */
png_default_error(png_ptr, "");
}
#endif /* ERROR_TEXT */
/* Utility to safely appends strings to a buffer. This never errors out so
* error checking is not required in the caller.
*/
size_t
png_safecat(png_charp buffer, size_t bufsize, size_t pos,
png_const_charp string)
{
if (buffer != NULL && pos < bufsize)
{
if (string != NULL)
while (*string != '\0' && pos < bufsize-1)
buffer[pos++] = *string++;
buffer[pos] = '\0';
}
return pos;
}
#if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_TIME_RFC1123_SUPPORTED)
/* Utility to dump an unsigned value into a buffer, given a start pointer and
* and end pointer (which should point just *beyond* the end of the buffer!)
* Returns the pointer to the start of the formatted string.
*/
png_charp
png_format_number(png_const_charp start, png_charp end, int format,
png_alloc_size_t number)
{
int count = 0; /* number of digits output */
int mincount = 1; /* minimum number required */
int output = 0; /* digit output (for the fixed point format) */
*--end = '\0';
/* This is written so that the loop always runs at least once, even with
* number zero.
*/
while (end > start && (number != 0 || count < mincount))
{
static const char digits[] = "0123456789ABCDEF";
switch (format)
{
case PNG_NUMBER_FORMAT_fixed:
/* Needs five digits (the fraction) */
mincount = 5;
if (output != 0 || number % 10 != 0)
{
*--end = digits[number % 10];
output = 1;
}
number /= 10;
break;
case PNG_NUMBER_FORMAT_02u:
/* Expects at least 2 digits. */
mincount = 2;
/* FALL THROUGH */
case PNG_NUMBER_FORMAT_u:
*--end = digits[number % 10];
number /= 10;
break;
case PNG_NUMBER_FORMAT_02x:
/* This format expects at least two digits */
mincount = 2;
/* FALL THROUGH */
case PNG_NUMBER_FORMAT_x:
*--end = digits[number & 0xf];
number >>= 4;
break;
default: /* an error */
number = 0;
break;
}
/* Keep track of the number of digits added */
++count;
/* Float a fixed number here: */
if ((format == PNG_NUMBER_FORMAT_fixed) && (count == 5) && (end > start))
{
/* End of the fraction, but maybe nothing was output? In that case
* drop the decimal point. If the number is a true zero handle that
* here.
*/
if (output != 0)
*--end = '.';
else if (number == 0) /* and !output */
*--end = '0';
}
}
return end;
}
#endif
#ifdef PNG_WARNINGS_SUPPORTED
/* This function is called whenever there is a non-fatal error. This function
* should not be changed. If there is a need to handle warnings differently,
* you should supply a replacement warning function and use
* png_set_error_fn() to replace the warning function at run-time.
*/
void PNGAPI
png_warning(png_const_structrp png_ptr, png_const_charp warning_message)
{
int offset = 0;
if (png_ptr != NULL)
{
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
if ((png_ptr->flags &
(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) != 0)
#endif
{
if (*warning_message == PNG_LITERAL_SHARP)
{
for (offset = 1; offset < 15; offset++)
if (warning_message[offset] == ' ')
break;
}
}
}
if (png_ptr != NULL && png_ptr->warning_fn != NULL)
(*(png_ptr->warning_fn))(png_constcast(png_structrp,png_ptr),
warning_message + offset);
else
png_default_warning(png_ptr, warning_message + offset);
}
/* These functions support 'formatted' warning messages with up to
* PNG_WARNING_PARAMETER_COUNT parameters. In the format string the parameter
* is introduced by @<number>, where 'number' starts at 1. This follows the
* standard established by X/Open for internationalizable error messages.
*/
void
png_warning_parameter(png_warning_parameters p, int number,
png_const_charp string)
{
if (number > 0 && number <= PNG_WARNING_PARAMETER_COUNT)
(void)png_safecat(p[number-1], (sizeof p[number-1]), 0, string);
}
void
png_warning_parameter_unsigned(png_warning_parameters p, int number, int format,
png_alloc_size_t value)
{
char buffer[PNG_NUMBER_BUFFER_SIZE];
png_warning_parameter(p, number, PNG_FORMAT_NUMBER(buffer, format, value));
}
void
png_warning_parameter_signed(png_warning_parameters p, int number, int format,
png_int_32 value)
{
png_alloc_size_t u;
png_charp str;
char buffer[PNG_NUMBER_BUFFER_SIZE];
/* Avoid overflow by doing the negate in a png_alloc_size_t: */
u = (png_alloc_size_t)value;
if (value < 0)
u = ~u + 1;
str = PNG_FORMAT_NUMBER(buffer, format, u);
if (value < 0 && str > buffer)
*--str = '-';
png_warning_parameter(p, number, str);
}
void
png_formatted_warning(png_const_structrp png_ptr, png_warning_parameters p,
png_const_charp message)
{
/* The internal buffer is just 192 bytes - enough for all our messages,
* overflow doesn't happen because this code checks! If someone figures
* out how to send us a message longer than 192 bytes, all that will
* happen is that the message will be truncated appropriately.
*/
size_t i = 0; /* Index in the msg[] buffer: */
char msg[192];
/* Each iteration through the following loop writes at most one character
* to msg[i++] then returns here to validate that there is still space for
* the trailing '\0'. It may (in the case of a parameter) read more than
* one character from message[]; it must check for '\0' and continue to the
* test if it finds the end of string.
*/
while (i<(sizeof msg)-1 && *message != '\0')
{
/* '@' at end of string is now just printed (previously it was skipped);
* it is an error in the calling code to terminate the string with @.
*/
if (p != NULL && *message == '@' && message[1] != '\0')
{
int parameter_char = *++message; /* Consume the '@' */
static const char valid_parameters[] = "123456789";
int parameter = 0;
/* Search for the parameter digit, the index in the string is the
* parameter to use.
*/
while (valid_parameters[parameter] != parameter_char &&
valid_parameters[parameter] != '\0')
++parameter;
/* If the parameter digit is out of range it will just get printed. */
if (parameter < PNG_WARNING_PARAMETER_COUNT)
{
/* Append this parameter */
png_const_charp parm = p[parameter];
png_const_charp pend = p[parameter] + (sizeof p[parameter]);
/* No need to copy the trailing '\0' here, but there is no guarantee
* that parm[] has been initialized, so there is no guarantee of a
* trailing '\0':
*/
while (i<(sizeof msg)-1 && *parm != '\0' && parm < pend)
msg[i++] = *parm++;
/* Consume the parameter digit too: */
++message;
continue;
}
/* else not a parameter and there is a character after the @ sign; just
* copy that. This is known not to be '\0' because of the test above.
*/
}
/* At this point *message can't be '\0', even in the bad parameter case
* above where there is a lone '@' at the end of the message string.
*/
msg[i++] = *message++;
}
/* i is always less than (sizeof msg), so: */
msg[i] = '\0';
/* And this is the formatted message. It may be larger than
* PNG_MAX_ERROR_TEXT, but that is only used for 'chunk' errors and these
* are not (currently) formatted.
*/
png_warning(png_ptr, msg);
}
#endif /* WARNINGS */
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
void PNGAPI
png_benign_error(png_const_structrp png_ptr, png_const_charp error_message)
{
if ((png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) != 0)
{
# ifdef PNG_READ_SUPPORTED
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
png_ptr->chunk_name != 0)
png_chunk_warning(png_ptr, error_message);
else
# endif
png_warning(png_ptr, error_message);
}
else
{
# ifdef PNG_READ_SUPPORTED
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
png_ptr->chunk_name != 0)
png_chunk_error(png_ptr, error_message);
else
# endif
png_error(png_ptr, error_message);
}
# ifndef PNG_ERROR_TEXT_SUPPORTED
PNG_UNUSED(error_message)
# endif
}
void /* PRIVATE */
png_app_warning(png_const_structrp png_ptr, png_const_charp error_message)
{
if ((png_ptr->flags & PNG_FLAG_APP_WARNINGS_WARN) != 0)
png_warning(png_ptr, error_message);
else
png_error(png_ptr, error_message);
# ifndef PNG_ERROR_TEXT_SUPPORTED
PNG_UNUSED(error_message)
# endif
}
void /* PRIVATE */
png_app_error(png_const_structrp png_ptr, png_const_charp error_message)
{
if ((png_ptr->flags & PNG_FLAG_APP_ERRORS_WARN) != 0)
png_warning(png_ptr, error_message);
else
png_error(png_ptr, error_message);
# ifndef PNG_ERROR_TEXT_SUPPORTED
PNG_UNUSED(error_message)
# endif
}
#endif /* BENIGN_ERRORS */
#define PNG_MAX_ERROR_TEXT 196 /* Currently limited by profile_error in png.c */
#if defined(PNG_WARNINGS_SUPPORTED) || \
(defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED))
/* These utilities are used internally to build an error message that relates
* to the current chunk. The chunk name comes from png_ptr->chunk_name,
* which is used to prefix the message. The message is limited in length
* to 63 bytes. The name characters are output as hex digits wrapped in []
* if the character is invalid.
*/
#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
static PNG_CONST char png_digit[16] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F'
};
static void /* PRIVATE */
png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp
error_message)
{
png_uint_32 chunk_name = png_ptr->chunk_name;
int iout = 0, ishift = 24;
while (ishift >= 0)
{
int c = (int)(chunk_name >> ishift) & 0xff;
ishift -= 8;
if (isnonalpha(c) != 0)
{
buffer[iout++] = PNG_LITERAL_LEFT_SQUARE_BRACKET;
buffer[iout++] = png_digit[(c & 0xf0) >> 4];
buffer[iout++] = png_digit[c & 0x0f];
buffer[iout++] = PNG_LITERAL_RIGHT_SQUARE_BRACKET;
}
else
{
buffer[iout++] = (char)c;
}
}
if (error_message == NULL)
buffer[iout] = '\0';
else
{
int iin = 0;
buffer[iout++] = ':';
buffer[iout++] = ' ';
while (iin < PNG_MAX_ERROR_TEXT-1 && error_message[iin] != '\0')
buffer[iout++] = error_message[iin++];
/* iin < PNG_MAX_ERROR_TEXT, so the following is safe: */
buffer[iout] = '\0';
}
}
#endif /* WARNINGS || ERROR_TEXT */
#if defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
PNG_FUNCTION(void,PNGAPI
png_chunk_error,(png_const_structrp png_ptr, png_const_charp error_message),
PNG_NORETURN)
{
char msg[18+PNG_MAX_ERROR_TEXT];
if (png_ptr == NULL)
png_error(png_ptr, error_message);
else
{
png_format_buffer(png_ptr, msg, error_message);
png_error(png_ptr, msg);
}
}
#endif /* READ && ERROR_TEXT */
#ifdef PNG_WARNINGS_SUPPORTED
void PNGAPI
png_chunk_warning(png_const_structrp png_ptr, png_const_charp warning_message)
{
char msg[18+PNG_MAX_ERROR_TEXT];
if (png_ptr == NULL)
png_warning(png_ptr, warning_message);
else
{
png_format_buffer(png_ptr, msg, warning_message);
png_warning(png_ptr, msg);
}
}
#endif /* WARNINGS */
#ifdef PNG_READ_SUPPORTED
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
void PNGAPI
png_chunk_benign_error(png_const_structrp png_ptr, png_const_charp
error_message)
{
if ((png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) != 0)
png_chunk_warning(png_ptr, error_message);
else
png_chunk_error(png_ptr, error_message);
# ifndef PNG_ERROR_TEXT_SUPPORTED
PNG_UNUSED(error_message)
# endif
}
#endif
#endif /* READ */
void /* PRIVATE */
png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
{
# ifndef PNG_WARNINGS_SUPPORTED
PNG_UNUSED(message)
# endif
/* This is always supported, but for just read or just write it
* unconditionally does the right thing.
*/
# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED)
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0)
# endif
# ifdef PNG_READ_SUPPORTED
{
if (error < PNG_CHUNK_ERROR)
png_chunk_warning(png_ptr, message);
else
png_chunk_benign_error(png_ptr, message);
}
# endif
# if defined(PNG_READ_SUPPORTED) && defined(PNG_WRITE_SUPPORTED)
else if ((png_ptr->mode & PNG_IS_READ_STRUCT) == 0)
# endif
# ifdef PNG_WRITE_SUPPORTED
{
if (error < PNG_CHUNK_WRITE_ERROR)
png_app_warning(png_ptr, message);
else
png_app_error(png_ptr, message);
}
# endif
}
#ifdef PNG_ERROR_TEXT_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
PNG_FUNCTION(void,
png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN)
{
# define fixed_message "fixed point overflow in "
# define fixed_message_ln ((sizeof fixed_message)-1)
int iin;
char msg[fixed_message_ln+PNG_MAX_ERROR_TEXT];
memcpy(msg, fixed_message, fixed_message_ln);
iin = 0;
if (name != NULL)
while (iin < (PNG_MAX_ERROR_TEXT-1) && name[iin] != 0)
{
msg[fixed_message_ln + iin] = name[iin];
++iin;
}
msg[fixed_message_ln + iin] = 0;
png_error(png_ptr, msg);
}
#endif
#endif
#ifdef PNG_SETJMP_SUPPORTED
/* This API only exists if ANSI-C style error handling is used,
* otherwise it is necessary for png_default_error to be overridden.
*/
jmp_buf* PNGAPI
png_set_longjmp_fn(png_structrp png_ptr, png_longjmp_ptr longjmp_fn,
size_t jmp_buf_size)
{
/* From libpng 1.6.0 the app gets one chance to set a 'jmpbuf_size' value
* and it must not change after that. Libpng doesn't care how big the
* buffer is, just that it doesn't change.
*
* If the buffer size is no *larger* than the size of jmp_buf when libpng is
* compiled a built in jmp_buf is returned; this preserves the pre-1.6.0
* semantics that this call will not fail. If the size is larger, however,
* the buffer is allocated and this may fail, causing the function to return
* NULL.
*/
if (png_ptr == NULL)
return NULL;
if (png_ptr->jmp_buf_ptr == NULL)
{
png_ptr->jmp_buf_size = 0; /* not allocated */
if (jmp_buf_size <= (sizeof png_ptr->jmp_buf_local))
png_ptr->jmp_buf_ptr = &png_ptr->jmp_buf_local;
else
{
png_ptr->jmp_buf_ptr = png_voidcast(jmp_buf *,
png_malloc_warn(png_ptr, jmp_buf_size));
if (png_ptr->jmp_buf_ptr == NULL)
return NULL; /* new NULL return on OOM */
png_ptr->jmp_buf_size = jmp_buf_size;
}
}
else /* Already allocated: check the size */
{
size_t size = png_ptr->jmp_buf_size;
if (size == 0)
{
size = (sizeof png_ptr->jmp_buf_local);
if (png_ptr->jmp_buf_ptr != &png_ptr->jmp_buf_local)
{
/* This is an internal error in libpng: somehow we have been left
* with a stack allocated jmp_buf when the application regained
* control. It's always possible to fix this up, but for the moment
* this is a png_error because that makes it easy to detect.
*/
png_error(png_ptr, "Libpng jmp_buf still allocated");
/* png_ptr->jmp_buf_ptr = &png_ptr->jmp_buf_local; */
}
}
if (size != jmp_buf_size)
{
png_warning(png_ptr, "Application jmp_buf size changed");
return NULL; /* caller will probably crash: no choice here */
}
}
/* Finally fill in the function, now we have a satisfactory buffer. It is
* valid to change the function on every call.
*/
png_ptr->longjmp_fn = longjmp_fn;
return png_ptr->jmp_buf_ptr;
}
void /* PRIVATE */
png_free_jmpbuf(png_structrp png_ptr)
{
if (png_ptr != NULL)
{
jmp_buf *jb = png_ptr->jmp_buf_ptr;
/* A size of 0 is used to indicate a local, stack, allocation of the
* pointer; used here and in png.c
*/
if (jb != NULL && png_ptr->jmp_buf_size > 0)
{
/* This stuff is so that a failure to free the error control structure
* does not leave libpng in a state with no valid error handling: the
* free always succeeds, if there is an error it gets ignored.
*/
if (jb != &png_ptr->jmp_buf_local)
{
/* Make an internal, libpng, jmp_buf to return here */
jmp_buf free_jmp_buf;
if (!setjmp(free_jmp_buf))
{
png_ptr->jmp_buf_ptr = &free_jmp_buf; /* come back here */
png_ptr->jmp_buf_size = 0; /* stack allocation */
png_ptr->longjmp_fn = longjmp;
png_free(png_ptr, jb); /* Return to setjmp on error */
}
}
}
/* *Always* cancel everything out: */
png_ptr->jmp_buf_size = 0;
png_ptr->jmp_buf_ptr = NULL;
png_ptr->longjmp_fn = 0;
}
}
#endif
/* This is the default error handling function. Note that replacements for
* this function MUST NOT RETURN, or the program will likely crash. This
* function is used by default, or if the program supplies NULL for the
* error function pointer in png_set_error_fn().
*/
static PNG_FUNCTION(void /* PRIVATE */,
png_default_error,(png_const_structrp png_ptr, png_const_charp error_message),
PNG_NORETURN)
{
#ifdef PNG_CONSOLE_IO_SUPPORTED
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
/* Check on NULL only added in 1.5.4 */
if (error_message != NULL && *error_message == PNG_LITERAL_SHARP)
{
/* Strip "#nnnn " from beginning of error message. */
int offset;
char error_number[16];
for (offset = 0; offset<15; offset++)
{
error_number[offset] = error_message[offset + 1];
if (error_message[offset] == ' ')
break;
}
if ((offset > 1) && (offset < 15))
{
error_number[offset - 1] = '\0';
fprintf(stderr, "libpng error no. %s: %s",
error_number, error_message + offset + 1);
fprintf(stderr, PNG_STRING_NEWLINE);
}
else
{
fprintf(stderr, "libpng error: %s, offset=%d",
error_message, offset);
fprintf(stderr, PNG_STRING_NEWLINE);
}
}
else
#endif
{
fprintf(stderr, "libpng error: %s", error_message ? error_message :
"undefined");
fprintf(stderr, PNG_STRING_NEWLINE);
}
#else
PNG_UNUSED(error_message) /* Make compiler happy */
#endif
png_longjmp(png_ptr, 1);
}
PNG_FUNCTION(void,PNGAPI
png_longjmp,(png_const_structrp png_ptr, int val),PNG_NORETURN)
{
#ifdef PNG_SETJMP_SUPPORTED
if (png_ptr != NULL && png_ptr->longjmp_fn != NULL &&
png_ptr->jmp_buf_ptr != NULL)
png_ptr->longjmp_fn(*png_ptr->jmp_buf_ptr, val);
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(val)
#endif
/* If control reaches this point, png_longjmp() must not return. The only
* choice is to terminate the whole process (or maybe the thread); to do
* this the ANSI-C abort() function is used unless a different method is
* implemented by overriding the default configuration setting for
* PNG_ABORT().
*/
PNG_ABORT();
}
#ifdef PNG_WARNINGS_SUPPORTED
/* This function is called when there is a warning, but the library thinks
* it can continue anyway. Replacement functions don't have to do anything
* here if you don't want them to. In the default configuration, png_ptr is
* not used, but it is passed in case it may be useful.
*/
static void /* PRIVATE */
png_default_warning(png_const_structrp png_ptr, png_const_charp warning_message)
{
#ifdef PNG_CONSOLE_IO_SUPPORTED
# ifdef PNG_ERROR_NUMBERS_SUPPORTED
if (*warning_message == PNG_LITERAL_SHARP)
{
int offset;
char warning_number[16];
for (offset = 0; offset < 15; offset++)
{
warning_number[offset] = warning_message[offset + 1];
if (warning_message[offset] == ' ')
break;
}
if ((offset > 1) && (offset < 15))
{
warning_number[offset + 1] = '\0';
fprintf(stderr, "libpng warning no. %s: %s",
warning_number, warning_message + offset);
fprintf(stderr, PNG_STRING_NEWLINE);
}
else
{
fprintf(stderr, "libpng warning: %s",
warning_message);
fprintf(stderr, PNG_STRING_NEWLINE);
}
}
else
# endif
{
fprintf(stderr, "libpng warning: %s", warning_message);
fprintf(stderr, PNG_STRING_NEWLINE);
}
#else
PNG_UNUSED(warning_message) /* Make compiler happy */
#endif
PNG_UNUSED(png_ptr) /* Make compiler happy */
}
#endif /* WARNINGS */
/* This function is called when the application wants to use another method
* of handling errors and warnings. Note that the error function MUST NOT
* return to the calling routine or serious problems will occur. The return
* method used in the default routine calls longjmp(png_ptr->jmp_buf_ptr, 1)
*/
void PNGAPI
png_set_error_fn(png_structrp png_ptr, png_voidp error_ptr,
png_error_ptr error_fn, png_error_ptr warning_fn)
{
if (png_ptr == NULL)
return;
png_ptr->error_ptr = error_ptr;
png_ptr->error_fn = error_fn;
#ifdef PNG_WARNINGS_SUPPORTED
png_ptr->warning_fn = warning_fn;
#else
PNG_UNUSED(warning_fn)
#endif
}
/* This function returns a pointer to the error_ptr associated with the user
* functions. The application should free any memory associated with this
* pointer before png_write_destroy and png_read_destroy are called.
*/
png_voidp PNGAPI
png_get_error_ptr(png_const_structrp png_ptr)
{
if (png_ptr == NULL)
return NULL;
return ((png_voidp)png_ptr->error_ptr);
}
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
void PNGAPI
png_set_strip_error_numbers(png_structrp png_ptr, png_uint_32 strip_mode)
{
if (png_ptr != NULL)
{
png_ptr->flags &=
((~(PNG_FLAG_STRIP_ERROR_NUMBERS |
PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode);
}
}
#endif
#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
/* Currently the above both depend on SETJMP_SUPPORTED, however it would be
* possible to implement without setjmp support just so long as there is some
* way to handle the error return here:
*/
PNG_FUNCTION(void /* PRIVATE */, (PNGCBAPI
png_safe_error),(png_structp png_nonconst_ptr, png_const_charp error_message),
PNG_NORETURN)
{
const png_const_structrp png_ptr = png_nonconst_ptr;
png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);
/* An error is always logged here, overwriting anything (typically a warning)
* that is already there:
*/
if (image != NULL)
{
png_safecat(image->message, (sizeof image->message), 0, error_message);
image->warning_or_error |= PNG_IMAGE_ERROR;
/* Retrieve the jmp_buf from within the png_control, making this work for
* C++ compilation too is pretty tricky: C++ wants a pointer to the first
* element of a jmp_buf, but C doesn't tell us the type of that.
*/
if (image->opaque != NULL && image->opaque->error_buf != NULL)
longjmp(png_control_jmp_buf(image->opaque), 1);
/* Missing longjmp buffer, the following is to help debugging: */
{
size_t pos = png_safecat(image->message, (sizeof image->message), 0,
"bad longjmp: ");
png_safecat(image->message, (sizeof image->message), pos,
error_message);
}
}
/* Here on an internal programming error. */
abort();
}
#ifdef PNG_WARNINGS_SUPPORTED
void /* PRIVATE */ PNGCBAPI
png_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message)
{
const png_const_structrp png_ptr = png_nonconst_ptr;
png_imagep image = png_voidcast(png_imagep, png_ptr->error_ptr);
/* A warning is only logged if there is no prior warning or error. */
if (image->warning_or_error == 0)
{
png_safecat(image->message, (sizeof image->message), 0, warning_message);
image->warning_or_error |= PNG_IMAGE_WARNING;
}
}
#endif
int /* PRIVATE */
png_safe_execute(png_imagep image_in, int (*function)(png_voidp), png_voidp arg)
{
volatile png_imagep image = image_in;
volatile int result;
volatile png_voidp saved_error_buf;
jmp_buf safe_jmpbuf;
/* Safely execute function(arg) with png_error returning to this function. */
saved_error_buf = image->opaque->error_buf;
result = setjmp(safe_jmpbuf) == 0;
if (result != 0)
{
image->opaque->error_buf = safe_jmpbuf;
result = function(arg);
}
image->opaque->error_buf = saved_error_buf;
/* And do the cleanup prior to any failure return. */
if (result == 0)
png_image_free(image);
return result;
}
#endif /* SIMPLIFIED READ || SIMPLIFIED_WRITE */
#endif /* READ || WRITE */

1219
3rdparty/libpng/pngget.c vendored Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More