Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

542 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GTAdhocToolchain

A toolchain for the Gran Turismo scripting language, Adhoc, from C#.

Adhoc is a scripting language that is used for roughly 99% of the entire games's logic, the native code serving mostly solely as the engine.

The toolchain contains the following:

  • Adhoc Script Preprocessor / Parser / Compiler / CodeGen (.ad -> .adc)
    • Supports adhoc bytecode version 5 (GT4), 7 (GT4O), 10 (GTHD), 12 (GTPSP/GT5/GT6/GT Sport)
  • Adhoc Project Builder
    • Compiles menu sources from a .yaml project file to .adc, .mproject, .mpackage
  • VS Code Extension for syntax highlighting & many snippets (useful!)
  • Menu Layout Reader/Serializer (.mproject/.mwidget)
  • Script and Menu Layout Packager (GT6 .mpackage)
  • Asset Packager (.gpb)
  • Script Disassembler (.adc to assembly-like syntax)
  • Compare scripts for dissasembly matching

Wiki

Refer to the Wiki for more information (compiler, language features, etc).

Current State

The toolchain is capable of compiling fully working original and custom projects (see OpenAdhoc).

TODOs

  • Improve syntatic analysis during compilation.
  • Possibly tests
  • API Documentation

Compiler accuracy

  • Implement short-circuit evaluation optimization such that LOGICAL_OR and LOGICAL_AND jump to the end of a statement rather than jump to the next LOGICAL_* instruction

Compiler

A fork of esprima-dotnet is used to lex and parse the Adhoc code into an abstract syntax tree prior to compiling.

About

Toolchain for the Gran Turismo scripting language, Adhoc, allowing fully custom game code.

Topics

Resources

Stars

27 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages