vumanager.cpp

00001 /*
00002 * "PS2" Application Framework
00003 *
00004 * University of Abertay Dundee
00005 * May be used for educational purposed only
00006 *
00007 * Author - Dr Henry S Fortuna
00008 *
00009 * $Revision: 1.2 $
00010 * $Date: 2007/08/19 12:45:13 $
00011 *
00012 */
00013 
00014 #include "vumanager.h"
00015 
00016 CVU1MicroProgram::CVU1MicroProgram(uint64 * pCodeStart, uint64 * pCodeEnd, int Offset)
00017 {
00018         // Create a static DMA segment that has an MPG vifcode followed by the
00019         // actual microcode data.
00020 
00021         m_pUploadPtr = VIFStaticDMA.GetPointer();
00022         m_iSize = pCodeEnd - pCodeStart;
00023         m_iOffset = Offset;
00024 
00025         VIFStaticDMA.StartMPG(Offset);
00026 
00027         for(int i = 0; i < m_iSize; i++)
00028         {
00029                 VIFStaticDMA.AddMPG(pCodeStart[i]);
00030         }
00031 
00032         VIFStaticDMA.EndMPG();
00033         VIFStaticDMA.DMARet();
00034 }
00035 
00036 void CVU1MicroProgram::Upload()
00037 {
00038         VIFDynamicDMA.Add32(FLUSHE);
00039         VIFDynamicDMA.DMACall(m_pUploadPtr);
00040 }

Generated on Sun May 18 21:45:09 2008 for PS2X by  doxygen 1.5.4