some linux wiimote stuff

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1213 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee
2008-11-19 10:22:29 +00:00
parent 76ca6ac031
commit ec19b6b024
7 changed files with 72 additions and 821 deletions
+25
View File
@@ -0,0 +1,25 @@
# -*- python -*-
Import('env')
files = [
"classic.c",
"dynamics.c",
"events.c",
"io.c",
"io_nix.c",
"ir.c",
"nunchuk.c",
"guitar_hero_3.c",
"wiiuse.c",
]
env_wiiuse = env.Clone(
CCFLAGS = env.filterWarnings(env['CCFLAGS']),
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),
)
libs = [
'm', 'bluetooth',
]
env_wiiuse.SharedLibrary(env['plugin_dir']+"wiiuse", files, LIBS=libs)
+3 -1
View File
@@ -53,13 +53,15 @@ include_paths = [
'../../../Core/DebuggerWX/Src',
'../../../../Externals/Bochs_disasm',
'../../../../Externals/LZO',
'../../../../Externals/WiiUseSrc/Src',
'../../../Core/VideoCommon/Src',
]
dirs = [
'Source/Core/Common/Src',
'Externals/Bochs_disasm',
'Externals/LZO',
'Externals/WiiUseSrc/Src',
'Source/Core/Common/Src',
'Source/Core/Core/Src',
'Source/Core/DiscIO/Src',
'Source/Core/VideoCommon/Src',
@@ -135,7 +135,8 @@ void SendReportCoreAccelIr12(u16 _channelID) {
LOGV(WII_IPC_WIIMOTE, 2, " Offset: %08x", Offset);
// Debugging
/**/if(GetAsyncKeyState('V'))
#ifdef _WIN32
if(GetAsyncKeyState('V'))
{
wprintf("DataFrame: ");
for (int i = 0; i < Offset; i++)
@@ -145,7 +146,7 @@ void SendReportCoreAccelIr12(u16 _channelID) {
}
wprintf("\n");
}
#endif
g_WiimoteInitialize.pWiimoteInput(_channelID, DataFrame, Offset);
}
@@ -172,7 +173,8 @@ void SendReportCoreAccelExt16(u16 _channelID)
LOGV(WII_IPC_WIIMOTE, 2, " SendReportCoreAccelExt16()");
// Debugging
/**/if(GetAsyncKeyState('V'))
#ifdef _WIN32
if(GetAsyncKeyState('V'))
{
wprintf("DataFrame: ");
for (int i = 0; i < Offset; i++)
@@ -182,7 +184,7 @@ void SendReportCoreAccelExt16(u16 _channelID)
}
wprintf("\n");
}
#endif
g_WiimoteInitialize.pWiimoteInput(_channelID, DataFrame, Offset);
}
@@ -207,7 +209,8 @@ void SendReportCoreAccelIr10Ext(u16 _channelID)
LOGV(WII_IPC_WIIMOTE, 2, " SendReportCoreAccelIr10Ext()");
// Debugging
/**/if(GetAsyncKeyState('V'))
#ifdef _WIN32
if(GetAsyncKeyState('V'))
{
wprintf("DataFrame: ");
for (int i = 0; i < Offset; i++)
@@ -217,9 +220,9 @@ void SendReportCoreAccelIr10Ext(u16 _channelID)
}
wprintf("\n");
}
#endif
g_WiimoteInitialize.pWiimoteInput(_channelID, DataFrame, Offset);
}
} // end of namespace
} // end of namespace
@@ -212,6 +212,7 @@ std::vector<u8> yhist(15); // for the tilt function
void FillReportAcc(wm_accel& _acc)
{
#ifdef _WIN32
// -----------------------------
// Wiimote to Gamepad translations
// ----------
@@ -402,6 +403,9 @@ void FillReportAcc(wm_accel& _acc)
a, b, c, d,
X, Y, Z);
*/
#else
// TODO port to linux
#endif
}
//bool toggleWideScreen = false, toggleCursor = true;
@@ -581,6 +585,7 @@ void FillReportExtension(wm_extension& _ext)
#ifdef _WIN32
if(GetAsyncKeyState(VK_NUMPAD4))
_ext.jx = 0x20;
@@ -603,7 +608,9 @@ void FillReportExtension(wm_extension& _ext)
if(GetAsyncKeyState('C') && GetAsyncKeyState('Z'))
_ext.bt = 0x00;
#else
// TODO linux port
#endif
// Clear g_RegExtTmp by copying g_RegExtBlnk to g_RegExtTmp
memcpy(g_RegExtTmp, g_RegExtBlnk, sizeof(g_RegExt));
@@ -1,26 +1,35 @@
# -*- python -*-
Import('env')
import sys
name = "Plugin_Wiimote"
files = [
"Wiimote.cpp",
"Config.cpp",
"ConfigDlg.cpp",
"Console.cpp",
"DataReports.cpp",
"EmuDefinitions.cpp",
"EmuMain.cpp",
"Encryption.cpp",
"FillReport.cpp",
"main.cpp",
"wiimote_real.cpp",
]
padenv = env.Clone()
wiimoteenv = env.Clone()
if padenv['osx64']:
padenv.Append(
if wiimoteenv['osx64']:
wiimoteenv.Append(
CXXFLAGS = [ '-arch', 'x86_64' ],
LINKFLAGS = [ '-arch', 'x86_64' ],
LIBS = [ 'common' ],
)
else:
padenv.Append(
wiimoteenv.Append(
CXXFLAGS = [ '-fPIC' ],
LIBS = [ 'common' ],
)
padenv.SharedLibrary(env['plugin_dir']+name, files)
wiimoteenv.SharedLibrary(env['plugin_dir']+name, files)
File diff suppressed because it is too large Load Diff
@@ -20,8 +20,8 @@
#include "wiiuse.h"
#include <queue>
#include "common.h"
#include "thread.h"
#include "Common.h"
#include "Thread.h"
#include "wiimote_hid.h"
#include "EmuMain.h"
@@ -41,8 +41,11 @@ namespace WiiMoteReal
//******************************************************************************
class CWiiMote;
#ifdef _WIN32
DWORD WINAPI ReadWiimote_ThreadFunc(void* arg);
#else
void* ReadWiimote_ThreadFunc(void* arg);
#endif
//******************************************************************************
// Variable declarations
//******************************************************************************
@@ -267,7 +270,11 @@ namespace WiiMoteReal
}
}
#ifdef _WIN32
DWORD WINAPI ReadWiimote_ThreadFunc(void* arg)
#else
void *ReadWiimote_ThreadFunc(void* arg)
#endif
{
while (!g_Shutdown)
{