GP32X.com - GP32 GP2X Pandora The Wiz - open source entertainment: Libcastor 0.1 - GP32X.com - GP32 GP2X Pandora The Wiz - open source entertainment

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Libcastor 0.1

#1 User is offline   Orkie

  • Super Duper Mega GP Mania
  • Icon
  • Group: GP Guru
  • Posts: 2,242
  • Joined: 22-March 06
  • Location:UK

Posted 12 January 2009 - 01:17 PM

For anybody who already has a Wiz, here is something to try if you are bored. For everybody else, maybe it will be interesting to look at, who knows? wink.gif

libcastor is a small library designed to give direct hardware access under Linux on the Wiz. Somewhat similar to Minimal Library on the GP2X, however [I would like to think] it is a bit simpler to use and doesn't require that you include the source into your tree (so if there were a hardware update and you had dynamically linked for example, a new library could simply be copied over to deal with any changes).

It is currently usable, though not complete (no alpha blending etc.). The README has a bit of information, though the documentation it refers to does not yet exist biggrin.gif. Just look through <castor.h> for now, it has information on all the functions and constants included as comments.

Download

#2 User is offline   Alex.

  • Raskolnikovfan
  • Icon
  • View blog
  • Group: GP Guru
  • Posts: 4,503
  • Joined: 24-August 05
  • Gender:Male

Posted 16 January 2009 - 07:10 PM

Thanks for working on this Orkie smile.gif I finally got some free time to play around with it a bit, looks very promising. It's nice that it doesn't conflict with SDL_mixer, that's the only part of SDL I wouldn't like to give up.

Do you have any plans for implementing accurate tick counters? Those are something really lacking in the default libs.

By the way, I found that drawing to a malloc'ed buffer and copying that to fb1 every frame produces smoother results than drawing directly to fb1 and calling lc_flipfb(1) at the end. Perhaps I'm using it wrong though, looking forward to the documentation smile.gif By the way, why are there 2 layers? Does the hardware support alpha-blending one over the other?

#3 User is offline   Orkie

  • Super Duper Mega GP Mania
  • Icon
  • Group: GP Guru
  • Posts: 2,242
  • Joined: 22-March 06
  • Location:UK

Posted 16 January 2009 - 10:12 PM

To be honest, I haven't tested the drawing completely - I just use coloured bars to test biggrin.gif. If there are any free DMA channels, maybe one of those could be used, I don't know yet. I do plan to put in support for the accurate hardware timers.

There are various things you can do with the 2 RGB layers. You can make both of them whatever sizes and place them however you like. You can set a background colour for areas where no picture data is drawn. For each layer you can have transparent colours. Also, you can set an 'inversion' colour so that any colours below it are inverted where an upper layer has the specified colour set. There is alpha blending between the surfaces possible and I think per-pixel alpha is also supported.

There is also another layer for which I have no support in libcastor at the moment, which is YUV. That supports the same resizing/positioning options as the RGB layers and I think transparency and alpha too (but I'm not certain about those two). It also has scaling in hardware with optional bilinear filtering.

#4 User is offline   Alex.

  • Raskolnikovfan
  • Icon
  • View blog
  • Group: GP Guru
  • Posts: 4,503
  • Joined: 24-August 05
  • Gender:Male

Posted 16 January 2009 - 10:22 PM

That sounds wonderful, all those effects will open the doors for some really nifty homebrew smile.gif Thanks again for your work, hopefully a lot of people will make good use of it!

#5 User is offline   Orkie

  • Super Duper Mega GP Mania
  • Icon
  • Group: GP Guru
  • Posts: 2,242
  • Joined: 22-March 06
  • Location:UK

Posted 16 January 2009 - 10:51 PM

Yeah, I did think the YUV layer in particular could be neat if a video library were set up to output to it. Video backgrounds would be fun, and what about a TV in a game which actually plays video? biggrin.gif

This post has been edited by Orkie: 16 January 2009 - 10:52 PM


#6 User is offline   rlyeh

  • GP32 Hardcore
  • Icon
  • Group: GP Guru
  • Posts: 277
  • Joined: 25-March 03
  • Location:49°9' East latitude, 126°43' South longitude: in your deeper thoughts.
  • Interests:sex what else!

Post icon  Posted 19 January 2009 - 06:08 PM

Great!
Downloading...

:-)

#7 User is offline   CongoZombie

  • GP Mania
  • PipPipPipPipPip
  • Group: GP32 Hardcore
  • Posts: 344
  • Joined: 22-January 07
  • Location:The UK

Posted 25 January 2009 - 10:24 PM

Cool. Going to set up an SVN for it soon?

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic