PDA

View Full Version : RgbRenderer V0.1



wraggster
April 3rd, 2008, 21:24
News/release from NoNameNo (http://wiibrew.org/index.php?title=Homebrew_apps/RgbRenderer)


RgbRenderer is a kind of library to help people wanting to START coding graphical RGB effect on wii.

Why RgbRenderer ?
In fact all started when i wanted to port some of my old demo effect. I discovered that the wii video RAM use a "strange" format called Y1CbY2Cr. This format is able to embed 2 pixel color definition in only 32bits. so all Pixels goes by two. so when you want to only light one you need to know if it is on a odd or even X, then encode it with the one before or after it (depend odd or even) in Y1CbY2Cr. pfffff...... More over if you want to know the color of a pixel, you have to do the same reversed ..... re pffffff.... When you code in this format you allocat an array of 320*480 (u32) often called xfb in "hello world" example around. why 320 ?? remember 2 pixels for a u32 ;) You fill your xfb array and you make it appear at screen at a certain signal called VBL. I had a little reflexion about this method, video memory is Y1CbY2Cr, we use a Y1CbY2Cr array to prepare our drawing then display it. And here is my "little" idea. why not handle a RGB array ?? then at the VBL, convert the whole array to Y1CbY2Cr format, then push to xfb ;) I was very septic at start, coz converting a whole screen to 640*480 pixel to Y1CbY2Cr format 50/60 per secondes was a real challenge ;) and it was coz the converter i coded only do 1/4 of a screen per vbl.... BUT i found a kind of coded that do the job really quick !!! a whole screen is ok per vbl depending of what other job you add.

Download and Give Feedback Via Comments