My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions

Issue 1020 attachment: motionplus.patch (4.0 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Index: Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.cpp
===================================================================
--- Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.cpp (revision 4268)
+++ Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.cpp (working copy)
@@ -43,6 +43,7 @@

u8 g_Eeprom[WIIMOTE_EEPROM_SIZE];
u8 g_RegSpeaker[WIIMOTE_REG_SPEAKER_SIZE];
+u8 g_RegMotionPlus[WIIMOTE_REG_EXT_SIZE];
u8 g_RegExt[WIIMOTE_REG_EXT_SIZE];
u8 g_RegExtTmp[WIIMOTE_REG_EXT_SIZE];
u8 g_RegIr[WIIMOTE_REG_IR_SIZE];
Index: Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.h
===================================================================
--- Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.h (revision 4268)
+++ Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.h (working copy)
@@ -75,6 +75,7 @@

extern u8 g_Eeprom[WIIMOTE_EEPROM_SIZE];
extern u8 g_RegSpeaker[WIIMOTE_REG_SPEAKER_SIZE];
+extern u8 g_RegMotionPlus[WIIMOTE_REG_EXT_SIZE];
extern u8 g_RegExt[WIIMOTE_REG_EXT_SIZE];
extern u8 g_RegExtTmp[WIIMOTE_REG_EXT_SIZE];
extern u8 g_RegIr[WIIMOTE_REG_IR_SIZE];
Index: Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp
===================================================================
--- Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp (revision 4268)
+++ Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp (working copy)
@@ -247,6 +247,21 @@
INFO_LOG(CONSOLE, "Read RegExt: Size %i Address %08x Offset %08x\nData %s\n",
size, address, (address & 0xffff), Tmp.c_str());*/
break;
+ case 0xA6:
+ block = g_RegMotionPlus;
+ block[0xFC] = 0xA6;
+ block[0xFD] = 0x20;
+ block[0xFE] = 0x00;
+ block[0xFF] = 0x05;
+ blockSize = WIIMOTE_REG_EXT_SIZE;
+ INFO_LOG(WII_IPC_WIIMOTE, " Case 0xa6: MotionPlusReg [%x]", address);
+ /*
+ Tmp = ArrayToString(block, size, (address & 0xffff));
+ //LOGV(WII_IPC_WIIMOTE, 0, " Data: %s", Temp.c_str());
+ INFO_LOG(WII_IPC_WIIMOTE, "Read MotionPlusReg: Size %i Address %08x Offset %08x\nData %s\n",
+ size, address, (address & 0xffff), Tmp.c_str());
+ */
+ break;
case 0xB0:
block = g_RegIr;
blockSize = WIIMOTE_REG_IR_SIZE;
@@ -295,7 +310,7 @@

address &= 0xFFFF;
if(address + size > blockSize) {
- PanicAlert("WmReadData: address + size out of bounds!");
+ PanicAlert("WmReadData: address + size out of bounds! [%d %d %d]", address, size, blockSize);
return;
}

@@ -304,7 +319,7 @@
}
else
{
- PanicAlert("WmReadData: unimplemented parameters (size: %i, addr: 0x%x!", size, rd->space);
+ PanicAlert("WmReadData: unimplemented parameters (size: %i, addr: 0x%x)!", size, rd->space);
}

}
@@ -443,6 +458,15 @@
wd->size, address, (address & 0xffff));
INFO_LOG(CONSOLE, "Data: %s\n", Temp.c_str());*/
break;
+
+ case 0xA6:
+ block = g_RegMotionPlus; // Extension Controller register
+ blockSize = WIIMOTE_REG_EXT_SIZE;
+ INFO_LOG(WII_IPC_WIIMOTE, " Case 0xa6: MotionPlusReg [%x] Write ",address);
+ /*INFO_LOG(WII_IPC_WIIMOTE, "Write MotionPlusReg Size: %i Address: %08x Offset: %08x \n",
+ wd->size, address, (address & 0xffff));
+ INFO_LOG(WII_IPC_WIIMOTE, "Data: %s\n", Temp.c_str());*/
+ break;
case 0xB0:
block = g_RegIr;
blockSize = WIIMOTE_REG_IR_SIZE;
Index: Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp
===================================================================
--- Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp (revision 4268)
+++ Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp (working copy)
@@ -134,6 +134,7 @@

m_pCriticalSection->Leave();

+
// Read data from wiimote (but don't send it to the core, just filter and queue)
if (wiiuse_io_read(m_pWiiMote))
{
@@ -324,6 +325,9 @@
// Set flags
//wiiuse_set_flags(g_WiiMotesFromWiiUse[i], NULL, WIIUSE_SMOOTHING);
}
+
+ wiiuse_set_timeout(g_WiiMotesFromWiiUse, g_NumberOfWiiMotes, 220, 220);
+
// WiiUse initializes the Wiimotes in Windows right from the wiiuse_find function
// The Functionality should REALLY be changed
#ifndef _WIN32
Powered by Google Project Hosting