1. Fixed RTC in both Wii and GC (added Wii epoch bias, notify me if it isn't good for your PC and I'll revert it).

2. Added some Zelda UCode HLE Documentation and changed the way it handles mail, also fixed a bug there.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2155 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2009-02-08 19:17:51 +00:00
parent c3dbbb1f23
commit c8526c7be1
3 changed files with 32 additions and 7 deletions

View File

@ -278,7 +278,8 @@ void CEXIIPL::TransferByte(u8& _uByte)
u32 CEXIIPL::GetGCTime()
{
const u32 cJanuary2000 = 0x386D4380; // Seconds between 1.1.1970 and 1.1.2000
const u32 cJanuary2000 = 0x386D42C0; // Seconds between 1.1.1970 and 1.1.2000
const u32 cWiiBias = 0x0F111566; // Seconds between 1.1.2000 and 5.1.2008 (Wii epoch)
// (mb2): I think we can get rid of the IPL bias.
// I know, it's another hack so I let the previous code for a while.
@ -296,7 +297,10 @@ u32 CEXIIPL::GetGCTime()
return ((u32)ltime - cJanuary2000 - Bias);
#else
u64 ltime = Common::Timer::GetLocalTimeSinceJan1970();
return ((u32)ltime - cJanuary2000);
if (Core::GetStartupParameter().bWii)
return ((u32)ltime - cJanuary2000 - cWiiBias);
else
return ((u32)ltime - cJanuary2000);
#endif
}

View File

@ -231,7 +231,7 @@ void Init()
{
if (Core::GetStartupParameter().bWii)
{
CPU_CORE_CLOCK = 721000000;
CPU_CORE_CLOCK = 721000000u;
VI_PERIOD = GetTicksPerSecond() / (60*120);
SI_PERIOD = GetTicksPerSecond() / 60; // once a frame is good for controllers

View File

@ -57,11 +57,32 @@ void CUCode_Zelda::Update()
void CUCode_Zelda::HandleMail(u32 _uMail)
{
PanicAlert("Zelda mail 0x%08X, list in progress? %s", _uMail,
m_bListInProgress ? "Yes" : "No");
// SetupTable
// in WW we get SetDolbyDelay
// SyncFrame
// The last mails we get before the audio goes bye-bye
// 0, 0, 0
// 0x10000
// 0
// 0x20000
// 0
// 0x30000
// And then silence...
if (m_bListInProgress == false)
{
m_bListInProgress = true;
m_numSteps = _uMail;
m_step = 0;
if(_uMail == 0) {
g_dspInitialize.pGenerateDSPInterrupt();
} else if((_uMail >> 16) == 0) {
m_bListInProgress = true;
m_numSteps = _uMail;
m_step = 0;
} else {
// Release halt
m_rMailHandler.PushMail(DSP_RESUME);
g_dspInitialize.pGenerateDSPInterrupt();
}
}
else
{
@ -70,7 +91,7 @@ void CUCode_Zelda::HandleMail(u32 _uMail)
((u32*)m_Buffer)[m_step] = _uMail;
m_step++;
if (m_step == m_numSteps)
if (m_step >= m_numSteps)
{
ExecuteList();
m_bListInProgress = false;