CPU::State FifoPlayer::AdvanceFrame() { if (m_CurrentFrame >= m_FrameRangeEnd) { if (!m_Loop) return CPU::State::PowerDown; // If there are zero frames in the range then sleep instead of busy spinning if (m_FrameRangeStart >= m_FrameRangeEnd) return CPU::State::Stepping; // When looping, reload the contents of all the BP/CP/CF registers. // This ensures that each time the first frame is played back, the state of the // GPU is the same for each playback loop. m_CurrentFrame = m_FrameRangeStart; LoadRegisters(); LoadTextureMemory(); FlushWGP(); } if (m_FrameWrittenCb) m_FrameWrittenCb(); if (m_EarlyMemoryUpdates && m_CurrentFrame == m_FrameRangeStart) WriteAllMemoryUpdates(); WriteFrame(m_File->GetFrame(m_CurrentFrame), m_FrameInfo[m_CurrentFrame]); ++m_CurrentFrame; return CPU::State::Running; }
OpenUtility::CTexture* OpenUtility::CTexture::LoadTextureFile(const char *file,unsigned long w,unsigned long h,bool nonPowerOf2) { CTextureLoader *texLoader; if ((texLoader=GetLoader(file))!=NULL) { unsigned char *data; EPicMode channel; if ((data=texLoader->Load(file,w,h,channel))!=NULL) { CTexture *texObj=LoadTextureMemory(data,w,h,channel,nonPowerOf2); texLoader->DestroyData(data); return(texObj); } } return(NULL); }
void FifoPlayer::LoadMemory() { UReg_MSR newMSR; newMSR.DR = 1; newMSR.IR = 1; MSR = newMSR.Hex; PowerPC::ppcState.spr[SPR_IBAT0U] = 0x80001fff; PowerPC::ppcState.spr[SPR_IBAT0L] = 0x00000002; PowerPC::ppcState.spr[SPR_DBAT0U] = 0x80001fff; PowerPC::ppcState.spr[SPR_DBAT0L] = 0x00000002; PowerPC::ppcState.spr[SPR_DBAT1U] = 0xc0001fff; PowerPC::ppcState.spr[SPR_DBAT1L] = 0x0000002a; PowerPC::DBATUpdated(); PowerPC::IBATUpdated(); SetupFifo(); LoadRegisters(); LoadTextureMemory(); FlushWGP(); }