Merge branch 'master' into gdbstub

This commit is contained in:
Matthew Parlane
2013-01-08 20:27:34 +13:00
21 changed files with 290 additions and 651 deletions

View File

@ -117,8 +117,6 @@ struct Rectangle
Rectangle(T theLeft, T theTop, T theRight, T theBottom)
: left(theLeft), top(theTop), right(theRight), bottom(theBottom)
{ }
bool operator==(const Rectangle& r) { return left==r.left && top==r.top && right==r.right && bottom==r.bottom; }
T GetWidth() const { return abs(right - left); }
T GetHeight() const { return abs(bottom - top); }

View File

@ -105,6 +105,10 @@ void Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength)
{
((GCPad*)g_plugin.controllers[ _numPAD ])->SetOutput(255);
}
else
{
((GCPad*)g_plugin.controllers[ _numPAD ])->SetOutput(0);
}
}
}
@ -123,9 +127,9 @@ void Motor(u8 _numPAD, unsigned int _uType, unsigned int _uStrength)
{
// TODO: this has potential to not stop rumble if user is messing with GUI at the perfect time
// set rumble
if (_uType == 06)
if (_uType == 6)
{
((GCPad*)g_plugin.controllers[ _numPAD ])->SetOutput(_uStrength);
((GCPad*)g_plugin.controllers[ _numPAD ])->SetMotor(_uStrength);
}
}
}

View File

@ -130,13 +130,24 @@ void GCPad::GetInput(SPADStatus* const pad)
}
}
void GCPad::SetMotor(const u8 on)
{
float state = (float)on / 255;
float force = abs(state - 0.5) * 2;
if (state < 0.5)
force = -force;
// only rumble if window has focus or background input is enabled
if (Host_RendererHasFocus() || m_options[0].settings[0]->value)
m_rumble->controls[0]->control_ref->State(force);
else
m_rumble->controls[0]->control_ref->State(0);
}
void GCPad::SetOutput(const u8 on)
{
// only rumble if window has focus or background input is enabled
if (Host_RendererHasFocus() || m_options[0].settings[0]->value)
m_rumble->controls[0]->control_ref->State((float)on / 255);
else
m_rumble->controls[0]->control_ref->State(0);
m_rumble->controls[0]->control_ref->State(on && (Host_RendererHasFocus() || m_options[0].settings[0]->value));
}
void GCPad::LoadDefaults(const ControllerInterface& ciface)

View File

@ -29,6 +29,7 @@ public:
GCPad(const unsigned int index);
void GetInput(SPADStatus* const pad);
void SetOutput(const u8 on);
void SetMotor(const u8 on);
bool GetMicButton() const;

View File

@ -253,15 +253,15 @@ void DoState(PointerWrap &p)
u32 i;
for (i=0; i<IPC_MAX_FDS; i++)
{
u32 exists;
u32 exists = 0;
p.Do(exists);
if (exists)
{
u32 isHw;
u32 isHw = 0;
p.Do(isHw);
if (isHw)
{
u32 hwId;
u32 hwId = 0;
p.Do(hwId);
g_FdMap[i] = AccessDeviceByID(hwId);
}

View File

@ -246,17 +246,13 @@ bool CanSwapAdjacentOps(const CodeOp &a, const CodeOp &b)
return false;
}
// For now, only integer ops acceptable.
switch (b_info->type) {
case OPTYPE_INTEGER:
case OPTYPE_LOAD:
case OPTYPE_STORE:
//case OPTYPE_LOADFP:
//case OPTYPE_STOREFP:
break;
default:
// For now, only integer ops acceptable. Any instruction which can raise an
// interrupt is *not* a possible swap candidate: see [1] for an example of
// a crash caused by this error.
//
// [1] https://code.google.com/p/dolphin-emu/issues/detail?id=5864#c7
if (b_info->type != OPTYPE_INTEGER)
return false;
}
// Check that we have no register collisions.
// That is, check that none of b's outputs matches any of a's inputs,

View File

@ -0,0 +1,9 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Dolphin Emulator
Comment=A Wii/GameCube Emulator
Icon=dolphin-emu
Exec=dolphin-emu
Categories=Game;

View File

@ -535,11 +535,7 @@ ControlState Joystick::Hat::GetState() const
void Joystick::ForceConstant::SetState(const ControlState state)
{
float force = abs(state - 0.5) * 2;
if (state < 0.5)
force = -force;
const LONG new_val = LONG(10000 * force);
const LONG new_val = LONG(10000 * state);
LONG &val = params.lMagnitude;
if (val != new_val)

View File

@ -236,7 +236,7 @@ bool GetConfig(const int &type)
case CONFIG_DISABLEFOG:
return g_ActiveConfig.bDisableFog;
case CONFIG_SHOWEFBREGIONS:
return g_ActiveConfig.bShowEFBCopyRegions;
return false;
default:
PanicAlert("GetConfig Error: Unknown Config Type!");
return false;