Increase res of color texture to match PAL Super Smash Bros: Brawl

The pal version of SSBB has a 640x568 xfb, which is larger than the efb.
Increase the size of the static textures and put in some runtime checks
to prevent buffer overruns.
This commit is contained in:
Scott Mansell 2013-11-24 00:15:08 +13:00
parent e720ea7837
commit afe47ff847
2 changed files with 11 additions and 1 deletions

View File

@ -551,6 +551,11 @@ namespace EfbInterface
// Like CopyToXFB, but we copy directly into the opengl colour texture without going via Gamecube main memory or doing a yuyv conversion // Like CopyToXFB, but we copy directly into the opengl colour texture without going via Gamecube main memory or doing a yuyv conversion
void BypassXFB(u8* texture, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma) { void BypassXFB(u8* texture, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma) {
if(fbWidth*fbHeight > 640*568) {
ERROR_LOG(VIDEO, "Framebuffer is too large: %ix%i", fbWidth, fbHeight);
return;
}
u32 color; u32 color;
u8* colorPtr = (u8*)&color; u8* colorPtr = (u8*)&color;
u32* texturePtr = (u32*)texture; u32* texturePtr = (u32*)texture;

View File

@ -20,7 +20,7 @@ static GLint attr_pos = -1, attr_tex = -1;
static GLint uni_tex = -1; static GLint uni_tex = -1;
static GLuint program; static GLuint program;
static u8 s_xfbColorTexture[2][EFB_WIDTH*EFB_HEIGHT*4]; static u8 s_xfbColorTexture[2][640*568*4];
static int s_currentColorTexture = 0; static int s_currentColorTexture = 0;
static volatile bool s_bScreenshot; static volatile bool s_bScreenshot;
@ -154,6 +154,11 @@ void SWRenderer::swapColorTexture() {
void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed *xfb, u32 fbWidth, u32 fbHeight) void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed *xfb, u32 fbWidth, u32 fbHeight)
{ {
if(fbWidth*fbHeight > 640*568) {
ERROR_LOG(VIDEO, "Framebuffer is too large: %ix%i", fbWidth, fbHeight);
return;
}
u32 offset = 0; u32 offset = 0;
u8 *TexturePointer = getColorTexture(); u8 *TexturePointer = getColorTexture();