Menu

Compiler

 
      The compiler working panel features an fully integrated development environment (IDE) that provides comprehensive facilities to programmers for GPC scripting development. It consists of a source code editor, syntax highlighting, integrated GPC compiler and a testing tools. The compiler translates a high-level GPC code into a very simple bytecode, that later is executed by the virtual machine of Titan One device. The GPC compilation process eliminates a number of costly operations that interpreter has to perform, which means an improvement of a factor of 10 in speed if compared with an regular interpreted language.
 
      To compile a GPC script first open the script in the source code editor and then press F7 (or click on Compile icon), the Output area will show the compilation result, such as errors and warnings found in the source code, the bytecode size and the stack memory usage.
 
Compiler
 
1

Compiler Tab Bar

1. Compiler Tab Bar
The compiler tab bar allows you to select between different opened GPC scripts. The first 9 GPC scripts in the tab bar receive a number, which correspond to the memory slot that the script will be stored in the Titan One device when running the  command "Program Device". You can rearrange the order of GPC scripts in the tab bar by dragging and drop they. When you make changes in the source code an asterisk (*) will be displayed in the tab title, indicating the file was not saved yet.
 
2

GPC Code Editor

2. GPC Code Editor
The compiler editor is designed to edit GPC souce code files, allowing text formatting, search and real-time syntax highlight. Highlighting ensures that the code elements are displayed in different colors based on the GPC language syntax, this greatly improves the readability of the code and makes it easier to spot and avoid mistakes.
 
3

Compiler Output

3. Compiler Output
The compiler output area shows the compilation result of the active GPC source code. The compilation process can be started in many ways, from the usual Compile command, passing through the "Build and Run", "Program Device" and others commands, up to a request from a plugin. Regardless of how the compilation process was started, the results will always be displayed in the output area.
 
The results of a compilation process consist of: warnings and errors messages, the size of bytecode and the amount of stack memory used by static variables and combos. Inside of parentheses you can find the percentage used of the maximum allowed. Keep in mind that warning messages are also a kind of error. For example write a value out of range into a variable may cause unexpected behaviors and be very hard to debug. It is highly advisable find and fix all warning problems.
 
4

Editor Status Bar

4. Editor Status Bar
The status bar shows additional information about the currently active GPC script editor. The first two sections are the current line (Ln, first line is line 1) and the current column (Col, first position is 1). The last section shows the current overtype status. INS means insertion and OVR means overtype. Pressing the key Insert of your keyboard switches between insertion and overtype typing mode, the displayed cursor will change it's shape accordingly.
 
5

Compile

5. Compile
The compile command, as its name implies, compiles the active GPC source code. It is primarily used to verify if the script has lexical or syntactical errors and warnings. The compile command can also be executed by the shortcut key F7.
 
6

Build and Run

6. Build and Run
The command "Build and Run" (shortcut key F5) compiles the active GPC source code and load its bytecode directly into device's RAM. The GPC VM will automatically run the loaded bytecode, so you can test your script on-the-fly and check all the inputs and outputs using the Device Monitor. You can set a configuration to automatically open the Device Monitor on the Gtuner options.
 
The LED display will change to a two bar sign, indicating a script (technically its bytecode) was loaded by the "Build and Run" command.
 
This command is only available when the Titan One device is connected to your computer by the PCPROC side port, through a USB cable.
 
7

Publish Script

7. Publish Script
You can share your GPC script with the Titan One community by publishing it in our database. But before publishing your script, make sure you have tested it and it runs without any errors. Click on the "Publish Script" command to open the publishing form in your default browser. Please fill all required fields correctly before submit it. A published script will be available for download in the Online Library of the Gtuner program.
 
8

Export Bytecode

8. Export Bytecode
The bytecode of a GPC script can be exported to a file. This feature is used by the Titan One team to publish Gamepacks and currently does not have a real application for the users.
9

Program Device

9. Program Device
You can store up to 9 GPC scripts (technically its bytecode) into memory slots of Titan One device, thus you can access your favorite scripts without the needing of a PC. The first 9 GPC scripts in the compiler's tab bar get a number which correspond to the memory slot in which it will be stored. The order of the scripts in the tab bar can be changed via drag and drop.
 
The command "Program Device" will compile these scripts, any compilation errors will abort the operation. The produced bytecodes are saved into a special structure and a wizard window will be opened to guide you through the device programming process, as show in the next picture.
 
After the programming process you can run your script by selecting the correspondent slot number in your Titan One device. At this point you don't need have your device connected to your PC anymore.
 
 
The LED display will show the currently active slot number.