[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libcaca] libcaca for GBA
Hi all,
I just ported libcaca to GameBoy Advance (tm) (c) (etc etc).
As this release is not perfectly functionnal, reliable, etc, I won't
merge it with current SVN repository.
As a proof of concept, I compiled aafire (out of the box from examples/
directory) with it, link to gba ROM below.
Ok, so why isn't the stuff reliable ? For non-gba-coders, you have to
know video memory is 96k long. I used tiles to achieve a good speed, and
here is how the video RAM is used :
Maps :
2 tiles maps (BG0 and BG1) -> 2048 bytes.
Tiles data :
Each 8x8 tile is 64 bytes long (8x8 bytes).
So, we have first 16 tiles for each background color tiles. We used
64*16 -> 1024 bytes.
Then, we have our font, each character beeing a tile. whole visible
ASCII chars take 94*64 bytes. -> 6016 bytes.
Problem, to manage foreground color, we have to put each char 16
times. (94*64)*16 -> 96256 bytes.
Which makes a total count of .. (96256+1024+2048) -> 99328.
Almost 100k when we have only 96k available. I works, anyway. but can
looks weird.
So, next version (which will perfectly work for sure) will use 16 colors
tiles, but will make some other problems coming.
That's it, if someone wants to look at the code, it is at
http://jylam.lnxscene.org/code/libcaca-30-07-05-gba.tar.gz
If you just want to see cacafire, just download
http://jylam.lnxscene.org/code/cacafire.gba
Note that other examples can't work out of the box, as GBA as only 256k
of usable RAM, and a part of it is already taken by allocated variables.
(For example, cacaballs, cacamoire, cacaplasma will work, but with a
reduced graphic buffer).
cacademo works, but as there's no event handling, you get stuck on the
main menu.
For those willing to try, just remember to disable ALL drivers but gba
and null one (althought null isn't needed), and to set your CC to right
arm gcc one. Ho, and set host to arm, too. (all that in configure script
options).
May the high-end technology be with you.
--
Jean-Yves Lamoureux
Software Developper
--
This is the libcaca mailing-list, see http://sam.zoy.org/libcaca/
Trouble unsubscribing? Please contact <sam@zoy.org>
List archives are at http://sam.zoy.org/libcaca/threads.html