Difference between revisions of "AGI Interpreter"
m (Andrew Branscom moved page The AGI Interpreter to AGI Interpreter) |
|||
(20 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | The '''interpreter''' reads the [[Logic | logic resources]] that are a part of an AGI game and uses them to run the game. Logic resources are compiled into a bytecode which has meaning to the interpreter. | + | The '''interpreter''' reads the [[Logic Resource|logic resources]] that are a part of an AGI game and uses them to run the game. Logic resources are compiled into a bytecode which has meaning to the interpreter. |
− | For example, the logic commands: | + | For example, the [[:Category:Logic Commands|logic commands]]: |
− | < | + | |
+ | <div class="CodeBlockHeader">Code:</div> | ||
+ | <syntaxhighlight lang="agi"> | ||
v202 = 35; | v202 = 35; | ||
set(f98); | set(f98); | ||
− | </ | + | </syntaxhighlight> |
+ | |||
translate into the sequence of numbers <code>3 202 35 12 98</code>, or (for those who like hexadecimal notation) <code>03 CA 23 0C 62</code>. The [[Assignn | assignn]] command has a bytecode of <code>3</code>, the command is working with [[Variable | variable]] number <code>202</code>, and the variable is being assigned the number 35. The [[Set | set]] command, with bytecode 12, is going to set [[Flag | flag]] number <code>98</code>. When the interpreter reads these codes, it performs the actions that it knows correspond to those codes – this is the part that is called "interpreting." | translate into the sequence of numbers <code>3 202 35 12 98</code>, or (for those who like hexadecimal notation) <code>03 CA 23 0C 62</code>. The [[Assignn | assignn]] command has a bytecode of <code>3</code>, the command is working with [[Variable | variable]] number <code>202</code>, and the variable is being assigned the number 35. The [[Set | set]] command, with bytecode 12, is going to set [[Flag | flag]] number <code>98</code>. When the interpreter reads these codes, it performs the actions that it knows correspond to those codes – this is the part that is called "interpreting." | ||
As this example shows, the AGI bytecode is not especially complicated, and is for the most part a simple translation of commands to numbers. Having the bytecode allows the interpreter to avoid translating the textual logic code every interpreter cycle. It also allows AGI compilers to use their own syntax, which means that the C-style syntax is not the only possible syntax. There is nothing preventing the command <code>set(f98)</code> from being written as <code>f98.set()</code> other than the need for a compiler to be written that translates <code>f98.set()</code> into the bytecode <code>12 98</code>. | As this example shows, the AGI bytecode is not especially complicated, and is for the most part a simple translation of commands to numbers. Having the bytecode allows the interpreter to avoid translating the textual logic code every interpreter cycle. It also allows AGI compilers to use their own syntax, which means that the C-style syntax is not the only possible syntax. There is nothing preventing the command <code>set(f98)</code> from being written as <code>f98.set()</code> other than the need for a compiler to be written that translates <code>f98.set()</code> into the bytecode <code>12 98</code>. | ||
− | The interpreter runs in cycles, which means that a game is essentially one giant loop that keeps running until the player quits, the game is completed, or an error occurs. See [[Interpreter cycle | interpreter cycle]] for more details on what occurs during a cycle. | + | The interpreter runs in cycles, which means that a game is essentially one giant loop that keeps running until the player quits, the game is completed, or an error occurs. See [[Interpreter cycle | interpreter cycle]] for more details on what occurs during a cycle. |
+ | |||
+ | | ||
+ | |||
+ | == Interpreters == | ||
+ | |||
+ | While Sierra's interpreters as original and real things run AGI-games as they should be within boundaries of the 256 byte memory, newer fanmade interpreters tend ignore such trivial issues among other things. The downside with Sierra's interpreters is that the technology those were built once is becoming ancient history and running them on modern hardware is either impossible or requires meddling with special software in the middle, e.g. DOSBox, in order to interpreter thus the game function properly. The newer interpreters support more features, platforms and operating systems, however running AGI games does not always go as it should. | ||
+ | |||
+ | * [[AGIL|AGIL]] | ||
+ | * [[GBAGI|GBAGI]] | ||
+ | * [[JAGI|JAGI]] | ||
+ | * [[Java AGI|Java AGI]] | ||
+ | * [[LAGII|LAGII]] | ||
+ | * [[MEKA|MEKA]] | ||
+ | * [[NAGI|NAGI]] | ||
+ | * [[Sarien|Sarien]] | ||
+ | * [[ScummVM|ScummVM]] | ||
+ | | ||
==Related links== | ==Related links== | ||
Line 16: | Line 36: | ||
* [[AGI]] | * [[AGI]] | ||
* [[Running AGI Games]] | * [[Running AGI Games]] | ||
− | * [[Hacked | + | * [[:Category:Hacked AGI Interpreters|Hacked interpreters]] |
* [[NAGI]] | * [[NAGI]] | ||
* [[Sarien]] | * [[Sarien]] | ||
Line 25: | Line 45: | ||
* [[LAGII]] | * [[LAGII]] | ||
* [[JAGI]] | * [[JAGI]] | ||
+ | |||
+ | | ||
+ | |||
+ | [[Category:AGI Interpreter]] | ||
+ | [[Category:Third Party AGI Interpreters]] |
Latest revision as of 17:13, 14 April 2019
The interpreter reads the logic resources that are a part of an AGI game and uses them to run the game. Logic resources are compiled into a bytecode which has meaning to the interpreter.
For example, the logic commands:
<syntaxhighlight lang="agi"> v202 = 35; set(f98); </syntaxhighlight>
translate into the sequence of numbers 3 202 35 12 98
, or (for those who like hexadecimal notation) 03 CA 23 0C 62
. The assignn command has a bytecode of 3
, the command is working with variable number 202
, and the variable is being assigned the number 35. The set command, with bytecode 12, is going to set flag number 98
. When the interpreter reads these codes, it performs the actions that it knows correspond to those codes – this is the part that is called "interpreting."
As this example shows, the AGI bytecode is not especially complicated, and is for the most part a simple translation of commands to numbers. Having the bytecode allows the interpreter to avoid translating the textual logic code every interpreter cycle. It also allows AGI compilers to use their own syntax, which means that the C-style syntax is not the only possible syntax. There is nothing preventing the command set(f98)
from being written as f98.set()
other than the need for a compiler to be written that translates f98.set()
into the bytecode 12 98
.
The interpreter runs in cycles, which means that a game is essentially one giant loop that keeps running until the player quits, the game is completed, or an error occurs. See interpreter cycle for more details on what occurs during a cycle.
Interpreters
While Sierra's interpreters as original and real things run AGI-games as they should be within boundaries of the 256 byte memory, newer fanmade interpreters tend ignore such trivial issues among other things. The downside with Sierra's interpreters is that the technology those were built once is becoming ancient history and running them on modern hardware is either impossible or requires meddling with special software in the middle, e.g. DOSBox, in order to interpreter thus the game function properly. The newer interpreters support more features, platforms and operating systems, however running AGI games does not always go as it should.
Related links