Starcat, on Mon Apr 5, 2010 9:39 AM, said:
Hello everybody!
I know this topic isn't entirely new, but up to this point, I couldn't find good tutorials or examples on using Jaguar C to develop games. Of course C isn't exactly the strong side of the Jag and there are libs like the removers lib.
However it's my impression, that except for the Jagware people possibly, nobody is really using it. Correct me if I'm wrong.
Hey, I'm nobody, and I'm using it!
I'm nowhere near writing a game, just testing my "ever-growing library of misc. c code"
on another target at the moment.
Hope this isn't reviving a dead thread, but seeing as how it is the most current one...
Maybe this will help someone else? (or me when my hard drive crashes, and I come back years later
trying to get this stuff running again)
I'm using:
(Self-built) binutils 2.16.1 and GCC 4.2.0 targetting m68k-aout
jlibc & rmvlib (built with the above, for rmvlib I needed to use a linux madmac instead of smac though)
building jlibc will give you a crt0.o
I believe jlibc has malloc() and free(), IIRC qsort() is the only thing I noticed
missing (I don't use much stdlib stuff though).
rmvlib has skunkboard-compatible printf() and getchar() and putchar().
That printf() seems broken for printing signed char/int/long/short
(maybe just PEBKAC, but my code runs on other targets fine...).
You will want a rmvjcp binary if you are using rmvlib's printf() -- there are linux
and windows binaries @ www.hillsoftware.com IIRC.
( standard skunkboard "jcp" doesn't work with rmvlib printf() ).
Output is kinda slow, but it is still in development and Seb is nice enough to release
his stuff, so I am not complaining

I asked him for source (I don't run much linux or
windows around here) but no response, but I am not going to bother him
Output is even slower when ran under e.g. virtualbox
I needed to link against libgcc.a too to get:
_divsi3 _modsi3 _mulsi3 _udivsi3 _umodsi3
No idea if my gcc and/or the jaguar does hardware or software floating point (haven't tried).
Had no luck getting sln 1.0.0 (or older) to link stuff --
I use a linux binary of aln instead for now.
It has a lovely limitation of "File name too long: xyz (sorry!)"
(at least it said it was sorry!)
rather than limit myself to whatever it thinks is short enough, I use binutils "ar" to
add all my compiled objects to an archive/library (.a) with a short name, then use aln to link
that against:
crt0.o xyz.a rmvlib jlibc and libgcc (in that order).
Hope this helps someone else!
I also like using
http://www.cs.utah.e...x/knit/cmi.html CMI to reduce the size of binaries too,
just be careful you pass it the right args to not "optimize out" e.g. _start() or __main() startup
code that you might not call explicitly from your code, but that is invoked "behind the scenes"
(e.g. by a library you are linking against, or the compiler is).
I might try vbcc and sln again, I think last time I couldn't get sln to link my stuff --
maybe vbcc and aln would work for me though...
Someday I will make more use of rmvlib...the mod player is tempting...