move wiiuse to Source/Core and add to the main dolphin solution
make wiiuse link dynamically with hid.dll, removing the need for WDK compile wiiuse as c++ git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6394 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
8eb1fe8831
commit
7ad7acd248
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -344,7 +344,6 @@ dirs = [
|
|||
'Externals/Bochs_disasm',
|
||||
#'Externals/CLRun',
|
||||
'Externals/Lua',
|
||||
'Externals/WiiUse/Src',
|
||||
'Externals/GLew',
|
||||
'Externals/LZO',
|
||||
#'Externals/OpenAL',
|
||||
|
@ -364,6 +363,7 @@ dirs = [
|
|||
'Source/Core/InputCommon/Src',
|
||||
'Source/Core/InputUICommon/Src',
|
||||
'Source/Core/VideoCommon/Src',
|
||||
'Source/Core/wiiuse/Src',
|
||||
'Source/DSPTool/Src',
|
||||
'Source/Plugins/Plugin_DSP_HLE/Src',
|
||||
'Source/Plugins/Plugin_DSP_LLE/Src',
|
||||
|
|
|
@ -13,3 +13,4 @@ add_subdirectory(DolphinWX)
|
|||
add_subdirectory(DSPCore)
|
||||
add_subdirectory(InputCommon)
|
||||
add_subdirectory(VideoCommon)
|
||||
add_subdirectory(wiiuse)
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\wiiuse\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
|
@ -69,9 +69,8 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="wiiused.lib"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
|
@ -116,7 +115,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\wiiuse\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
|
@ -140,9 +139,8 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="wiiused.lib"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
|
@ -191,7 +189,7 @@
|
|||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="false"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\wiiuse\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
|
@ -215,9 +213,8 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="wiiuse.lib"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
|
@ -269,7 +266,7 @@
|
|||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="false"
|
||||
WholeProgramOptimization="false"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\wiiuse\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
|
@ -293,9 +290,8 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="wiiuse.lib"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\Lua\$(OutDir)\Lua.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
|
@ -344,7 +340,7 @@
|
|||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="false"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\wiiuse\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="true"
|
||||
|
@ -367,9 +363,8 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="wiiuse.lib"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
|
@ -419,7 +414,7 @@
|
|||
FavorSizeOrSpeed="1"
|
||||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="false"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include;..\..\..\Externals\WiiUse\Src"
|
||||
AdditionalIncludeDirectories=".\Core\Core\Src\Debugger;..\Common\Src;..\DiscIO\Src;..\wiiuse\Src;..\..\Core\InputCommon\Src;..\..\PluginSpecs;..\..\..\Externals\LZO;..\..\..\Externals\Bochs_disasm;..\..\..\Externals\zlib;..\..\..\Externals\Lua;..\..\..\Externals\SFML\include"
|
||||
PreprocessorDefinitions="NDEBUG;_LIB;DEBUGFAST;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0"
|
||||
RuntimeLibrary="0"
|
||||
BufferSecurityCheck="false"
|
||||
|
@ -441,9 +436,8 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="wiiuse.lib"
|
||||
OutputFile="$(OutDir)/Core.lib"
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib";"..\..\..\Externals\WiiUse\$(PlatformName)""
|
||||
AdditionalLibraryDirectories=""..\..\..\Externals\LZO\$(OutDir)\lzo.lib""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
set(SRCS Src/ir.c
|
||||
Src/wiiuse.c)
|
||||
set(SRCS Src/ir.cpp
|
||||
Src/wiiuse.cpp)
|
||||
|
||||
if(APPLE)
|
||||
set(SRCS ${SRCS} Src/io_osx.m)
|
||||
elseif(UNIX AND BLUEZ_FOUND)
|
||||
set(SRCS ${SRCS} Src/io_nix.c)
|
||||
set(SRCS ${SRCS} Src/io_nix.cpp)
|
||||
set(LIBS ${LIBS} bluetooth)
|
||||
elseif(WIN32)
|
||||
set(SRCS ${SRCS} Src/io_win.c)
|
||||
set(SRCS ${SRCS} Src/io_win.cpp)
|
||||
else()
|
||||
set(SRCS ${SRCS} Src/io_dummy.c)
|
||||
set(SRCS ${SRCS} Src/io_dummy.cpp)
|
||||
endif()
|
||||
|
||||
add_library(wiiuse STATIC ${SRCS})
|
|
@ -4,18 +4,18 @@ Import('env')
|
|||
import sys
|
||||
|
||||
files = [
|
||||
"ir.c",
|
||||
"wiiuse.c",
|
||||
"ir.cpp",
|
||||
"wiiuse.cpp",
|
||||
]
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
files += [ "io_osx.m" ]
|
||||
elif sys.platform == 'linux2' and env['HAVE_BLUEZ']:
|
||||
files += [ "io_nix.c" ]
|
||||
files += [ "io_nix.cpp" ]
|
||||
elif sys.platform == 'win32':
|
||||
files += [ "io_win.c" ]
|
||||
files += [ "io_win.cpp" ]
|
||||
else:
|
||||
files += [ "io_dummy.c" ]
|
||||
files += [ "io_dummy.cpp" ]
|
||||
|
||||
env.StaticLibrary(env['local_libs'] + "wiiuse", files)
|
||||
env['CPPPATH'] += ['#Externals/WiiUse/Src']
|
||||
env['CPPPATH'] += ['#Source/Core/wiiuse/Src']
|
|
@ -34,7 +34,7 @@
|
|||
#ifndef DEFINITIONS_H_INCLUDED
|
||||
#define DEFINITIONS_H_INCLUDED
|
||||
|
||||
#include "Log.h"
|
||||
#include <Common.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <arpa/inet.h> /* htons() */
|
||||
|
@ -46,13 +46,6 @@
|
|||
|
||||
#endif // _WIN32
|
||||
|
||||
// NOTICE_LEVEL is more appropriate for the uses of WIIUSE_INFO than INFO_LEVEL
|
||||
// as long as we don't provide adequate GUI feedback for bluetooth events.
|
||||
#define WIIUSE_INFO(...) { GENERIC_LOG(WIIMOTE, NOTICE_LEVEL, __VA_ARGS__) }
|
||||
#define WIIUSE_ERROR(...) { GENERIC_LOG(WIIMOTE, ERROR_LEVEL, __VA_ARGS__) }
|
||||
#define WIIUSE_WARNING(...) { GENERIC_LOG(WIIMOTE, WARNING_LEVEL, __VA_ARGS__) }
|
||||
#define WIIUSE_DEBUG(...) { GENERIC_LOG(WIIMOTE, DEBUG_LEVEL, __VA_ARGS__) }
|
||||
|
||||
/* Convert to big endian */
|
||||
#define BIG_ENDIAN_LONG(i) (htonl(i))
|
||||
#define BIG_ENDIAN_SHORT(i) (htons(i))
|
|
@ -99,7 +99,7 @@ int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int timeout)
|
|||
return 0;
|
||||
}
|
||||
|
||||
WIIUSE_INFO("Found %i bluetooth device(s).", found_devices);
|
||||
NOTICE_LOG(WIIMOTE, "Found %i bluetooth device(s).", found_devices);
|
||||
|
||||
// display discovered devices
|
||||
for (i = 0; (i < found_devices) && (found_wiimotes < max_wiimotes); ++i)
|
||||
|
@ -123,7 +123,7 @@ int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int timeout)
|
|||
// found a new device
|
||||
ba2str(&scan_info[i].bdaddr, wm[found_wiimotes]->bdaddr_str);
|
||||
|
||||
WIIUSE_INFO("Found wiimote (%s) [id %i].",
|
||||
NOTICE_LOG(WIIMOTE, "Found wiimote (%s) [id %i].",
|
||||
wm[found_wiimotes]->bdaddr_str, wm[found_wiimotes]->unid);
|
||||
|
||||
wm[found_wiimotes]->bdaddr = scan_info[i].bdaddr;
|
||||
|
@ -225,7 +225,7 @@ static int wiiuse_connect_single(struct wiimote_t* wm, char* address)
|
|||
return 0;
|
||||
}
|
||||
|
||||
WIIUSE_INFO("Connected to wiimote [id %i].", wm->unid);
|
||||
NOTICE_LOG(WIIMOTE, "Connected to wiimote [id %i].", wm->unid);
|
||||
// do the handshake
|
||||
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_CONNECTED);
|
||||
|
||||
|
@ -278,7 +278,7 @@ int wiiuse_io_read(struct wiimote_t* wm)
|
|||
|
||||
if (select(wm->in_sock + 1, &fds, NULL, NULL, &tv) == -1)
|
||||
{
|
||||
WIIUSE_ERROR("Unable to select() the wiimote interrupt socket(s).");
|
||||
ERROR_LOG(WIIMOTE, "Unable to select() the wiimote interrupt socket(s).");
|
||||
perror("Error Details");
|
||||
return 0;
|
||||
}
|
||||
|
@ -295,13 +295,13 @@ int wiiuse_io_read(struct wiimote_t* wm)
|
|||
if (r == -1)
|
||||
{
|
||||
// error reading data
|
||||
WIIUSE_ERROR("Receiving wiimote data (id %i).", wm->unid);
|
||||
ERROR_LOG(WIIMOTE, "Receiving wiimote data (id %i).", wm->unid);
|
||||
perror("Error Details");
|
||||
|
||||
if (errno == ENOTCONN)
|
||||
{
|
||||
// this can happen if the bluetooth dongle is disconnected
|
||||
WIIUSE_ERROR("Bluetooth appears to be disconnected. Wiimote unid %i will be disconnected.", wm->unid);
|
||||
ERROR_LOG(WIIMOTE, "Bluetooth appears to be disconnected. Wiimote unid %i will be disconnected.", wm->unid);
|
||||
wiiuse_disconnect(wm);
|
||||
wm->event = WIIUSE_UNEXPECTED_DISCONNECT;
|
||||
}
|
|
@ -72,7 +72,7 @@ volatile int reader, writer, outstanding, watermark;
|
|||
- (void) deviceInquiryDeviceFound: (IOBluetoothDeviceInquiry *) sender
|
||||
device: (IOBluetoothDevice *) device
|
||||
{
|
||||
WIIUSE_INFO("Discovered bluetooth device at %s: %s",
|
||||
NOTICE_LOG(WIIMOTE, "Discovered bluetooth device at %s: %s",
|
||||
[[device getAddressString] UTF8String],
|
||||
[[device getName] UTF8String]);
|
||||
|
||||
|
@ -92,12 +92,12 @@ volatile int reader, writer, outstanding, watermark;
|
|||
// IOBluetoothDevice *device = [l2capChannel getDevice];
|
||||
|
||||
if (length > MAX_PAYLOAD) {
|
||||
WIIUSE_WARNING("Dropping wiimote packet - too large");
|
||||
WARN_LOG(WIIMOTE, "Dropping wiimote packet - too large");
|
||||
return;
|
||||
}
|
||||
|
||||
if (queue[writer].len != 0) {
|
||||
WIIUSE_WARNING("Dropping wiimote packet - queue full");
|
||||
WARN_LOG(WIIMOTE, "Dropping wiimote packet - queue full");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ volatile int reader, writer, outstanding, watermark;
|
|||
|
||||
if (outstanding > watermark) {
|
||||
watermark = outstanding;
|
||||
WIIUSE_WARNING("New wiimote queue watermark %d", watermark);
|
||||
WARN_LOG(WIIMOTE, "New wiimote queue watermark %d", watermark);
|
||||
}
|
||||
|
||||
CFRunLoopStop(CFRunLoopGetCurrent());
|
||||
|
@ -123,7 +123,7 @@ volatile int reader, writer, outstanding, watermark;
|
|||
{
|
||||
// IOBluetoothDevice *device = [l2capChannel getDevice];
|
||||
|
||||
WIIUSE_WARNING("L2CAP channel was closed");
|
||||
WARN_LOG(WIIMOTE, "L2CAP channel was closed");
|
||||
|
||||
if (l2capChannel == cchan)
|
||||
cchan = nil;
|
||||
|
@ -161,7 +161,7 @@ int wiiuse_find(struct wiimote_t **wm, int max_wiimotes, int timeout)
|
|||
bth = [[IOBluetoothHostController alloc] init];
|
||||
if ([bth addressAsString] == nil)
|
||||
{
|
||||
WIIUSE_WARNING("No bluetooth host controller");
|
||||
WARN_LOG(WIIMOTE, "No bluetooth host controller");
|
||||
[bth release];
|
||||
return 0;
|
||||
}
|
||||
|
@ -181,14 +181,14 @@ int wiiuse_find(struct wiimote_t **wm, int max_wiimotes, int timeout)
|
|||
if (ret == kIOReturnSuccess)
|
||||
[bti retain];
|
||||
else
|
||||
WIIUSE_ERROR("Unable to do bluetooth discovery");
|
||||
ERROR_LOG(WIIMOTE, "Unable to do bluetooth discovery");
|
||||
|
||||
CFRunLoopRun();
|
||||
|
||||
[bti stop];
|
||||
found_devices = [[bti foundDevices] count];
|
||||
|
||||
WIIUSE_INFO("Found %i bluetooth device(s).", found_devices);
|
||||
NOTICE_LOG(WIIMOTE, "Found %i bluetooth device(s).", found_devices);
|
||||
|
||||
en = [[bti foundDevices] objectEnumerator];
|
||||
for (i = 0; i < found_devices; i++) {
|
||||
|
@ -258,11 +258,11 @@ static int wiiuse_connect_single(struct wiimote_t *wm, char *address)
|
|||
[btd openL2CAPChannelSync: &ichan
|
||||
withPSM: kBluetoothL2CAPPSMHIDInterrupt delegate: cbt];
|
||||
if (ichan == NULL || cchan == NULL) {
|
||||
WIIUSE_ERROR("Unable to open L2CAP channels");
|
||||
ERROR_LOG(WIIMOTE, "Unable to open L2CAP channels");
|
||||
wiiuse_disconnect(wm);
|
||||
}
|
||||
|
||||
WIIUSE_INFO("Connected to wiimote [id %i].", wm->unid);
|
||||
NOTICE_LOG(WIIMOTE, "Connected to wiimote [id %i].", wm->unid);
|
||||
|
||||
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_CONNECTED);
|
||||
wiiuse_set_report_type(wm);
|
||||
|
@ -289,7 +289,7 @@ void wiiuse_disconnect(struct wiimote_t *wm)
|
|||
if (wm == NULL)
|
||||
return;
|
||||
|
||||
WIIUSE_INFO("Disconnecting wiimote [id %i]", wm->unid);
|
||||
NOTICE_LOG(WIIMOTE, "Disconnecting wiimote [id %i]", wm->unid);
|
||||
|
||||
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_CONNECTED);
|
||||
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_HANDSHAKE);
|
|
@ -37,13 +37,57 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <hidsdi.h>
|
||||
#include <dbt.h>
|
||||
#include <setupapi.h>
|
||||
|
||||
#include "definitions.h"
|
||||
#include "wiiuse_internal.h"
|
||||
|
||||
#include <Common.h>
|
||||
|
||||
typedef struct _HIDD_ATTRIBUTES {
|
||||
ULONG Size;
|
||||
USHORT VendorID;
|
||||
USHORT ProductID;
|
||||
USHORT VersionNumber;
|
||||
} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;
|
||||
|
||||
typedef VOID (__stdcall *PHidD_GetHidGuid)(LPGUID);
|
||||
typedef BOOLEAN (__stdcall *PHidD_GetAttributes)(HANDLE, PHIDD_ATTRIBUTES);
|
||||
typedef BOOLEAN (__stdcall *PHidD_SetOutputReport)(HANDLE, PVOID, ULONG);
|
||||
|
||||
PHidD_GetHidGuid HidD_GetHidGuid = NULL;
|
||||
PHidD_GetAttributes HidD_GetAttributes = NULL;
|
||||
PHidD_SetOutputReport HidD_SetOutputReport = NULL;
|
||||
|
||||
HINSTANCE hid_lib = NULL;
|
||||
|
||||
static int initialized = 0;
|
||||
|
||||
inline void init_lib()
|
||||
{
|
||||
if (!initialized)
|
||||
{
|
||||
hid_lib = LoadLibrary(L"hid.dll");
|
||||
if (!hid_lib)
|
||||
{
|
||||
PanicAlert("Failed to load hid.dll");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
HidD_GetHidGuid = (PHidD_GetHidGuid)GetProcAddress(hid_lib, "HidD_GetHidGuid");
|
||||
HidD_GetAttributes = (PHidD_GetAttributes)GetProcAddress(hid_lib, "HidD_GetAttributes");
|
||||
HidD_SetOutputReport = (PHidD_SetOutputReport)GetProcAddress(hid_lib, "HidD_SetOutputReport");
|
||||
if (!HidD_GetHidGuid || !HidD_GetAttributes || !HidD_SetOutputReport)
|
||||
{
|
||||
PanicAlert("Failed to load hid.dll");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
int wiiuse_remove(struct wiimote_t** wm, int wiimotes, int max_wiimotes);
|
||||
|
||||
int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int wiimotes) {
|
||||
|
@ -56,6 +100,7 @@ int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int wiimotes) {
|
|||
PSP_DEVICE_INTERFACE_DETAIL_DATA detail_data = NULL;
|
||||
HIDD_ATTRIBUTES attr;
|
||||
|
||||
init_lib();
|
||||
|
||||
// todo: handle/remove (unexpected and forced) disconnected wiimotes here
|
||||
|
||||
|
@ -85,7 +130,7 @@ int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int wiimotes) {
|
|||
|
||||
// get the size of the data block required
|
||||
i = SetupDiGetDeviceInterfaceDetail(device_info, &device_data, NULL, 0, &len, NULL);
|
||||
detail_data = malloc(len);
|
||||
detail_data = (PSP_DEVICE_INTERFACE_DETAIL_DATA)malloc(len);
|
||||
detail_data->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
|
||||
|
||||
// query the data for this device
|
||||
|
@ -143,7 +188,7 @@ int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int wiimotes) {
|
|||
}
|
||||
|
||||
memcpy(wm[wiimotes]->devicepath,detail_data->DevicePath,197);
|
||||
WIIUSE_INFO("Connected to wiimote [id %i].", wm[wiimotes]->unid);
|
||||
NOTICE_LOG(WIIMOTE, "Connected to wiimote [id %i].", wm[wiimotes]->unid);
|
||||
++wiimotes;
|
||||
|
||||
} else {
|
||||
|
@ -160,9 +205,14 @@ int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int wiimotes) {
|
|||
return wiimotes;
|
||||
}
|
||||
|
||||
int wiiuse_connect(struct wiimote_t** wm, int wiimotes) {
|
||||
int i,connected=0;
|
||||
for (i = 0; i < wiimotes; ++i) {
|
||||
int wiiuse_connect(struct wiimote_t** wm, int wiimotes)
|
||||
{
|
||||
int i, connected = 0;
|
||||
|
||||
init_lib();
|
||||
|
||||
for (i = 0; i < wiimotes; ++i)
|
||||
{
|
||||
if (WIIMOTE_IS_SET(wm[i], WIIMOTE_STATE_CONNECTED))
|
||||
++connected;
|
||||
}
|
||||
|
@ -170,7 +220,10 @@ int wiiuse_connect(struct wiimote_t** wm, int wiimotes) {
|
|||
return connected;
|
||||
}
|
||||
|
||||
void wiiuse_disconnect(struct wiimote_t* wm) {
|
||||
void wiiuse_disconnect(struct wiimote_t* wm)
|
||||
{
|
||||
init_lib();
|
||||
|
||||
if (!wm || WIIMOTE_IS_CONNECTED(wm))
|
||||
return;
|
||||
|
||||
|
@ -185,9 +238,12 @@ void wiiuse_disconnect(struct wiimote_t* wm) {
|
|||
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_HANDSHAKE);
|
||||
}
|
||||
|
||||
int wiiuse_io_read(struct wiimote_t* wm) {
|
||||
int wiiuse_io_read(struct wiimote_t* wm)
|
||||
{
|
||||
DWORD b, r;
|
||||
|
||||
init_lib();
|
||||
|
||||
if (!wm || !WIIMOTE_IS_CONNECTED(wm))
|
||||
return 0;
|
||||
|
||||
|
@ -207,13 +263,13 @@ int wiiuse_io_read(struct wiimote_t* wm) {
|
|||
/* timeout - cancel and continue */
|
||||
|
||||
if (*wm->event_buf)
|
||||
WIIUSE_WARNING("Packet ignored. This may indicate a problem (timeout is %i ms).", wm->timeout);
|
||||
WARN_LOG(WIIMOTE, "Packet ignored. This may indicate a problem (timeout is %i ms).", wm->timeout);
|
||||
|
||||
CancelIo(wm->dev_handle);
|
||||
ResetEvent(wm->hid_overlap.hEvent);
|
||||
return 0;
|
||||
} else if (r == WAIT_FAILED) {
|
||||
WIIUSE_WARNING("A wait error occured on reading from wiimote %i.", wm->unid);
|
||||
WARN_LOG(WIIMOTE, "A wait error occured on reading from wiimote %i.", wm->unid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -230,10 +286,13 @@ int wiiuse_io_read(struct wiimote_t* wm) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len) {
|
||||
int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len)
|
||||
{
|
||||
DWORD bytes, dw;
|
||||
int i;
|
||||
|
||||
init_lib();
|
||||
|
||||
if (!wm || !WIIMOTE_IS_CONNECTED(wm))
|
||||
return 0;
|
||||
|
||||
|
@ -257,20 +316,20 @@ int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len) {
|
|||
//995 = The I/O operation has been aborted because of either a thread exit or an application request.
|
||||
|
||||
if ( (dw == 121) || (dw == 995) ) {
|
||||
WIIUSE_INFO("wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: WIIUSE_UNEXPECTED_DISCONNECT");
|
||||
NOTICE_LOG(WIIMOTE, "wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: WIIUSE_UNEXPECTED_DISCONNECT");
|
||||
wiiuse_disconnected(wm);
|
||||
wm->event = WIIUSE_UNEXPECTED_DISCONNECT;
|
||||
}
|
||||
else WIIUSE_ERROR("wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: WIIUSE_UNEXPECTED_DISCONNECT ERROR: %08x", dw);
|
||||
else ERROR_LOG(WIIMOTE, "wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: WIIUSE_UNEXPECTED_DISCONNECT ERROR: %08x", dw);
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
//If the part below causes trouble on WIDCOMM/TOSHIBA stack uncomment the lines above, and comment out the 3 lines below instead.
|
||||
|
||||
WIIUSE_INFO("wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: WIIUSE_UNEXPECTED_DISCONNECT - time out");
|
||||
NOTICE_LOG(WIIMOTE, "wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: WIIUSE_UNEXPECTED_DISCONNECT - time out");
|
||||
wiiuse_disconnected(wm);
|
||||
wm->event = WIIUSE_UNEXPECTED_DISCONNECT;
|
||||
|
||||
//WIIUSE_ERROR("wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: Unable to determine bluetooth stack type || Wiimote timed out.");
|
||||
//ERROR_LOG(WIIMOTE, "wiiuse_io_write[WIIUSE_STACK_UNKNOWN]: Unable to determine bluetooth stack type || Wiimote timed out.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -279,12 +338,12 @@ int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len) {
|
|||
dw = GetLastError();
|
||||
|
||||
if (dw == 121) { // semaphore timeout
|
||||
WIIUSE_INFO("wiiuse_io_write[WIIUSE_STACK_MS]: WIIUSE_UNEXPECTED_DISCONNECT");
|
||||
NOTICE_LOG(WIIMOTE, "wiiuse_io_write[WIIUSE_STACK_MS]: WIIUSE_UNEXPECTED_DISCONNECT");
|
||||
wiiuse_disconnected(wm);
|
||||
wm->event = WIIUSE_UNEXPECTED_DISCONNECT;
|
||||
return 0;
|
||||
}/* else if (dw)
|
||||
WIIUSE_ERROR("wiiuse_io_write[WIIUSE_STACK_MS]: WIIUSE_UNEXPECTED_DISCONNECT ERROR: %08x", dw);
|
||||
ERROR_LOG(WIIMOTE, "wiiuse_io_write[WIIUSE_STACK_MS]: WIIUSE_UNEXPECTED_DISCONNECT ERROR: %08x", dw);
|
||||
*/
|
||||
// it is not important to catch all errors here at this place, rest will be covered by io_reads.
|
||||
return i;
|
||||
|
@ -298,58 +357,67 @@ int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len) {
|
|||
|
||||
//Checks if the corresponding device to a system notification is a wiimote
|
||||
//I placed the code here to avoid ddk/wdk dependencies @wiimote plugin
|
||||
int wiiuse_check_system_notification(unsigned int nMsg, WPARAM wParam, LPARAM lParam) {
|
||||
PDEV_BROADCAST_HDR pDevice = (PDEV_BROADCAST_HDR)lParam;
|
||||
int wiiuse_check_system_notification(unsigned int nMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
PDEV_BROADCAST_HDR pDevice = (PDEV_BROADCAST_HDR)lParam;
|
||||
|
||||
switch( pDevice->dbch_devicetype ) {
|
||||
init_lib();
|
||||
|
||||
case DBT_DEVTYP_DEVICEINTERFACE:
|
||||
switch(pDevice->dbch_devicetype)
|
||||
{
|
||||
case DBT_DEVTYP_DEVICEINTERFACE:
|
||||
{
|
||||
PDEV_BROADCAST_DEVICEINTERFACE pDeviceInfo = (PDEV_BROADCAST_DEVICEINTERFACE)pDevice;
|
||||
HIDD_ATTRIBUTES attr;
|
||||
char stringbuf[255];
|
||||
|
||||
HANDLE dev = CreateFile(pDeviceInfo->dbcc_name,
|
||||
0,(FILE_SHARE_READ | FILE_SHARE_WRITE),
|
||||
NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
|
||||
|
||||
if (dev != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
PDEV_BROADCAST_DEVICEINTERFACE pDeviceInfo = (PDEV_BROADCAST_DEVICEINTERFACE)pDevice;
|
||||
HIDD_ATTRIBUTES attr;
|
||||
char stringbuf[255];
|
||||
|
||||
HANDLE dev = CreateFile(pDeviceInfo->dbcc_name,
|
||||
0,(FILE_SHARE_READ | FILE_SHARE_WRITE),
|
||||
NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
|
||||
|
||||
if (dev != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
attr.Size = sizeof(attr);
|
||||
HidD_GetAttributes(dev, &attr);
|
||||
|
||||
//Checking PID&VID
|
||||
if ((attr.VendorID == WM_VENDOR_ID) && (attr.ProductID == WM_PRODUCT_ID)) {
|
||||
CloseHandle(dev);
|
||||
return 1;
|
||||
}
|
||||
attr.Size = sizeof(attr);
|
||||
HidD_GetAttributes(dev, &attr);
|
||||
|
||||
//Checking PID&VID
|
||||
if ((attr.VendorID == WM_VENDOR_ID) && (attr.ProductID == WM_PRODUCT_ID)) {
|
||||
CloseHandle(dev);
|
||||
}
|
||||
else { //different method to acquire the "wiimote vid/pid" for a comparison when the device is already unavailable @CreateFile()
|
||||
|
||||
wcstombs(stringbuf, pDeviceInfo->dbcc_name, 255);
|
||||
//ms bt stack + bluesoleil vid/pid dbccname format
|
||||
if ( (strstr(stringbuf, "VID&0002057e_PID&0306") != NULL) || (strstr(stringbuf, "VID_057e&PID_0306") != NULL) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
CloseHandle(dev);
|
||||
}
|
||||
else
|
||||
{
|
||||
// different method to acquire the "wiimote vid/pid" for a
|
||||
// comparison when the device is already unavailable @CreateFile()
|
||||
wcstombs(stringbuf, pDeviceInfo->dbcc_name, 255);
|
||||
//ms bt stack + bluesoleil vid/pid dbccname format
|
||||
if ( (strstr(stringbuf, "VID&0002057e_PID&0306") != NULL) ||
|
||||
(strstr(stringbuf, "VID_057e&PID_0306") != NULL) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
default:
|
||||
return 0;
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//register a handle for device notifications
|
||||
int wiiuse_register_system_notification(HWND hwnd) {
|
||||
int wiiuse_register_system_notification(HWND hwnd)
|
||||
{
|
||||
DEV_BROADCAST_DEVICEINTERFACE Filter;
|
||||
ZeroMemory( &Filter, sizeof(Filter) );
|
||||
ZeroMemory(&Filter, sizeof(Filter));
|
||||
|
||||
init_lib();
|
||||
|
||||
//GUID wiimoteguid;
|
||||
//CLSIDFromString(_T("745a17a0-74d3-11d0-b6fe-00a0c90f57da"),&wiimoteguid);
|
||||
|
@ -357,12 +425,13 @@ int wiiuse_register_system_notification(HWND hwnd) {
|
|||
Filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
|
||||
//Filter.dbcc_classguid = wiimoteguid;
|
||||
|
||||
return RegisterDeviceNotification(hwnd,&Filter, DEVICE_NOTIFY_ALL_INTERFACE_CLASSES);
|
||||
return (int)RegisterDeviceNotification(hwnd, &Filter, DEVICE_NOTIFY_ALL_INTERFACE_CLASSES);
|
||||
}
|
||||
|
||||
int wiiuse_remove(struct wiimote_t** wm, int wiimotes, int max_wiimotes) {
|
||||
int wiiuse_remove(struct wiimote_t** wm, int wiimotes, int max_wiimotes)
|
||||
{
|
||||
int i = 0;
|
||||
WIIUSE_INFO("Remove Wiimotes, WM: %i MAX_WM: %i",wiimotes, max_wiimotes);
|
||||
NOTICE_LOG(WIIMOTE, "Remove Wiimotes, WM: %i MAX_WM: %i",wiimotes, max_wiimotes);
|
||||
|
||||
//No cleanup needed, less wiimotes available than needed
|
||||
if (wiimotes <= max_wiimotes)
|
|
@ -131,5 +131,5 @@ void wiiuse_set_ir_sensitivity(struct wiimote_t* wm, int level) {
|
|||
wiiuse_write_data(wm, WM_REG_IR_BLOCK1, (byte*)block1, 9);
|
||||
wiiuse_write_data(wm, WM_REG_IR_BLOCK2, (byte*)block2, 2);
|
||||
|
||||
WIIUSE_DEBUG("Set IR sensitivity to level %i (unid %i)", level, wm->unid);
|
||||
DEBUG_LOG(WIIMOTE, "Set IR sensitivity to level %i (unid %i)", level, wm->unid);
|
||||
}
|
|
@ -68,7 +68,7 @@ void wiiuse_cleanup(struct wiimote_t** wm, int wiimotes) {
|
|||
if (!wm)
|
||||
return;
|
||||
|
||||
WIIUSE_INFO("wiiuse clean up...");
|
||||
NOTICE_LOG(WIIMOTE, "wiiuse clean up...");
|
||||
|
||||
for (; i < wiimotes; ++i) {
|
||||
wiiuse_disconnect(wm[i]);
|
||||
|
@ -150,7 +150,7 @@ struct wiimote_t** wiiuse_init(int wiimotes) {
|
|||
void wiiuse_disconnected(struct wiimote_t* wm) {
|
||||
if (!wm) return;
|
||||
|
||||
WIIUSE_INFO("Wiimote disconnected [id %i].", wm->unid);
|
||||
NOTICE_LOG(WIIMOTE, "Wiimote disconnected [id %i].", wm->unid);
|
||||
|
||||
/* disable the connected flag */
|
||||
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_CONNECTED);
|
||||
|
@ -188,11 +188,11 @@ void wiiuse_rumble(struct wiimote_t* wm, int status) {
|
|||
buf = wm->leds;
|
||||
|
||||
if (status) {
|
||||
WIIUSE_DEBUG("Starting rumble...");
|
||||
DEBUG_LOG(WIIMOTE, "Starting rumble...");
|
||||
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_RUMBLE);
|
||||
buf |= 0x01;
|
||||
} else {
|
||||
WIIUSE_DEBUG("Stopping rumble...");
|
||||
DEBUG_LOG(WIIMOTE, "Stopping rumble...");
|
||||
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_RUMBLE);
|
||||
}
|
||||
|
||||
|
@ -261,7 +261,7 @@ int wiiuse_set_report_type(struct wiimote_t* wm) {
|
|||
buf[1] = 0x30;
|
||||
|
||||
|
||||
WIIUSE_DEBUG("Setting report type: 0x%x", buf[1]);
|
||||
DEBUG_LOG(WIIMOTE, "Setting report type: 0x%x", buf[1]);
|
||||
|
||||
expansion = wiiuse_send(wm, WM_CMD_REPORT_TYPE, buf, 2);
|
||||
if (expansion <= 0)
|
||||
|
@ -288,7 +288,7 @@ int wiiuse_write_data(struct wiimote_t* wm, unsigned int addr, byte* data, byte
|
|||
if (!data || !len)
|
||||
return 0;
|
||||
|
||||
WIIUSE_DEBUG("Writing %i bytes to memory location 0x%x...", len, addr);
|
||||
DEBUG_LOG(WIIMOTE, "Writing %i bytes to memory location 0x%x...", len, addr);
|
||||
|
||||
#ifdef WITH_WIIUSE_DEBUG
|
||||
{
|
|
@ -185,63 +185,37 @@ typedef struct wiimote_t {
|
|||
*
|
||||
*****************************************/
|
||||
|
||||
#define WIIUSE_COMPILE_LIB
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIIUSE_EXPORT_DECL __declspec(dllexport)
|
||||
#define WIIUSE_IMPORT_DECL __declspec(dllimport)
|
||||
#else
|
||||
#define WIIUSE_EXPORT_DECL
|
||||
#define WIIUSE_IMPORT_DECL
|
||||
#endif
|
||||
|
||||
#ifdef WIIUSE_COMPILE_LIB
|
||||
#define WIIUSE_EXPORT WIIUSE_EXPORT_DECL
|
||||
#else
|
||||
#define WIIUSE_EXPORT WIIUSE_IMPORT_DECL
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* wiiuse.c */
|
||||
WIIUSE_EXPORT extern const char* wiiuse_version();
|
||||
extern const char* wiiuse_version();
|
||||
|
||||
WIIUSE_EXPORT extern struct wiimote_t** wiiuse_init(int wiimotes);
|
||||
WIIUSE_EXPORT extern void wiiuse_disconnected(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_cleanup(struct wiimote_t** wm, int wiimotes);
|
||||
WIIUSE_EXPORT extern void wiiuse_rumble(struct wiimote_t* wm, int status);
|
||||
WIIUSE_EXPORT extern void wiiuse_set_leds(struct wiimote_t* wm, int leds);
|
||||
WIIUSE_EXPORT extern int wiiuse_write_data(struct wiimote_t* wm, unsigned int addr, byte* data, byte len);
|
||||
extern struct wiimote_t** wiiuse_init(int wiimotes);
|
||||
extern void wiiuse_disconnected(struct wiimote_t* wm);
|
||||
extern void wiiuse_cleanup(struct wiimote_t** wm, int wiimotes);
|
||||
extern void wiiuse_rumble(struct wiimote_t* wm, int status);
|
||||
extern void wiiuse_set_leds(struct wiimote_t* wm, int leds);
|
||||
extern int wiiuse_write_data(struct wiimote_t* wm, unsigned int addr, byte* data, byte len);
|
||||
|
||||
/* connect.c / io_win.c */
|
||||
#ifdef _WIN32
|
||||
WIIUSE_EXPORT extern int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int wiimotes);
|
||||
extern int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int wiimotes);
|
||||
#else
|
||||
WIIUSE_EXPORT extern int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int timeout);
|
||||
extern int wiiuse_find(struct wiimote_t** wm, int max_wiimotes, int timeout);
|
||||
#endif
|
||||
WIIUSE_EXPORT extern int wiiuse_connect(struct wiimote_t** wm, int wiimotes);
|
||||
WIIUSE_EXPORT extern void wiiuse_disconnect(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern void wiiuse_set_timeout(struct wiimote_t** wm, int wiimotes, byte timeout);
|
||||
extern int wiiuse_connect(struct wiimote_t** wm, int wiimotes);
|
||||
extern void wiiuse_disconnect(struct wiimote_t* wm);
|
||||
extern void wiiuse_set_timeout(struct wiimote_t** wm, int wiimotes, byte timeout);
|
||||
|
||||
#ifdef _WIN32
|
||||
WIIUSE_EXPORT extern int wiiuse_check_system_notification(unsigned int nMsg, WPARAM wParam, LPARAM lParam);
|
||||
WIIUSE_EXPORT extern int wiiuse_register_system_notification(HWND hwnd);
|
||||
extern int wiiuse_check_system_notification(unsigned int nMsg, WPARAM wParam, LPARAM lParam);
|
||||
extern int wiiuse_register_system_notification(HWND hwnd);
|
||||
#endif
|
||||
|
||||
/* ir.c */
|
||||
WIIUSE_EXPORT extern void wiiuse_set_ir_sensitivity(struct wiimote_t* wm, int level);
|
||||
extern void wiiuse_set_ir_sensitivity(struct wiimote_t* wm, int level);
|
||||
|
||||
/* io.c */
|
||||
WIIUSE_EXPORT extern int wiiuse_io_read(struct wiimote_t* wm);
|
||||
WIIUSE_EXPORT extern int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int wiiuse_io_read(struct wiimote_t* wm);
|
||||
extern int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len);
|
||||
|
||||
#endif /* WIIUSE_H_INCLUDED */
|
||||
|
|
@ -156,16 +156,8 @@
|
|||
|
||||
#include "wiiuse.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* not part of the api */
|
||||
int wiiuse_set_report_type(struct wiimote_t* wm);
|
||||
int wiiuse_send(struct wiimote_t* wm, byte report_type, byte* msg, int len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* WIIUSE_INTERNAL_H_INCLUDED */
|
|
@ -43,7 +43,8 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\Source\Core\Common\Src"
|
||||
AdditionalIncludeDirectories="..\Common\Src"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
|
@ -61,9 +62,9 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="hid.lib setupapi.lib Common.lib"
|
||||
OutputFile="$(PlatformName)\$(ProjectName)d.lib"
|
||||
AdditionalLibraryDirectories=""..\..\Source\Core\Common\$(OutDir)""
|
||||
AdditionalDependencies="setupapi.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName).lib"
|
||||
AdditionalLibraryDirectories=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
|
@ -107,7 +108,8 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\Source\Core\Common\Src"
|
||||
AdditionalIncludeDirectories="..\Common\Src"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
|
@ -125,9 +127,9 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="hid.lib setupapi.lib Common.lib"
|
||||
OutputFile="$(PlatformName)\$(ProjectName)d.lib"
|
||||
AdditionalLibraryDirectories=""..\..\Source\Core\Common\$(OutDir)""
|
||||
AdditionalDependencies="setupapi.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName).lib"
|
||||
AdditionalLibraryDirectories=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
|
@ -172,7 +174,8 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="..\..\Source\Core\Common\Src"
|
||||
AdditionalIncludeDirectories="..\Common\Src"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
WarningLevel="3"
|
||||
|
@ -189,9 +192,9 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="hid.lib setupapi.lib Common.lib"
|
||||
OutputFile="$(PlatformName)\$(ProjectName).lib"
|
||||
AdditionalLibraryDirectories=""..\..\Source\Core\Common\$(PlatformName)\Release""
|
||||
AdditionalDependencies="setupapi.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName).lib"
|
||||
AdditionalLibraryDirectories=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
|
@ -237,7 +240,8 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
AdditionalIncludeDirectories="..\..\Source\Core\Common\Src"
|
||||
AdditionalIncludeDirectories="..\Common\Src"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
WarningLevel="3"
|
||||
|
@ -254,9 +258,9 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalDependencies="Ws2_32.lib hid.lib setupapi.lib Common.lib"
|
||||
OutputFile="$(PlatformName)\$(ProjectName).lib"
|
||||
AdditionalLibraryDirectories=""..\..\Source\Core\Common\$(PlatformName)\Release""
|
||||
AdditionalDependencies="setupapi.lib"
|
||||
OutputFile="$(OutDir)\$(ProjectName).lib"
|
||||
AdditionalLibraryDirectories=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
|
@ -366,7 +370,7 @@
|
|||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\io_win.c"
|
||||
RelativePath=".\Src\io_win.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
|
@ -374,7 +378,7 @@
|
|||
Name="Wiimote Data"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Src\ir.c"
|
||||
RelativePath=".\Src\ir.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
|
@ -383,7 +387,7 @@
|
|||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Src\wiiuse.c"
|
||||
RelativePath=".\Src\wiiuse.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
|
@ -4,6 +4,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "Core\Core\Core.vcpr
|
|||
ProjectSection(ProjectDependencies) = postProject
|
||||
{C7E5D50A-2916-464B-86A7-E10B3CC88ADA} = {C7E5D50A-2916-464B-86A7-E10B3CC88ADA}
|
||||
{DA4CA030-A741-4DDC-9DA8-B2F351F0F158} = {DA4CA030-A741-4DDC-9DA8-B2F351F0F158}
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8} = {52F70249-373A-4401-A70A-FF22760EC1B8}
|
||||
{33546D62-7F34-4EA6-A88E-D538B36E16BF} = {33546D62-7F34-4EA6-A88E-D538B36E16BF}
|
||||
{3E03C179-8251-46E4-81F4-466F114BAC63} = {3E03C179-8251-46E4-81F4-466F114BAC63}
|
||||
{823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4}
|
||||
|
@ -259,6 +260,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_VideoMerge", "Plugin
|
|||
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wiiuse", "Core\wiiuse\wiiuse.vcproj", "{52F70249-373A-4401-A70A-FF22760EC1B8}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
|
@ -383,8 +389,8 @@ Global
|
|||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.Debug|x64.Build.0 = Debug|x64
|
||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.DebugFast|Win32.ActiveCfg = DebugFast|Win32
|
||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.DebugFast|Win32.Build.0 = DebugFast|Win32
|
||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.DebugFast|x64.ActiveCfg = DebugFast|x64
|
||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.DebugFast|x64.Build.0 = DebugFast|x64
|
||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.DebugFast|x64.ActiveCfg = Release|x64
|
||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.DebugFast|x64.Build.0 = Release|x64
|
||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.Release|Win32.Build.0 = Release|Win32
|
||||
{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}.Release|x64.ActiveCfg = Release|x64
|
||||
|
@ -647,6 +653,18 @@ Global
|
|||
{CA7F67A1-7DD9-4C49-94B8-F62AF3D4C72E}.DebugFast|x64.ActiveCfg = Debug|x64
|
||||
{CA7F67A1-7DD9-4C49-94B8-F62AF3D4C72E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CA7F67A1-7DD9-4C49-94B8-F62AF3D4C72E}.Release|x64.ActiveCfg = Release|x64
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.Debug|x64.Build.0 = Debug|x64
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.DebugFast|Win32.ActiveCfg = Release|Win32
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.DebugFast|Win32.Build.0 = Release|Win32
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.DebugFast|x64.ActiveCfg = Release|x64
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.DebugFast|x64.Build.0 = Release|x64
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.Release|Win32.Build.0 = Release|Win32
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.Release|x64.ActiveCfg = Release|x64
|
||||
{52F70249-373A-4401-A70A-FF22760EC1B8}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
Loading…
Reference in New Issue