Warp back to 5578. Sorry for the lost changes, please re-apply. Reason: 5579 is a complete disaster.

Not only does it change tons of files to switch to a new and non-working (it doesn't parse my ini files, at least) ini parser, it also reshuffles a lot of code and removes a plugin. The latter part is fine, but doing these two major switches in one revision, one of which is broken, is completely unacceptable. I said to merge tiny changes, not massive reworkings.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5589 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2010-06-03 18:05:08 +00:00
parent 3236aa9e73
commit a3c96ac42c
118 changed files with 8868 additions and 2530 deletions

View File

@ -484,8 +484,26 @@ void Wiimote::Update()
}
// ----extension----
if (rpt.ext)
{
m_extension->GetState(data + rpt.ext, is_focus);
// i dont think anything accesses the extension data like this, but ill support it
// i think it should be unencrpyted in the register, encrypted when read
memcpy(m_reg_ext->controller_data, data + rpt.ext, sizeof(wm_extension));
// both of these ifs work
//if (0x55 != m_reg_ext->encryption)
if (0xAA == m_reg_ext->encryption)
wiimote_encrypt(&m_ext_key, data + rpt.ext, 0x00, sizeof(wm_extension));
}
// ----ir----
if (rpt.ir)
// only if camera is fully enabled.
// should send 0xFF if camera isn't enabled maybe,
// 0x00 is working fine though
if (rpt.ir && 0x08 == m_reg_ir->data[0x30])
{
float xx = 10000, yy = 0, zz = 0;
@ -508,21 +526,14 @@ void Wiimote::Update()
x[1] = (unsigned int)(xx + distance);
x[2] = (unsigned int)(xx - 1.2f * distance);
x[3] = (unsigned int)(xx + 1.2f * distance);
//0xFF report
if (rpt.ext)
memset(data + rpt.ir, 0xFF, (rpt.ext - rpt.ir));
else
memset(data + rpt.ir, 0xFF, (46 - rpt.ir));
//Fill report with valid data when full handshake was done
if (m_reg_ir->data[0x30] || m_reg_ir->data[0x33])
// ir mode
switch (m_reg_ir->mode)
{
// basic
case 1 :
{
memset(data + rpt.ir, 0xFF, 10);
wm_ir_basic* const irdata = (wm_ir_basic*)(data + rpt.ir);
if (y < 768)
{
@ -551,6 +562,7 @@ void Wiimote::Update()
// extended
case 3 :
{
memset(data + rpt.ir, 0xFF, 12);
wm_ir_extended* const irdata = (wm_ir_extended*)(data + rpt.ir);
if (y < 768)
{
@ -572,22 +584,10 @@ void Wiimote::Update()
case 5 :
// UNSUPPORTED
break;
}
}
// ----extension----
if (rpt.ext)
{
m_extension->GetState(data + rpt.ext, is_focus);
// i dont think anything accesses the extension data like this, but ill support it. Indeed, commercial games don't do this.
// i think it should be unencrpyted in the register, encrypted when read.
memcpy(m_reg_ext->controller_data, data + rpt.ext, sizeof(wm_extension));
if (0xAA == m_reg_ext->encryption) {
wiimote_encrypt(&m_ext_key, data + rpt.ext, 0x00, sizeof(wm_extension));
}
}
// send data report
g_WiimoteInitialize.pWiimoteInput( m_index, m_reporting_channel, data, rpt.size );
}