1. Fixed the freeze issue in "Super Mario Galaxy" and other games, which was introduced since r4762

2. Fixed Issue 1909
   Multi-Nunchuck control problem

3. Updated SYSCONF, which should enable games that require MotionPlus, such as "Wii Sports Resort"

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4773 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx 2010-01-02 05:15:36 +00:00
parent e55c3793b6
commit 92ef4f1156
8 changed files with 13 additions and 13 deletions

Binary file not shown.

View File

@ -158,6 +158,7 @@ void Init()
memset(&fifo,0,sizeof(fifo)); memset(&fifo,0,sizeof(fifo));
fifo.CPCmdIdle = 1 ; fifo.CPCmdIdle = 1 ;
fifo.CPReadIdle = 1; fifo.CPReadIdle = 1;
fifo.bFF_Breakpoint = 1;
s_fifoIdleEvent.Init(); s_fifoIdleEvent.Init();
@ -564,7 +565,7 @@ bool AllowIdleSkipping()
// if not then lock CPUThread until GP finish a frame. // if not then lock CPUThread until GP finish a frame.
void WaitForFrameFinish() void WaitForFrameFinish()
{ {
while ((fake_GPWatchdogLastToken == fifo.Fake_GPWDToken) && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance && !fifo.bFF_Breakpoint) while ((fake_GPWatchdogLastToken == fifo.Fake_GPWDToken) && fifo.bFF_GPReadEnable && ((!fifo.bFF_BPEnable && fifo.CPReadWriteDistance) || (fifo.bFF_BPEnable && !fifo.bFF_Breakpoint)));
s_fifoIdleEvent.MsgWait(); s_fifoIdleEvent.MsgWait();
fake_GPWatchdogLastToken = fifo.Fake_GPWDToken; fake_GPWatchdogLastToken = fifo.Fake_GPWDToken;
@ -605,7 +606,7 @@ void STACKALIGN GatherPipeBursted()
// - CPU can write to fifo // - CPU can write to fifo
// - disable Underflow interrupt // - disable Underflow interrupt
INFO_LOG(COMMANDPROCESSOR, "(GatherPipeBursted): CPHiWatermark reached, 0x%04X, 0x%04X", fifo.CPReadWriteDistance, fifo.CPLoWatermark); INFO_LOG(COMMANDPROCESSOR, "(GatherPipeBursted): CPHiWatermark (Hi: 0x%04x, Lo: 0x%04x) reached (RWDistance: 0x%04x)", fifo.CPHiWatermark, fifo.CPLoWatermark, fifo.CPReadWriteDistance);
// Wait for GPU to catch up // Wait for GPU to catch up
while (fifo.CPReadWriteDistance > fifo.CPLoWatermark && !fifo.bFF_Breakpoint) while (fifo.CPReadWriteDistance > fifo.CPLoWatermark && !fifo.bFF_Breakpoint)
s_fifoIdleEvent.MsgWait(); s_fifoIdleEvent.MsgWait();

View File

@ -164,7 +164,6 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
CommandProcessor::UpdateInterruptsFromVideoPlugin(true); CommandProcessor::UpdateInterruptsFromVideoPlugin(true);
break; break;
} }
distToSend = 32; distToSend = 32;
if ( readPtr >= _fifo.CPEnd) if ( readPtr >= _fifo.CPEnd)
@ -201,9 +200,9 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
// leading the CPU thread to wait in Video_BeginField or Video_AccessEFB thus slowing things down. // leading the CPU thread to wait in Video_BeginField or Video_AccessEFB thus slowing things down.
VideoFifo_CheckEFBAccess(); VideoFifo_CheckEFBAccess();
VideoFifo_CheckSwapRequest(); VideoFifo_CheckSwapRequest();
}
CommandProcessor::SetFifoIdleFromVideoPlugin(); CommandProcessor::SetFifoIdleFromVideoPlugin();
}
Common::YieldCPU(); Common::YieldCPU();
} }
fifo_exit_event.Set(); fifo_exit_event.Set();

View File

@ -54,7 +54,7 @@ bool g_ReportingAuto[MAX_WIIMOTES]; // Auto report or passive report
u8 g_ReportingMode[MAX_WIIMOTES]; // The reporting mode and channel id u8 g_ReportingMode[MAX_WIIMOTES]; // The reporting mode and channel id
u16 g_ReportingChannel[MAX_WIIMOTES]; u16 g_ReportingChannel[MAX_WIIMOTES];
wiimote_key g_ExtKey; // The extension encryption key wiimote_key g_ExtKey[MAX_WIIMOTES]; // The extension encryption key
bool g_Encryption; // Encryption on or off bool g_Encryption; // Encryption on or off
// Gamepad input // Gamepad input

View File

@ -86,7 +86,7 @@ extern bool g_ReportingAuto[MAX_WIIMOTES];
extern u8 g_ReportingMode[MAX_WIIMOTES]; extern u8 g_ReportingMode[MAX_WIIMOTES];
extern u16 g_ReportingChannel[MAX_WIIMOTES]; extern u16 g_ReportingChannel[MAX_WIIMOTES];
extern wiimote_key g_ExtKey; // extension encryption key extern wiimote_key g_ExtKey[MAX_WIIMOTES]; // extension encryption key
extern bool g_Encryption; extern bool g_Encryption;
/* An example of a factory default first bytes of the Eeprom memory. There are differences between /* An example of a factory default first bytes of the Eeprom memory. There are differences between

View File

@ -481,7 +481,6 @@ void DoState(PointerWrap &p)
p.DoArray(g_RegExtTmp, WIIMOTE_REG_EXT_SIZE); p.DoArray(g_RegExtTmp, WIIMOTE_REG_EXT_SIZE);
p.DoArray(g_RegIr, WIIMOTE_REG_IR_SIZE); p.DoArray(g_RegIr, WIIMOTE_REG_IR_SIZE);
p.Do(g_ExtKey);
p.Do(g_Encryption); p.Do(g_Encryption);
//p.Do(NumPads); //p.Do(NumPads);
@ -500,6 +499,7 @@ void DoState(PointerWrap &p)
p.Do(g_ReportingChannel[i]); p.Do(g_ReportingChannel[i]);
//p.Do(g_IR[i]); //p.Do(g_IR[i]);
p.Do(g_Leds[i]); p.Do(g_Leds[i]);
p.Do(g_ExtKey[i]);
} }
return; return;
} }

View File

@ -267,7 +267,7 @@ void WmReadData(u16 _channelID, wm_read_data* rd)
memcpy(g_RegExtTmp, g_RegExt[g_ID], sizeof(g_RegExt[0])); memcpy(g_RegExtTmp, g_RegExt[g_ID], sizeof(g_RegExt[0]));
// Encrypt g_RegExtTmp at that location // Encrypt g_RegExtTmp at that location
wiimote_encrypt(&g_ExtKey, &g_RegExtTmp[address & 0xffff], (address & 0xffff), (u8)size); wiimote_encrypt(&g_ExtKey[g_ID], &g_RegExtTmp[address & 0xffff], (address & 0xffff), (u8)size);
// Update the block that SendReadDataReply will eventually send to the Wii // Update the block that SendReadDataReply will eventually send to the Wii
block = g_RegExtTmp; block = g_RegExtTmp;
@ -446,7 +446,7 @@ void WmWriteData(u16 _channelID, wm_write_data* wd)
that we send it parts of a key, only the last full key will have an that we send it parts of a key, only the last full key will have an
effect */ effect */
if(address >= 0x40 && address <= 0x4c) if(address >= 0x40 && address <= 0x4c)
wiimote_gen_key(&g_ExtKey, &g_RegExt[g_ID][0x40]); wiimote_gen_key(&g_ExtKey[g_ID], &g_RegExt[g_ID][0x40]);
} }
} }

View File

@ -815,7 +815,7 @@ void FillReportExtension(wm_extension& _ext)
// Copy the data to it // Copy the data to it
memcpy(Tmp, &_ext, sizeof(_ext)); memcpy(Tmp, &_ext, sizeof(_ext));
// Encrypt it // Encrypt it
wiimote_encrypt(&g_ExtKey, Tmp, 0x00, sizeof(_ext)); wiimote_encrypt(&g_ExtKey[g_ID], Tmp, 0x00, sizeof(_ext));
// Write it back to the struct // Write it back to the struct
memcpy(&_ext, Tmp, sizeof(_ext)); memcpy(&_ext, Tmp, sizeof(_ext));
} }
@ -1077,7 +1077,7 @@ void FillReportClassicExtension(wm_classic_extension& _ext)
// Copy the data to it // Copy the data to it
memcpy(Tmp, &_ext, sizeof(_ext)); memcpy(Tmp, &_ext, sizeof(_ext));
// Encrypt it // Encrypt it
wiimote_encrypt(&g_ExtKey, Tmp, 0x00, sizeof(_ext)); wiimote_encrypt(&g_ExtKey[g_ID], Tmp, 0x00, sizeof(_ext));
// Write it back to the struct // Write it back to the struct
memcpy(&_ext, Tmp, sizeof(_ext)); memcpy(&_ext, Tmp, sizeof(_ext));
} }
@ -1172,7 +1172,7 @@ void FillReportGuitarHero3Extension(wm_GH3_extension& _ext)
// Copy the data to it // Copy the data to it
memcpy(Tmp, &_ext, sizeof(_ext)); memcpy(Tmp, &_ext, sizeof(_ext));
// Encrypt it // Encrypt it
wiimote_encrypt(&g_ExtKey, Tmp, 0x00, sizeof(_ext)); wiimote_encrypt(&g_ExtKey[g_ID], Tmp, 0x00, sizeof(_ext));
// Write it back to the struct // Write it back to the struct
memcpy(&_ext, Tmp, sizeof(_ext)); memcpy(&_ext, Tmp, sizeof(_ext));
} }