Substantial XFB speedup. There's more to get though, for example by using a shader for color conversion instead - but i like having a fast CPU implementation too. Also adds some sanity checks. PAL games still have problems.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@885 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-10-15 21:29:44 +00:00
parent fffc2b6a77
commit 34a4fee1c5
9 changed files with 145 additions and 34 deletions

View File

@ -27,7 +27,9 @@
enum {
XFB_WIDTH = 640,
XFB_HEIGHT = 480,
XFB_HEIGHT = 480, //480,
XFB_BUF_HEIGHT = 538, //480,
// TODO: figure out what to do with PAL
};
static GLuint xfb_texture;
@ -39,8 +41,8 @@ static GLuint s_xfbRenderBuffer = 0;
void XFB_Init()
{
// used to render XFB
xfb_buffer = new u8[XFB_WIDTH * XFB_HEIGHT * 4];
memset(xfb_buffer, 0, XFB_WIDTH * XFB_HEIGHT * 4);
xfb_buffer = new u8[XFB_WIDTH * XFB_BUF_HEIGHT * 4];
memset(xfb_buffer, 0, XFB_WIDTH * XFB_BUF_HEIGHT * 4);
glGenTextures(1, &xfb_texture);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, xfb_texture);
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, XFB_WIDTH, XFB_HEIGHT, 0, GL_BGRA, GL_UNSIGNED_BYTE, xfb_buffer);