A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / Starting up... C help

 

Author Message
MrZammler
Member
#1 - Posted: 22 Oct 2007 13:56
Reply Quote
Hello #?

I'm trying to get into some simple demo coding, more like some chipset coding, but using C, instead of the more popular assembly. Main reason being that I think I'm getting old and trying to learn asm wont be something easy to do any more. I can get around C though.

I know that with C I would need to use OS-compliant header files, and cant directly talk to the hardware, but that's ok, at least for now.

Anyway, I'm looking for some sample C source to get me started, but I've had little luck searching the net for C source with e.g. blitter usage.

I'm also reading through the amiga hardware reference from the DevCD 2.1, to get some theory on how things work.

So, any help/pointers to C source to get me going would be much appreciated.

Thanks,
Emmanuel
kasie
Member
#2 - Posted: 22 Oct 2007 19:34 - Edited
Reply Quote
With "C" you can do as system friendly coding (without using of hardware), and also with using of hardware. Here is no any limitation if compare C with Asm. Any 'strange' or 'low-level' or 'asm-only' thinks, you can easyly impelemt or on plain C code, or with assembler inline parts (like inlines, asm objects and so on) into C code.

For start you need C compiler itself. I think (and i prefered) "vbcc". Becouse it's very easy for understand, all is here done very logical and elegant , without any mess with headers like with GCC for example. Vbcc generate very good code/binary, and it will be almost the same as assembler binary, if you will do C code good and with inlines while you will call/use C functions. (like memcpy(),memset() and so on).

If you will be do only plain 68k code for classic amigas, you can also use SasC. This a bit old, but, still very good. For example, compiling of the same code over sasc will be faster, if compared it with vbcc. But output binary will be more good by vbcc. Also sasc can do only 68k binarys, vbcc can : aos3,aos4,morphos (with very little modification of code).

All what you need, it's:
1. choice C compiler and setup it.
2. download system headers. Last ones for classic os, calles NDK3.9. and you can found it for example here ndk3.9
3. create little example prog (like hello_world.c), try to compile it and run.

If all is ok, after it you can learn some amiga-spesific stuff and try to do somethink.

ps. founding of amiga C sources it's not a problem. Here is tons of link (on this forum also) for demo/intro sources. Also you can browse aminet in directory "/dev/c". Or just do in google somethink like "c code amiga example". But for first, you need setup all this boring crap, and so on.
MrZammler
Member
#3 - Posted: 23 Oct 2007 10:26
Reply Quote
Hi kasie, thanks for your reply.

I've already been through the setup process, have both gcc and vbcc on my A3000 and have written and compiled some basic stuff (some MUI apps with gcc, and some screen opening & line drawing with vbcc).

Sorry, I should have stated what I have done so far in my first post, it'd saved you some trouble, but thanks for your info (always valuable).

Right now, my goal is to write a simple blitter scroller... But I'm missing much of the knowledge required...

Anyway, hope I can get more information from here, will keep searching as much as I can.

Thanks,
Emmanuel
klipper
Member
#4 - Posted: 23 Oct 2007 16:00
Reply Quote
MrZammler: pointers, pointer arithmetic and bit manipulation logic operators (&, |, !) will be important when dealing directly with the ardware registers through C. In fact you cannot do hardware level non-os code without them in C.

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0