Welcome! Log In Create A New Profile

Advanced

Help with writing to external framebuffer

Posted by Neku89 
Help with writing to external framebuffer
March 05, 2015 09:10PM
Hi to all :)

I have a question. I'm new to Wii development and I want to understand a few low-level things. I'm trying to display simple things (like lines) on screen by modifying the external framebuffer: I can write something like
u32* tmp = xfb; //xfb is the external framebuffer
tmp[x+(640*y)/2] = 0x00FF0000; // a color
to paint the (x, y) point with my desired color. I've noticed that xfb is only 320 points wide (xfb[319] is the last pixel in the first row, while xfb[320] is the first pixel in the second row), but upon closer inspection it seems that this way I'm painting two adjacent pixels (I imagine that this is due to the fact that the screen is actually 640x480). Is there an explanation for this behavior? How can I paint a (true) single pixel?

Pardon my noobness, it's the first time I venture outside of high-level programming :)
Re: Help with writing to external framebuffer
March 06, 2015 09:35AM
The external framebuffer uses YUY2 image format. Individual pixels have their own luminance (Y) values but each pair of pixels share chroma (U/V) values.
Re: Help with writing to external framebuffer
March 07, 2015 12:02PM
Oh, I see, so that explains the repetition of luminance values. Does that also mean that two adjacent pixels cannot be of two different colors? Can the GX subsystem overcome this limitation? It seems to me that commercial games (and other homebrews) can manage single pixels in the "normal" way, am I wrong?

Thanks for your reply.
Re: Help with writing to external framebuffer
March 11, 2015 11:43AM
No, I believe there is no way to overcome this hardware limitation.

See my post here on SDL wiibrews.

[forum.wiibrew.org]
Re: Help with writing to external framebuffer
March 13, 2015 08:48AM
They have the same chroma values but their luminance is different so they're not the exact same colors. A regular standard definition TV can't really get better picture quality due to the max sampling frequency of the chroma signal.
Sorry, only registered users may post in this forum.

Click here to login