|
|
Native Atari development environment and sourcesContents:
IntroductionBelow is some information about C-compilers available for Atari and instructions on how to install two of them for plain TOS. First one (AHCC) provides an IDE GUI and second (VBCC) is used from command line. These instructions are geared towards using them within the Hatari emulator. That's why they're run on plain TOS as Hatari can in that environment emulate host file system for the Atari programs and "autorun" an Atari program on Hatari startup. Hatari is available for most Linux distributions directly from their own repositories. Windows binaries are available from Hatari download page and OSX binaries are provided by Hatari users. Atari C-compilersThere are/were several C compilers available for Atari ST/STE/TT/Falcon, both commerical and free. Best known of the commercial ones are Pure-C (Atari ST version of Borland Turbo C) and Lattice-C. Both of them provided GUI development environment and (I think) supported ANSI-C. There were (earlier) also some other compilers like Mark Williams C, Laser-C and a C interpreter from HiSoft. The free C compilers that I know of and have tested at some point are GCC, vbcc, c89, SozobonX and AHCC. Still relevant and updated ones are (from largest/slowest to smallest/fastest):
The differences between the GCC/VBCC and AHCC compilers which can be visible in the sources are the default int size (in AHCC it's 16-bit, in GCC 32-bit) and how their Atari specific include files and libraries are named (osbind.h vs. tos.h, gem.h vs. vdi.h + aes.h). While AHCC and VBCC work fine with plain TOS, GCC usage would really need a unix-like directory hierarchy and command line environment. On Atari latter requires MiNT, the multitasking Unix-like extension to the Atari TOS which was shipped as kernel for the MultiTOS operating system for the newer Atari machines (Falcon etc). AHCC setup for Hatari emulatorBelow you will find a ready-made package containing:
(AHCC, Digger and EmuTOS are GPL v2 and latest versions as of 2012-10-15, ST-Guide is ancient "fairware". Both AHCC and Digger are by Henk Robbers.) After you've installed Hatari and extracted above tar.gz file, run the hatari-gui.sh script included in it. That will change to the AHCC develepment directory, run Hatari from there with the included hatari.cfg configuration file and EmuTOS ROM, and asks Hatari to start the AHCC IDE. If you drag (or otherwise give) the script its directory name, Hatari will just mount that directory as C: drive without running any programs. In that case, Hatari (actually EmuTOS, according to emudesk.inf configuration file) will open a window from which you can start AHCC IDE version suitable for your selected Atari machine type. Programs in Atari desktop can be started by double clicking on their icons. In Hatari, mouse middle-click emulates double click and that works even if you're running Hatari in fast-forward mode (toggled with AltGr+X shortcut). The different AHCC IDE programs are:
If you've linked hatari-gui.sh on your desktop, you can just drag an Atari program to Hatari icon on your desktop, to run that program in Hatari with the included development environment settings. Or you can give the program as argument to Hatari on console to see any error etc. messages, like this: hatari-gui.sh ./ahcc.prgAfter experimenting a bit with the AHCC IDE, building the included "Hello World" program and viewing the AHCC documentation with ST-Guide (under "Desk" menu), you can check my Atari programs page for binaries and source code to some free GEM/monochrome games which I've either developed myself or ported to ANSI-C and AHCC. NotesAHCC shortcomings:
Hatari settings used by the included configuration file are suitable only for running text programs and resolution independent GEM programs, not games or demos because settings use a (larger) non-standard VDI graphics resolution. To run other kind of Atari programs, run Hatari directly without the script and the included hatari.cfg file. While AHCC project files (which tell AHCC how to build the binaries from sources) are independent of any Hatari options, the AHCC specific Makefiles which I've included for automating AHCC building outside of Hatari expect:
hmake.sh script uses Hatari and Gulam to do the building and will overwrite its gulam.g startup script for this purpose. Because of this, it's better if you don't mix AHCC setup with the VBCC setup below. (I'd recommend you just to use the *.PRJ project files from AHCC IDE, instead of using AHCC from command line.) VBCC setup for Hatari emulatorBelow you will find a ready-made package containing:
(EmuTOS, GNU make, binutils and mintbin tools are GPL, but may link statically code that has other open source licenses, see MiNTlib license information for details. VBCC and Gulam are freeware for non-commercial use.) After you've installed Hatari and extracted above tar.gz file, run the hatari-cli.sh script included in it. That will change to the AHCC develepment directory, run Hatari from there with the included hatari.cfg configuration file and EmuTOS ROM, and asks Hatari to start the Gulam shell with which you can build your programs. After you've added some source code, you can "cd" to its subdirectory and build it with "make" command, if source has a Makefile for that. Many of the programs on my Atari programs page contain Makefiles for several different compilers. In that case you need to specify "make" which one to use: make -f makefile.vbcc If there's a single Makefile, it's VBCC support may be enabled with: make CC=vc For more info on "make" and other tools included to the package's bin/-directory, see the manual pages on your Unix host for the corresponding tools, or call them with -h or --help option. VBCC usageVBCC has a frontend similar to "gcc", called "vc". You call "vc" and it calls the backend compiler, assembler and linker binaries with appropriate options, when needed, based on the given argument file name/type. Options for the binaries called by "vc" are set up in VBCC config files that reside in the vbcc/config/ directory. To use a different compiler configuration, you don't specify options for the backend binaries, but give "vc" the name of the configuration file where these are set up, prefixed with "+". For example "+cf" for ColdFire compilation. "vc" frontend supports similar basic options (-Ox, -v) as "gcc". For more on information, see the PDF documents in vbcc/doc/-directory. Gulam usageWhile Gulam is fairly similar to POSIX compatible shells on e.g. Linux, it's much earlier and has some gotchas. Its commands have only few options, keyboard layout is american and doesn't support numeric keyboard etc. Gulam shell supports directory & filename TAB completion and command line editing. Some keyboard shortcuts (that work also in Linux shells):
Ctrl-A and Ctrl-E are useful because moving past line endpoints will in Gulam give you next/prev line in history ring buffer instead of stopping. Although Gulam doesn't support multitasking, you can "suspend" the 'ue' editor with ^Z to go to shell and run other commands and then use 'fg' command to get back into editor. For more information, see the gulam/gulamdoc/gulam.inf text document. VBCC / Gulam shortcomingsVBCC shortcomings:
Gulam shortcomings:
MiNT notesLater on I might consider make another package containing MiNT kernel, basic command line utilities, GCC toolchain, at least MiNT + GEM libraries and RPM package management, which one could convert into a harddisk image with Hatari atari-hd-image script. However, that would be a much larger package, even with no Perl and locale data remove it's nearly 80MB uncompressed (because MiNT doesn't support shared libraries). In the meanwhile, please look into ARAnyM / AFROS or other readymade Aranym setups. Unfortunately those have mainly just MiNT and multitasking AES + corresponding Aranym setup, they're are missing the GCC toolchain and most of unix setup necessary for building software, but you can get those with above rpm2cpio trick. For more information on MiNT today, see information on FreeMiNT (kernel) and SpareMiNT (distribution), and XaAES (multitasking AES). VBCC under Aranym/MiNT
![]() VBCC toolchain running under Aranym AFROS |
Copyright © 2006-2017 by Eero Tamminen