Creating ANSI C sources from the A-code source(A-code acdc version 12.91)Contents
A-code sourceLogically, an A-code source is a single file, usually with the .acd suffix. The suffix is optional; if present, it can be omitted when nominating to acdc the A-code file to be processed. In practice, A-code source can be split into a number of files, which are incorporated in the "main" one by means of the A-code include major directive. Again, such include files are conventionally suffixed with .acd, which suffix may be omitted in include statements. A-code frameworkTo build a working executable out of A-code source, you need A-code kernel files, available as a part of the acode system source tarball https://mipmip.org/acode/acode-12.91.html. This tarball contains C sources of the latest releases of the acdc translator and of the A-code kernel, as well as some useful bash scripts. See that page for details. If you are using Linux, Unix, OSX/MacOS or Microsoft's LSW, the simplest thing to do is to use the advbld bash script supplied as a part of the acode source tarball – please see the README file contained therein. However, if you are using some other platform, you will probably need to build and use acdc yourself. The rest of this document explains how to do that. Building the acdc translatorTo build the acdc executable you need only an ANSI C compiler. Simply compile and link the relevant C sources – no libraries or special compilation or linking options required: cc *.c -o acdc Using the acdc translator
By default, any resulting C sources (adv The acdc translator needs no command line arguments. If some are supplied, they can be given in any order. If the game source-file is omitted, it is prompted for. All other command line listed below are optional – default behaviour covers all usual cases.
By default, the game's text data is preloaded into the executable. These days only very old and/or small machines are unhappy with the size of the resulting executable. However, if the default behaviour is for any reason not the suitable one, there are three further deprecated command line options that can be used.
Adding kernel source filesThe A-code kernel consists of source files adv00.c, adv01.h and adv0.h. All three can be found in the A-code source tarball. Copy them alongside the C sources created by acdc, and you will have the complete C source required to build an executable. Building an executableBuilding a simple adventure executable from the derived C sources is not complicated: just compile and link the lot together with any ANSI C compiler, adding -DNO_READLINE to the command line. The resulting executable will default to using a local browser for its display (except for DOS builds). But it will lack command history and editing in the console mode. If you cannot use a browser or prefer not to, you can also run such default build from a console window by adding -C (or /C on DOS and Windows) to the invocation command line. If that's good enough for you, fine, but if you hit problems, or want a more sophisticated version, read the guide to building A-code games from intermediate C sources.
|