mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 13:48:56 +00:00
dsphle - small regression fix
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5447 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
b9d5168388
commit
c1dde5bb1d
1 changed files with 15 additions and 13 deletions
|
@ -64,8 +64,10 @@ static void ProcessUpdates(AXPB &PB)
|
||||||
if (numupd > 64) numupd = 64; // prevent crazy values TODO: LOL WHAT
|
if (numupd > 64) numupd = 64; // prevent crazy values TODO: LOL WHAT
|
||||||
const u32 updaddr = (u32)(PB.updates.data_hi << 16) | PB.updates.data_lo;
|
const u32 updaddr = (u32)(PB.updates.data_hi << 16) | PB.updates.data_lo;
|
||||||
int on = 0, off = 0;
|
int on = 0, off = 0;
|
||||||
const u16 updpar = Memory_Read_U16(updaddr);
|
for (int j = 0; j < numupd; j++)
|
||||||
const u16 upddata = Memory_Read_U16(updaddr + 2);
|
{
|
||||||
|
const u16 updpar = Memory_Read_U16(updaddr + j*4);
|
||||||
|
const u16 upddata = Memory_Read_U16(updaddr + j*4 + 2);
|
||||||
// some safety checks, I hope it's enough
|
// some safety checks, I hope it's enough
|
||||||
if (updaddr > 0x80000000 && updaddr < 0x817fffff
|
if (updaddr > 0x80000000 && updaddr < 0x817fffff
|
||||||
&& updpar < 63 && updpar > 3 && upddata >= 0 // updpar > 3 because we don't want to change
|
&& updpar < 63 && updpar > 3 && upddata >= 0 // updpar > 3 because we don't want to change
|
||||||
|
@ -76,9 +78,9 @@ static void ProcessUpdates(AXPB &PB)
|
||||||
{
|
{
|
||||||
((u16*)&PB)[updpar] = upddata; // WTF ABOUNDS!
|
((u16*)&PB)[updpar] = upddata; // WTF ABOUNDS!
|
||||||
}
|
}
|
||||||
if (updpar == 7 && upddata == 1) on++;
|
if (updpar == 7 && upddata != 0) on++;
|
||||||
if (updpar == 7 && upddata == 1) off++;
|
if (updpar == 7 && upddata == 0) off++;
|
||||||
|
}
|
||||||
// hack: if we get both an on and an off select on rather than off
|
// hack: if we get both an on and an off select on rather than off
|
||||||
if (on > 0 && off > 0) PB.running = 1;
|
if (on > 0 && off > 0) PB.running = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue