Bug in sceGuDrawBuffer()

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Paco
Posts: 54
Joined: Sun Oct 09, 2005 6:53 pm

Bug in sceGuDrawBuffer()

Post by Paco »

I believe the lines

Code: Select all

	sendCommandi(157,((((unsigned int)gu_draw_buffer.frame_buffer) & 0xff000000) >> 8)||gu_draw_buffer.frame_width);
	sendCommandi(159,((((unsigned int)gu_draw_buffer.depth_buffer) & 0xff000000) >> 8)||gu_draw_buffer.depth_width);
should actually be

Code: Select all

	sendCommandi(157,((((unsigned int)gu_draw_buffer.frame_buffer) & 0xff000000) >> 8) | gu_draw_buffer.frame_width);
	sendCommandi(159,((((unsigned int)gu_draw_buffer.depth_buffer) & 0xff000000) >> 8) | gu_draw_buffer.depth_width);
Been stuck all day and lost half my hair until I noticed the logical OR there was likely to screw up my rendertargets and VRAM allocations. In the meantime, I'll switch to using sceGuDrawBufferList(), but that is likely to be causing some internal troubles in Gu; for example, sceGuDispBuffer() uses the pixel format from sceGuDrawBuffer() in order to set the display mode, which is kinda sucky.

I have no idea how can any code work with that bug... I may be missing something?
Paco
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

Ahhh, so that's why that function was acting up a while back. :) Thanks for locating that bug, a fix has been submitted.

It works because the registers are also written in sceGuStart(), so it wasn't visible until now.
GE Dominator
Post Reply