-clearing framebuffer before displaying image, should prevent

from strange startups
-replaced a few not needed definitions in code
This commit is contained in:
fix94.1 2012-05-17 16:21:16 +00:00
parent f98ca361e8
commit 1b2842931f
3 changed files with 12 additions and 7 deletions

View File

@ -20,8 +20,7 @@
#include "lz77.h"
#include "mem2.hpp"
#define ALIGN32(x) (((x) + 31) & ~31)
#include "utils.h"
u32 packBytes(int a, int b, int c, int d)
{

View File

@ -141,6 +141,12 @@ void CVideo::init(void)
VIDEO_Configure(m_rmode);
m_curFB = 0;
VIDEO_SetNextFramebuffer(m_frameBuf[m_curFB]);
VIDEO_ClearFrameBuffer(m_rmode, m_frameBuf[m_curFB], COLOR_BLACK);
m_curFB ^= 1;
VIDEO_SetNextFramebuffer(m_frameBuf[m_curFB]);
VIDEO_ClearFrameBuffer(m_rmode, m_frameBuf[m_curFB], COLOR_BLACK);
m_curFB ^= 1;
VIDEO_SetNextFramebuffer(m_frameBuf[m_curFB]);
VIDEO_SetBlack(FALSE);
VIDEO_Flush();
VIDEO_WaitVSync();

View File

@ -153,7 +153,7 @@ s32 GCDump::__DiscWriteFile(FILE *f, u64 offset, u32 length, u8 *ReadBuffer)
while(length)
{
toread = min(length, gc_readsize);
s32 ret = __DiscReadRaw(ReadBuffer, offset, (toread+31)&(~31));
s32 ret = __DiscReadRaw(ReadBuffer, offset, ALIGN32(toread));
if (ret == 1)
memset(ReadBuffer, 0, gc_readsize);
else if (ret > 1)
@ -337,11 +337,11 @@ s32 GCDump::DumpGame()
DOLSize = FSTOffset - DOLOffset;
DiscSize = DataSize + GamePartOffset;
FSTBuffer = (u8 *)MEM2_alloc((FSTSize+31)&(~31));
FSTBuffer = (u8 *)MEM2_alloc(ALIGN32(FSTSize));
if(FSTBuffer == NULL)
return 0x31100;
ret = __DiscReadRaw(FSTBuffer, FSTOffset+NextOffset, (FSTSize+31)&(~31));
ret = __DiscReadRaw(FSTBuffer, FSTOffset+NextOffset, ALIGN32(FSTSize));
if(ret > 0)
{
@ -583,11 +583,11 @@ s32 GCDump::CheckSpace(u32 *needed, bool comp)
}
else
{
u8 *FSTBuffer = (u8 *)MEM2_alloc((FSTSize+31)&(~31));
u8 *FSTBuffer = (u8 *)MEM2_alloc(ALIGN32(FSTSize));
if(FSTBuffer == NULL)
return 1;
ret = __DiscReadRaw(FSTBuffer, FSTOffset+NextOffset, (FSTSize+31)&(~31));
ret = __DiscReadRaw(FSTBuffer, FSTOffset+NextOffset, ALIGN32(FSTSize));
if(ret > 0)
{
MEM2_free(FSTBuffer);