A-code library mode interface

This document is still under construction!

Normally, A-code games drive their own main loop, but various app frameworks insist on taking this functionality over. To cater for implementations based on such frameworks, A-code kernel has a library mode. When compiled in this mode, instead of having main(), it has a function called advturn(), which takes as its sole character string argument a a request (e.g. a player's command), and returns as its value a pointer to the game's response.

Examples of such builds are the emscripten-based HTML/Javascript build of Adv770 and Brian Ball's iOS build of the same game.

At present, there is on important restriction on A-code games to be built using the library mode: they cannot use the QUERY directive. Reasons for this restriction , as well as a workaround, can be found in a separate document describing the A-code CONTEXT mechanism.



Back to the A-code page

To the Mipmip home page
Feel free to leave a comment!
Mike Arnautov (20 February 2019)