Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: McVenco on October 27, 2006, 08:50:44 PM
-
Today I received a bunch of developer tools which I'm planning to use mainly to learn a bit of programming, and maybe do something useful for the Amiga community in the future.
What I've got:
-StormC 2.0
-StormC 3.0 and Developer Survival Kit
-StormWizard 2.2
-p.OS-Prerelease
-Amiga Developer CD 1.1 and 2.1
-and 3 WarpUp stickers :-)
What I'm looking for:
-General info on programming in C on the Amiga
So far I only have the users manual, plus the knowledge that I can find tons of stuff on Aminet, but if anyone has some other hints of websites/sources on starter's programming I'd be grateful.
I'm also quite uncertain on what this p.OS Pre-release is. The name does ring a bell, but I can't put my finger to it...
Any help is welcome! (plus hints on what I should code first :-)
-
The WarpUp stickers should make your Amigas fly :-)
As for p.OS-pre-release: It's a pre-release of p.OS (duh). It was a shot of a German company (ProDad, I believe, too lazy to grab my copy of it from the cupboard to verify) to create a replacement OS for classic Amiga hardware. Until that moment, ProDad was known for some software-titles mainly for adding titles to video and do some rather nice video-swipes. p.OS never realy took off but somehow I did like it (the CD comes with a Chess game that even I could beat ;-)). Have a few hours of fun with it, you won't be too disapointed.
I have some experience in programming C on.... Windows (the boss made me do it!).... and had a go on it with the Amiga but decided to take the easy route again and stick with AmigaBASIC like ACE (for the moment).
If you've got the hang of C you could have a go at porting Firefox on Classic Amiga ;-)
-
Look at the Rom Kernal Reference Manuals on the Amiga Developer CD 2.1. They're the reference manuals everybody is supposed to use when programming Amigas.
-
Have you ever programmed at all? If you have a decent knowledge pick up "The C Programming Language" it basically tells you how to work with C. Then you should learn the amiga specifics after that.
-
I've programmed a very little bit in Basic, AMOS and assembler, but that's a long time ago.
The only thing related to programming that I've done the past years is a lot of php stuff. So I don't have much knowledge of programming, but when I look at some code, it's not gibberish at all. I can't just do it myself yet.
And I will most certainly have to take a look at the RKM's, I didn't know they were on the CD, so that's good news.
I also have a copy of "Amiga Intern 2.0", a German book (translated to Dutch) on coding, but that's pretty limited to WB1.3. I could be a good book for reference though..
And as for Firefox: maybe in 10 or 15 years if I start working on if fulltime from now on :lol:
-
My one main() piece of advice would be:
If you haven't done any coding outside of BASIC/asm, forget about learning to write AmigaOS specific C/C++ code at the outset.
Not entirely, of course but I strongly advise learning the syntax of the language in an OS neutral way. Sure, that means writing a few no-fun "should compile anywhere" CLI programs to start with, but once you've mastered the basic syntax, anything you see in C for amigaos will make vastly more sense than they would otherwise.
As you've already done some ASM, you have an excellent background to understand C. This may sound a strange remark, but C is not as high level as many people would have you believe, which is one reason it tends to produce fast object code. A lot of concepts understood from assembler apply. In particular, pointers, which are often a source of confusion for people new to C are much more readily grasped as a concept when you already know about addressing modes like (a0), (a0)+, -(a0), (a0,d0.l*4) etc.
Before you even look at amigaos specific coding, you should be fully comfortable with functions, pointers, pointer casts (totally evil but essential for dealing with a lot of OS resources) and structures.
As you have worked with PHP, at least the brace syntax should be OK, as should be the notion of functions. A lot of people with experience only in basic struggle with C's universal function syntax which does not have a syntactical distinction between 'subroutines' and 'procedures'. A function may take parameters and either returns a value (procedure), or it doesn't (subroutine).
-
McVenco wrote:
I've programmed a very little bit in Basic, AMOS and assembler, but that's a long time ago.
What did you do in AMOS? I'm curious becuase I'm a member of the Mattathias Basic project (http://groups.yahoo.com/group/mattathias/) and we're trying to make Mattathias (son of Amos) function as an AMOS to C translator.
And I will most certainly have to take a look at the RKM's, I didn't know they were on the CD, so that's good news.
I also have a copy of "Amiga Intern 2.0", a German book (translated to Dutch) on coding, but that's pretty limited to WB1.3. I could be a good book for reference though..
I have that book in English. It's pretty repetitive but it will get you started. Just don't refer to it unless you are programming for AmigaOS 1.3. :lol: The RKRMs on the Developer CD and the AmigaOS 3.1 and 3.5 NDK will be most of the references you need on the Amiga side of things.
The biggest problem you'll run into is that most Amiga software is written in ANSI C but most of the tutorials today are based on C++. There may be functionality missing on Storm C++ since it preceeded the ratification of the ANSI standards of C++.
I don't use C++ unless I see a specific advantage to it since most of the stuff I do is either available in C or can be performed in object oriented code written in C (with a few function pointers here and there :-D ).
C++ is usually better when it comes to writing LARGE programs with interrelated parts. C is better for writing system-specific code for Amiga's varargs functionality (not available under strict C++ syntax).
-
If you can find a copy, I recommend a book called Complete Amiga C. I can't remember the specifics of exactly what it covers but I remember it included general C topics (language construct, syntax, stdlib, etc) as well as topics specific to Amiga coding.
Quick Google search for details on the book has just thrown-up this thread btw: http://www.amiga.org/forums/showthread.php?t=25144
if you're lucky "Spudley" might still have his copy ;)
Also, Aminet has the famous Amiga C Manual: http://aminet.net/dev/c/ACM.lha . This is mainly an Amiga specific programming guide, so if you haven't learn C yet then it's probably not a good place to start. Also, it is based on v1.3 Amiga libs, so no 3+ specific info. But once you've grasped the general Amiga system library/API concepts you can simply read the latest Autodocs from the AmigaSDK for newer details.
hope it helps
-
I found the Amiga C Manual by Anders Bjerin quite helpfull available here: http://aminet.net/package/dev/c/ACM#contents (http://Aminet/dev/c/ACM.lha)
-
:-x I'd recommend against any book prior to AmigaOS 2.04 since a LOT has changed since then. AmigaOS 3 has datatypes and memory pools but other than that it should be easy to pick up. Kickstart 1.3 didn't have varargs functionality that is essential for AmigaOS 2-3 (but not necessary on 4).
-
SamuraiCrow wrote:
The biggest problem you'll run into is that most Amiga software is written in ANSI C but most of the tutorials today are based on C++. There may be functionality missing on Storm C++ since it preceeded the ratification of the ANSI standards of C++.
If you get hold of StormC4, at least it's got a gcc 2.95.3 backend, so it tends to reasonably compile most stuff. However, it doesn't come with the C++ STL, though it is possible to kludge it in.
The main reason I'd reccommend StormC (any version) to a beginner is the IDE which really is very friendly (for more advanced projects it can rapidly become awkward, but by then you'll be on proper gcc/make ;-))
I don't use C++ unless I see a specific advantage to it since most of the stuff I do is either available in C or can be performed in object oriented code written in C (with a few function pointers here and there :-D ).
I've sort of gone past the point where I can stomach normal C code for most projects. I very rarely use it anymore, simply because the OOP paradigm is firmly entrenched in my noggin.
However, I agree you should use the right tools for the job. C is well suited for simple, OS native programs with not many source files.
The moment you find yourself making a lot of structures and functions to deal with them, you really ought to consider if C++ is the way to go.