Skip to content

rofl0r/ascc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ascc - standalone AGS script compiler
-------------------------------------

about
-----

script compiler factored out from AGS ags3 branch[0], and equipped with a
C-compiler-like command line frontend.

the preprocessor which was long ago ripped off the original C++ code and turned
into C#-windows-only code has been restored from old git history of around 2012.
therefore it's possible that the preprocessor behaves slightly different than
the one shipping with the GUI.

current status:
`ascc` can be used to compile .asc files into binary .o files.
these in turn can be used with agsutils[1] agsdisas disassembler and
agsinject utilities for updating ags' binary .crm or .dat files.
(read agsutils README for more details).

as a bonus over the standard compiler embedded in the AGS editor software,
this version has been enhanced with the following features:

- ability to run different preprocessor (like C preprocessor with support
  for #include, function-like macros, etc.

- support for C-style char* pointers. this allows one to write fast
  low-level code for agssim, or even for ags games, circumventing the
  "managed" OOP bloat.
  (currently, such pointers need to be dereferenced with [] operator).

build
-----

install a C++ toolchain, then run

    make -jN

where N corresponds to the number of CPU cores in your machine.
buildtime should be roughly 10 secs with one core.

usage
-----

ascc [OPTIONS] FILE.asc
compiles FILE.asc to FILE.o
OPTIONS:
-i systemheaderdir : provide path to system headers
   this is the path containing implicitly included headers (atm only agsdefns.sh).
-H 1.ash[:2.ash...] : colon-separated list of headers to include.
   order matters. AGS editor automatically includes all headers
   it finds in the game dir, but here you need to specify them.
-o filename : explicitily specify output file name
-P preprocessor : use `preprocessor` on files before running the built-in
   one on them. example: -P "cpp -P". note that you if you use a
   standard C preprocessor, linenumber directives need to be supressed
   as in the example cpp command.
-D macro[=val] : define preprocessor macro
-E : run preprocessor only (create file with .i extension)
-W : warn about non-fatal errors parsing system headers
-g : turn on debug info
-S : write textual assembly instead of binary (requires agsdisas)

---
[0]: base commit: c38b937273f21ec6002cde1dec9b1bead5f7833c.
[1]: https://github.com/rofl0r/agsutils