Replace deprecated str2mat() by char() in some M-Files.

Unsupported by stock Octave-3.6.2, deprecated by Matlab.
-> Makes RenderDemo work on Octave.
Screen/Linux: Fix missing glibconfig.h on some 64-Bit builds.

Building on Ubuntu 12.10 with 64-Bit Octave/Matlab results in
complaints about missing glibconfig.h, because it is no longer
stored in the i386-linux-gnu subfolder, but the x86_64-linux-gnu
subfolder. Makes sense for a 64-Bit build.

Add an extra include for that path, so gcc looks in both locations.
-> Screen for 64-Bit Octave rebuilt and tested.
Screen/Linux: Fix most compiler warnings.

Except the ones we can't avoid due to backwards compat needs.
Screen/Linux: Remove nouveau boilerplate warning.

Nouveau, as of version 1.0.0, released 18th June 2012, is
no longer a hazard for visual stimulus timing. It should
provide accurate/robust stimulus onset timing. Stimulus
onset timestamping should be reliable and robust. Accuracy
of onset timestamps is still not as great as it could be
due to lack of high precision support in the nouveau-kms
kernel driver as of Linux 3.9, februrary 2013. However,
accuracy is comparable to what other vision science toolkits
would achieve and good enough for light to medium precision
needs, about 1 msec. Usercode can switch to high precision
by using Screen('Preference','VBLTimestampingmode', 1); if
needed. This (plus the usual amount of tinkering with display
mappings on non-standard display setups) would use the
high-precision beamposition timestamping as with the
proprietary NVidia binary blob.

Anyway, do away with the warning boilerplate, it is no
longer justified.
Adding a PR-705 toolbox to PTB-3
Fixing a redundancy when using a Keyspan USB-serial adapter

Keyserial1 is an alias to the first port on your Keyspan adapter
(regardless if it's single- or multi-port). USA19* is a prefix to the
raw port on a single-port adapter. Therefore it's redundant to have
both in PortDB. In fact it's an error when FindSerialPort finds > 1
match by default.
Merge pull request #20 from Psychtoolbox-3/master

Resync with current master of official Psychtoolbox-3 repo.
Merge pull request #19 from zacklb/findserial-fix

Fixing a redundancy when using a Keyspan USB-serial adapter
Merge pull request #18 from zacklb/pr705

Adding a PR-705 toolbox to PTB-3
DownloadPsychtoolbox, GetSubversionPath: Match svn client path search order.

It was different between DownloadPsychtoolbox and the rest, which could
cause funnyness if multiple svn clients were installed on the same OSX
machine in the different locations, e.g., if the clients required different
svn repository formats and caused "upgrade your repo" errors.

Closes issue #103 on Psychtoolbox main repo.
BitsPlusPlus: Fix command submission for multi-DIO commands.

If multiple T-Lock DIO control codes were defined via
BitsPlusPlus('DIOCommand', ...) and no specifix x,y offset
was given, so that default positions for T-Lock patterns were
to be chosen, it would fail. Reason: y offset for each T-Lock
line was fixed to scanline 3, instead of advancing one scaline
for each successive T-Lock. In use, each T-Lock would have
overwritten its predecessor, so only the very last T-Lock would
have taken effect.

Fixed by advancing by 1 scanline per additional T-Lock control line.
FindSerialPort: Add ttyACMxxx devices to enumerated serial ports on Linux.

The CRS Bits# enumerates, e.g., as a /dev/ttyACM0, so auto-detect
this port device category.
BitsPlusImagingPipelineTest and BitsPlusIdentityClutTest: Add Bits# support.

Allow to run Bits# hardware assisted diagnostic routines and
auto-fixes, similar to the ones already available for VPixx
DataPixx, ViewPixx and ProPixx.

Also allow specification of an optional 'windowrect' for the
onscreen test window. This only makes sense on Linux for quick
and dirty testing, not for production use on any os.
PsychImaging/BitsPlusPlus: Add basic support for CRS Bits#

PsychImaging, respective BitsPlusPlus is now able to detect
if a Bits# device instead of a Bits+ device shall be used.

This is done by creating a configuration file "BitsSharpConfig.txt"
in the PsychtoolboxConfigDir() which marks and configures use
of a Bits#. Presence of the file signals a connected Bits#
device and the 1st line of the config file stores the name
of the serial port(-device file) to which the Bits# is connected.
If no such name is given, the serial port of the connected Bits#
is auto-detected via serial port probing. One can also specify
explicitely that a Bits# should be used, and the serial port spec,
via the new PsychImaging('AddTask','General','UseBits#' [, portspec]);
command.

If a Bits# is connected, the driver will try to establish a
serial port connection and use it to command automatic video
mode switching between Bits++, Mono++ and Color++ mode, depending
on what PsychImaging() high precision display mode was requested.
At onscreen window close time, the Bits# will be automatically
switched back into Bits++ mode and the connection will be closed.
Bits++ mode is GUI compatible, ie., the Bits# monitor can be used
to display the desktop GUI.

The driver can now also use the Bits#'s new diagnostic pixeldata
readback feature to perform hardware based diagnostic and auto-lut
tweaking to make sure that a proper framebuffer pixel identity
passthrough is achieved, and to tweak/correct the GPU's gamma
table LUT accordingly to fix possible problems with passthrough,
e.g., due to non-identity gamma tables or display dithering.
The tweaking algorithm is exactly the same as the one formerly
only used for VPixx devices like DataPixx inside the PsychDataPixx()
driver's 'CheckGPUSanity' subfunction. The test and tweaking code
has been factored out into a shared function ...
PsychHardware/PsychGPUTestAndTweakGammaTables.m
... so we only need one implementation of the routine. This function
gets called by BitsPlusPlus for Bits# and PsychDataPixx for VPixx
devices and has little bits of device specific callbacks into those
drivers to perform device setup and device specific pixel readback.

Currently the Bits# driver only supports basic video mode switching,
connecting to the device, resetting of video modes and the LUT/encoder
testing and tweaking, ie., basic video output handling. It doesn't yet
support Bits# device analog/digital i/o, or RtBox style response box
functionality or interop with that driver. If one wanted to use those
functionality, one would need to operate the driver as if it was
connected to a good'ol Bits+ device.

Tested with BitsPlusImagingPipelineTest (and included encodertest),
BitsPlusIdentityClutTest (and included encodertest and tweaking),
AdditiveBlendingForLinearSuperpositionTutorial and MinimumMotionExp
under Ubuntu Linux 12.10 + 64-Bit Octave.
BitsPlusIdentityClutTest, BitsPlusImagingPipelineTest: Make compatible with Bits#

Make sure Bits# connection and video modes are properly closed down.
MinimumMotionExp: Remove harmful and redundant "clear all" at top.

It is useless and can cause malfunctions in octave and matlab.
BitsPlusPlus: New subfunctions for Bits#

SwitchtoXXX to manually switch to video mdoe XXX, e.g., Mono++
SwitchToStatusScreen to switch to diagnostic status screen.
MassStorageMode to disconnect from the device and reboot the
device into USB mass storage mode, to operate as a USB flash drive.

This concludes initial Bits# bringup for at least basic functionality
and "self-healing" for the video output system.

Still tbd: DAQ and response box functionality, as well as some of
the more fancy display mode tweaks (dithering, internal gamma table etc.).

Successfully tested so far on Ubuntu Linux 12.10 with 64-Bit Octave.
Add forgotten memcpyCudaOpenGL.mexmaci for 32-Bit Matlab on OSX/Intel.
Merge branch 'master' of https://github.com/kleinerm/Psychtoolbox-3
BitsPlusPlus: Matlab specific fixes for Bits#, cleanups.

Some tiny incompatibility between Octave and Matlab fixed.
Some fixes for warnings. Some cleanups of comments. Some
additions to help texts.

Tested and confirmed to work on OSX 10.7.5 with 64-Bit Matlab R2012a.

OSX 10.7.5 with the NVidia GeForce GT 330M has a really screwed
gamma table on OSX! None of our detected LUT's or any of the manually
selectable LUT's work at all. They don't provide an identity mapping
and they additionally cause massive interference by dithering.

The same hardware under Ubuntu Linux 12.10 just worked out of the box (tm).

Tweaking with dithering interference can take very long. It took over
11 Minutes to converge to a solution with the Bits#.