diff --git a/source/channel/lz77.c b/source/channel/lz77.c index 7bc0f255..d477480e 100644 --- a/source/channel/lz77.c +++ b/source/channel/lz77.c @@ -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) { diff --git a/source/gui/video.cpp b/source/gui/video.cpp index 12201fb6..a86c9d88 100644 --- a/source/gui/video.cpp +++ b/source/gui/video.cpp @@ -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(); diff --git a/source/loader/gc_disc.cpp b/source/loader/gc_disc.cpp index 81090147..6d150c7e 100644 --- a/source/loader/gc_disc.cpp +++ b/source/loader/gc_disc.cpp @@ -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);