Looking for Sound/Graphics C/C++ libraries

C and PASCAL (or any other high-level languages) in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Zappy
Retro freak
Retro freak
Posts: 13
Joined: Thu Feb 10, 2005 3:43 pm
Location: Zürich (Switzerland)
Contact:

Postby Zappy » Wed Sep 05, 2007 4:19 pm

Sprites stored as the code necessary to blit them

We definitely used those, especially in "Choice of Gods" where the generated code was interleaved with fullscreen switches.

I remember M-Coder talking about your "compiled sprites" ("sprites en code généré", as we said). He had a bunch of stories about how he used exotic instructions like TAS in them, to save some bytes. I'm pretty sure a bunch of Overlanders / Legacy demos used this too.

- Pierre

C-Rem
Captain Atari
Captain Atari
Posts: 392
Joined: Wed May 01, 2002 6:45 pm

yop

Postby C-Rem » Thu Sep 06, 2007 6:26 am

zappy : just to say that i totally love c.o.g ... :D

( a 2007 screen is welcome ;) )

User avatar
Desty
Atari God
Atari God
Posts: 1962
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Postby Desty » Mon Oct 08, 2007 12:53 am

master wrote:Pascal ! Those were the days ! It was my most beloved language in which I programmed for over 10 years - starting on IBM PC XT at ~8 MHz 17 yrs ago through 386, until infamous Pentium error : Runtime Error 200.
But, I wouldn`t go back now that I learnt C++ ;-)

Holy crap, this is familiar... is this the one where you'd just run the program a few times in succession until it worked (i.e. when two program windows opened together one would work) - I vaguely recall the error description being "ring memory" something something...
Oldskool!

Anyway, I think C++ is possible with a cross-compiler setup; on the Sparemint site or something there's documentation for setting up gcc which worked for me building plain TOS programs (although I haven't tried GEM stuff). I had some library problems trying to compile a simple C++ program with g++ though.
I got sidetracked from the experimentations with lack of docs, annoying lack of backend/frontend modularity in the gnu compiler toolchain and rl / college. But I'll get back on the case at some point.

Worth noting is that there's a few different C implementation 'dialects' on the ST, so if there are existing libraries, it might be a bit of a hassle to port them to the compiler you're using. Or it might be easy, I dunno.

ps: ffs, "g++" is blocked by phpbb?
tá'n poc ar buile!

mcoder
Atari maniac
Atari maniac
Posts: 90
Joined: Thu Oct 04, 2007 6:42 pm
Location: France

Postby mcoder » Mon Oct 08, 2007 10:01 am

Zappy wrote:We definitely used those, especially in "Choice of Gods" where the generated code was interleaved with fullscreen switches.

I remember M-Coder talking about your "compiled sprites" ("sprites en code généré", as we said). He had a bunch of stories about how he used exotic instructions like TAS in them, to save some bytes. I'm pretty sure a bunch of Overlanders / Legacy demos used this too.

- Pierre


Yes, I used this term, since I was perhaps the first to use this technique on ST.
In fact, this technique had been invented on Amstrad CPC by one of my friends (Philippe Pamart, the author of Titan, and I shamelessly stole his idea) before 1990 !

If you try to generate efficient code for this kind of sprites, you'll discover that it is a very interesting work. It's like writing a compiler.
For example, since you have only 8 Dn registers, you have to store the most frequent values of your sprite in your registers (not forgetting about using the 8 and 16 bits parts !!!).
Also, you have to reassign dynamically them.

A lot of people took the challenge to write good sprite compilers.
One of the best routine I saw was from Alain Boisramé.

Finally, I have to add that most of my demos were generated at run time !
In other words, the code was a generator that produced code.
This is especially efficient on full screens, where you have to count cycles.
You can also put a version of your generator, this way you get a screen in very few bytes, compared to some screens I remember that included megabytes of generated code.

JC

User avatar
karlm
Atari Super Hero
Atari Super Hero
Posts: 713
Joined: Thu Nov 13, 2003 4:09 am
Location: Top of the World - Australia

Postby karlm » Mon Oct 15, 2007 3:13 am

simonsunnyboy wrote:There is no C++ compiler for TOS but Pure C is an ANSI C package complete with IDE and all tools needed.
Under Mint and if you are interested in crosscompiling, gcc is available too.


Bit late but better than never ...

Uhm, gcc is both C and C++ as far as I know. Warwick Allison wrote both a Gem library and a games library for it, as well as a set up guide to get it up and running on single TOS. His main machine at the time was a TT and I remember getting hello.cpp :) to work fine on my Falcon030 with gcc 2.71.

If anyone is still interested I can dig the guides up, and the libraries are called GEM++ and AMS++ iirc.

Cheers

karlm

BlankVector
Captain Atari
Captain Atari
Posts: 475
Joined: Wed Oct 24, 2007 7:52 pm
Location: France
Contact:

Postby BlankVector » Wed Oct 24, 2007 8:02 pm

Desty wrote:Anyway, I think C++ is possible with a cross-compiler setup; on the Sparemint site or something there's documentation for setting up gcc which worked for me building plain TOS programs (although I haven't tried GEM stuff). I had some library problems trying to compile a simple C++ program with g++ though.
I got sidetracked from the experimentations with lack of docs, annoying lack of backend/frontend modularity in the gnu compiler toolchain and rl / college. But I'll get back on the case at some point.


Hello, Desty.

You should look a little higher on this thread 8)
http://www.atari-forum.com/viewtopic.php?t=11715&postdays=0&postorder=asc&start=6


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 2 guests