Framebuffer coding

Malcolm malcolm.parsons at gmail.com
Wed Sep 27 22:53:08 CEST 2006


On 9/27/06, Troy Davis <troy_ed at yahoo.com> wrote:
> I have been playing around with the framebuffer on dslinux.
> http://gpf.dcemu.co.uk/phoenixDS3.png

<3

> This required changes to the ndsfb.c to allow for scaling of the background,
> the arcade emu phoenix uses 208X248 and since the screen size is 256X192
> didn't fit to well, so I added so logic that if you set the yres to 256, it
> uses the yres_virtual and xres_virtual as scalers for the screen of 256X256.
> Not sure if this was the best way to accomplish this so I thought I would
> get some input before submitting a patch. Also how would it be best to use
> other sized backgrounds/modes and then reset them back, would this be part
> of the framebuffer driver maybe an accelerate driver matches the context
> better ?

xres and yres are the visible size of the screen
xres_virtual and yres_virtual are the size of the virtual screen.
If the virtual size is bigger than the visible size, hardware
scrolling can be used to choose which part of the virtual screen to
display.

So just setting xres and yres to 208 and 248 should be enough to
trigger the appropriate scaling.

Setting back to 256 and 192 would reset the scaling.

> I have also been playing around with libSDL and have a basic video only port
> done that uses the nano-X video driver, still needs work though as the RGB
> is displaying as BGR, and maybe it would be better to write a custom video

That may be a nano-X bug.

> driver or maybe the existing fb driver or DirectFB driver would be better?

I'm not in love with nano-X, do whatever you think is best.

-- 
Malcolm Parsons



More information about the dslinux-devel mailing list