Fix/workaround at least one class of buffer underruns in the GL plugin. Fix some bad deletes (instead of delete []). etc.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@404 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-08-31 13:36:52 +00:00
parent d9e129ae99
commit 09406d76c4
25 changed files with 117 additions and 69 deletions

View File

@ -22,13 +22,13 @@ void DecodedVArray::Zero()
posMtxInds = 0;
for (int i=0; i<3; i++)
normals[i] = 0;
for (int i=0; i<2; i++)
colors[i] = 0;
for (int i=0; i<8; i++)
{
texMtxInds[i] = 0;
uvs[i] = 0;
}
for (int i=0; i<2; i++)
colors[i] = 0;
}
void DecodedVArray::Destroy()

View File

@ -97,9 +97,9 @@ bool FifoCommandRunnable(void)
{
u32 iBufferSize = FAKE_GetFifoSize();
if (iBufferSize == 0)
return false;
return false; // can't peek
u8 Cmd = PeekFifo8(0);
u8 Cmd = PeekFifo8(0);
u32 iCommandSize = 0;
switch(Cmd)
@ -362,12 +362,6 @@ void OpcodeDecoder_Shutdown()
void OpcodeDecoder_Run()
{
// just a small check
if (g_pDataReader != &g_fifoReader)
{
MessageBox(NULL, "very strange", "video-plugin", MB_OK);
}
DVSTARTPROFILE();
while (FifoCommandRunnable())

View File

@ -51,12 +51,7 @@ void VertexLoader::SetVArray(DecodedVArray *_varray)
{
varray = _varray;
}
/*
inline u8 ReadBuffer8() { return fifo.Read8(); }
inline u16 ReadBuffer16() { return fifo.Read16(); }
inline u32 ReadBuffer32() { return fifo.Read32(); }
inline float ReadBuffer32F() { return fifo.Read32F(); }
*/
inline u8 ReadBuffer8()
{
return g_pDataReader->Read8();
@ -120,7 +115,7 @@ void VertexLoader::Setup()
{
m_PipelineStates[m_numPipelineStates++] = PosMtx_ReadDirect_UByte;
m_VertexSize += 1;
m_components |= VB_HAS_POSMTXIDX;
m_components |= VB_HAS_POSMTXIDX;
}
// Texture matrix indices
@ -195,7 +190,7 @@ void VertexLoader::Setup()
}
WriteCall(pFunc);
m_VertexSize += uSize;
int m_numNormals = (m_VtxAttr.NormalElements==1) ? NRM_THREE : NRM_ONE;
int m_numNormals = (m_VtxAttr.NormalElements == 1) ? NRM_THREE : NRM_ONE;
m_components |= VB_HAS_NRM0;
if (m_numNormals == NRM_THREE)
m_components |= VB_HAS_NRM1 | VB_HAS_NRM2;

View File

@ -135,7 +135,7 @@ public:
void SetVAT_group0(u32 _group0)
{
if (!m_AttrDirty && m_group0.Hex == _group0)
if (m_group0.Hex == _group0)
return;
m_AttrDirty = true;
m_group0.Hex = _group0;

View File

@ -59,6 +59,7 @@ void _SetCol565(u16 val)
col |= lut5to8[(val )&0x1f] << BSHIFT;
_SetCol(col | (0xFF<<ASHIFT));
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
inline u32 _Read24(u32 iAddress)
@ -112,7 +113,7 @@ void LOADERDECL Color_ReadDirect_24b_6666(void* _p)
_SetCol6666(val);
}
// F|RES: i am not 100 percent show, but the colElements seems to be important for rendering only
// F|RES: i am not 100 percent sure, but the colElements seems to be important for rendering only
// at least it fixes mario party 4
//
// if (colElements[colIndex])
@ -128,7 +129,7 @@ void LOADERDECL Color_ReadDirect_32b_8888(void* _p)
// "kill" the alpha
if (!colElements[colIndex])
col |= 0xFF<<ASHIFT;
col |= 0xFF << ASHIFT;
_SetCol(col);
}