Article 3546 of comp.sys.amiga.programmer: Path: leela!orstcs!rutgers!ub!galileo.cc.rochester.edu!rjw From: rjw@merlin.cvs.rochester.edu (Robert Wilson) Newsgroups: comp.sys.amiga.programmer Subject: Tips For The Beginning Amiga C Programmer Message-ID: <1992Sep1.160223.17477@galileo.cc.rochester.edu> Date: 1 Sep 92 16:02:23 GMT Sender: news@galileo.cc.rochester.edu Organization: University of Rochester, Rochester NY Lines: 213 Nntp-Posting-Host: merlin.cvs.rochester.edu Tips For The Beginning Amiga C Programmer Last Major modification: July 6, 1992 Disclaimer: most of this advice has _absolutely nothing_ to do with my opinions. I got all of this from other people on the net. Please do not blame me for any misleading or useless information. My place of employment, of course, has no connection to any of the opinions expressed here. I am in no way affiliated with Commodore Business Machines. I first made this article in October of 1991. I was a programmer who'd used a bunch of different computers, and operating systems, but was completely new to the Amiga. I posted an article asking for advice on what books to get, and any other general advice that people could offer. The first couple of drafts of this article were only filled with other people's opinions and ideas. Now I've added some of my own opinions, but all the ideas still come from other people. A word about future versions of this file: Obviously this file is incomplete. There are some things I've never heard of, and new programs and books coming out all the time. If you hear of something, please write to me and explain. General advice about programming the Amiga is also accepted. Comments like, "You listed such-and-such a book. I don't like it. I think it's a bad idea." don't do me much good. I list the books because SOMEONE ELSE recommended it. I'm not going to remove it just because you don't like it. If you want to warn *me*, I'll appreciate it. Otherwise it probably won't get passed on. ****************** AmigaDOS versions 1.3 and 2.0 ******************** This is an exciting, and sometimes frustrating time to be jumping into Amiga programming. The charming folks at Commodore have come out with a new version of the operating system: 2.0 (actually, they were up to 2.04 the last time I looked, but the major change was the "2"). There have been some additions made. As an example, gadgets (if you program macs, you call them "controls", if you program X Windows you call them "widgets") can now be programmed through something called gadtools. What this means to you, the user: Some programs you will encounter won't deal well with the change. It depends how they're written. Commodore tells you at many points in their documentation, "Don't rely on this feature to be consistent in future applications." Some people ignore that, and their programs crash in later systems. What this means to you, the programmer: Thankfully, most of what applies to AmigaDOS 1.3 still applies to 2.0. This means that if you get a book that explains how to program in version 1.3, the information will still apply for the most part. On the other hand, you'll miss out on all the new advances, and be behind the times. Your decision. In terms of which system to use: keep in mind that everybody is moving towards 2.0, so almost all of the books and code you'll see in the future will be 2.0 based. On the other hand, at the moment there are still a lot of people running 1.3 on their machines. It comes down to who you're writing for. If you want a wide-ranging current audience, keep 1.3 compatibility in mind. If you want what people *will* be using, or you're just writing for yourself and you want the most up-to-date system, use 2.0. What this means to me, the file writer: I have to try to keep in mind what resources apply to what version. If I mess up, please mail to me. ************************* Recommended books ************************* THE recommended books are the Rom Kernal Reference Manuals (more commonly called RKMs), put out by the folks at Commodore themselves. Unlike the Inside Macintosh books, where they tag on a new book each time a modification is made, and you have to check each book to see what it has to say about a given subject, the folks at Commodore have rewritten the RKMs entirely for the new version. When looking for them / ordering them, make sure you get the 2.0 versions (the ones with the black covers). Personally, I think the RKMs are really great. I find them complete, easy to understand, and written in a very easy-going style. (ISBN numbers thanks to a posting by Kevin Taddeucci) 1) "Includes and AutoDocs" (ISBN 0-201-56773-3) 2) "Libraries" (ISBN 0-201-56774-1) 3) "Devices" (ISBN 0-201-56775-X) Also, from the same series, get 4) _Amiga Hardware Reference Manual_ (ISBN 0-201-56776-8) 5) _Amiga User Interface Style Guide_ (ISBN 0-201-57757-7) The source code from the RKMs for AmigaDos 1.3 is on Fish disk 344, in archived form. Another recommended manual is _The AmigaDOS Manual_, from Bantam. The RKMs don't cover the disk operating system, so this is the official manual for AmigaDos. Books that give instruction are more varied. It depends on what level you're at, and what you want to learn. I'm told that a good book to learn from is _Programmer's Guide to the Amiga_ by Robert Peck. A *lot* of people recommended this one. The biggest controversy I've seen about books is whether the set that Abacus puts out are worthwhile. Just putting it in this article puts me at risk of starting a flame war. Let me just say that some people I've heard from really like them, and some people really, really hate them. The books I've seen so far are for AmigaDOS version 1.3, so be careful. Some of the Abacus books: _Amiga C for Beginners_ _Amiga C for Advanced Programmers_ _Advanced System Programmer's Guide_ _Amiga Graphics Inside and Out_ _Amiga System Programmers Guide_ Recommended magazines: Amazing Computing's Tech journal, P.i.M Publications -- 800-345-3360 Until recently there was an AmigaWorld technical journal, but a recent "business decision" has killed it. ************************* Other reference ************************* The Fred Fish disks (if you don't know what those are, read the FAQ sheet posted to comp.sys.amiga.intro, or mail to me for a copy of that FAQ sheet) have a C manual, in disks 456 and 457. WARNING: the advice contained therein is for versions previous to 2.0. On the other hand, they also contain lots of source code (annotated and commented), explanations of everything, and example programs. It's free (though you can send them a contribution if you want), so you don't have much to lose by trying it. ************************* C Compilers ************************* Okay, I'm sure I don't know all the C compilers there are out there. Feel free to mail to me with details (name, cost, where-to-get, gen'l comments) of ones I don't list. The 3 most mentioned in the Usenet Amiga newsgroups are SAS/C (a commercial compiler), Manx Aztec C (also commercial), and DICE, by Matthew Dillon. A crippled version of DICE is available in binary-only on Fred Fish disk 491. I've heard that even the crippled version is good, and that he only asks $50 for the full-fledged version. Not bad! I'm also told of HCC: Sozobon, available on Fish Disk 508. I'm told that there is limited documentation, but if you know C and compilers you should do alright. ************************* Misc advice ************************* Remember: this is not _my_ advice. These are things that people told me, and I'm passing on. 1) I'm told it used to be pretty easy to become a registered developer with commodore, but no longer. However, they come out with a mailing called AmigaMail that is highly recommended, and is available to non-developers as well as developers. Amigamail is available through CATS (Commodore Amiga Technical Support) and comes out every two months. To apply to become a registered developer, call CATS (Commodore Amiga Technical Support), which is (215) 431-9180 in the U.S.A., and request an application. Other materials are available for non-registered and users from Department C Commodore Business Machines Inc. 1200 Wilson Drive West Chester, PA 19380 2) For beautiful user interfaces, get PowerWindows. It lets you set up the interface graphically, and then produces code that you can compile. Pretty much guaranteed to save you a _lot_ of time. However, the last version that I saw is for AmigaDOS version 1.3, so the usual restrictions apply. Also, people used to using ResEdit on the Macintosh are bound to be disappointed. Another person recommended GadToolsBox, on Fish disk 570. Someone wrote saying there's something called TplEdit on Fish disk 583, which isn't as full featured as GadToolsBox "although it isn't bad", I'm told. One person from Sweden said that it was hard to get PowerWindows over there ("over here" to those of you reading this in Sweden :-), but this person uses PowerSource for the same purpose, available on Fish disk 547. 3) One person recommended CygnusEd Professional Release 2 from ASDG as a replacement for LSE, if you use SAS/C. Another recommended TurboText from OXXI. Yet another recommended DME (by Matt Dillon). Then there's AZ, on Fish disk 346. Seems like everyone has a favorite. A few more and I'll have to make a formal list. Those of you coming from other environments may be overjoyed to find that Commodore has included MicroEmacs with the 2.0 operating system. 4) When trying to write portable code, don't depend on hardware timing loops, since their execution varies greatly on various machines. You can use the system timer device, VBLANK, or the CIA registers. If using VBLANK, keep in mind what the refresh rate is on your monitor, and that there are people who won't have the same rate. 5) Don't make calls to system hardware. Tempting, yes, but additions and changes have already made a large number of programs obsolete. Don't let it happen to you! 6) There is a FAQ sheet for the Amiga newsgroups, available from random@presto.UUCP (the writer of the FAQ) rjw@cvs.rochester.edu (me) 7) People used to other platforms, especially Unix, may be pleased to know that the Free Software Foundation's GNU software (such as gcc, g++, and their version of emacs) are becoming more and more available as people port them to the amiga.