Outils pour utilisateurs

Outils du site


agi-game:specifications-resources

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
agi-game:specifications-resources [2021/05/24 15:01] – [Opcodes] frateragi-game:specifications-resources [2023/04/13 09:50] (Version actuelle) frater
Ligne 1: Ligne 1:
-====== Logic resources ======+====== AGI Specifications Resources : Logic resources ======
  
-===== Introduction =====+==== Introduction ====
  
-At the heart of Sierra'Adventure Game Interpreter is the logic file. +Au cœur de l'AGI (Adventure Game Interpreter) de Sierra se trouve le fichier "logique".
-These files contain the code that makes up the game. Each room has a logic script that goes with it. This logic script governs what can take place in that room. Here is an example of what the programmer writes when a game is being created.+
  
-Example: KQ4. Room 7.+Ces fichiers contiennent le code qui compose le jeu. Chaque pièce est accompagnée d'un script logique. Ce script logique régit ce qui peut se passer dans cette salle.  
 + 
 +Voici un exemple de ce que le programmeur écrit lors de la création d'un jeu. 
 + 
 +Exemple: KQ4. Room 7.
  
 <code C> <code C>
Ligne 41: Ligne 44:
 ===== Command list and argument types ===== ===== Command list and argument types =====
  
-Following tables show a list of all AGI commands and their argument types. The command names have been taken from debug messages contained in some AGI games.+Les tableaux suivants présentent une liste de toutes les commandes AGI et de leurs types d'arguments 
 + 
 +Les noms des commandes sont tirés des messages de débogage contenus dans certains jeux AGI.
  
 ^  Opcode   ^ Command            Args    1      ^  2      3      4      5     ^ ^  Opcode   ^ Command            Args    1      ^  2      3      4      5     ^
Ligne 253: Ligne 258:
  
  
-==== The header ====+==== le header ====
  
-The header of each logic script is seven bytes in length for games before 1988. After this date compression seems to have been introduced and the header was subsequently alteredThis compression will be +L'entête (Header) de chaque script logique a une longueur de sept octets pour les jeux antérieurs à 1988. 
-discussed at a later stage.+ 
 +Après cette date, une compression semble avoir été introduite et l'en-tête a été modifié par la suite.  
 + 
 +Cette compression sera discutée ultérieurement.
  
 ^ Offset   ^ Command                                       ^ ^ Offset   ^ Command                                       ^
 | 0-1      | Signature (0x12--0x34)                        | | 0-1      | Signature (0x12--0x34)                        |
-| 2        | Vol number that the resource is contained in  +| 2        | Numéro du volume dans lequel la ressource est contenue 
-| 3-4      | Length of the resource without the header     +| 3-4      | Longueur de la ressource sans l'entête   
-| 5-6      | Offset of logic code message section          |+| 5-6      | Décalage de la section des messages du code logique          |
  
-All text that can be printed to the screen from within a logic script is stored in an encrypted form at the end of the logic script.+Tout le texte qui peut être imprimé à l'écran à partir d'un script logique est stocké sous une forme cryptée à la fin du script logique.
  
-Example: KQ1. Room 2.+Exemple: KQ1. Room 2.
  
 <code> <code>
Ligne 276: Ligne 284:
  
 ==== Opcodes === ==== Opcodes ===
-The logic code section starts immediately after the header and continues until the start of the message section has been reached. There are three sets of codes used in a logic script. Most codes will have between one and seven arguments inclusive. This is discussed later on. 
-The first set of codes is the AGI commands themselves listed in the previous tables, and they have the range 0x00--0xB6. 
  
-The second set of codes is as follows:+La section du code logique commence immédiatement après l'en-tête et se poursuit jusqu'au début de la section du message.  
 + 
 +Trois séries de codes sont utilisées dans un script logique.  
 + 
 +La plupart des codes ont entre un et sept arguments inclus. Nous y reviendrons plus loin. 
 + 
 +La première série de codes correspond aux commandes AGI elles-mêmes énumérées dans les tableaux précédents et se situe dans la plage 0x00--0xB6. 
 + 
 +La deuxième série de codes est la suivante :
  
 ^ Code  ^ Command               ^ ^ Code  ^ Command               ^
Ligne 287: Ligne 301:
 | FC    | **or**                | | FC    | **or**                |
  
-At present these are the only high value codes encounteredThe ''if'' and ''or'' codes are like brackets, i.e. the code will be at the start and the end of the section of codes that it refers toThe following example will illustrate this:+À l'heure actuelle, ce sont les seuls codes de grande valeur que l'on rencontreLes codes //if// et //or// sont comme des parenthèses, c'est-à-dire que le code sera au début et à la fin de la section de codes à laquelle il se réfèreL'exemple suivant l'illustre :
  
-Example: KQ1, Room 2.+Exemple: KQ1, Room 2.
  
 <code C> <code C>
Ligne 298: Ligne 312:
 </code> </code>
  
-The above translates to:+que l'on peut traduire comme ci-dessous:
  
 <code C> <code C>
Ligne 304: Ligne 318:
 </code> </code>
  
-which tests whether flag number is setThe 0xFF effectively switches the interpreter into a condition checking mode which leads us to the set of codes listed in tables+ce code test si le "flag" numero est actif. 
 +Le ''0xFF'' fait passer l'interpréteur en mode de vérification des conditions, ce qui nous amène à la série de codes énumérés dans les tableaux suivants
  
 <code> <code>
  0x00 - 0x12    Condition codes.  0x00 - 0x12    Condition codes.
 </code> </code>
 +Lorsque l'interprète rencontre un ''0xFF'', il interprète les valeurs de code suivantes comme étant dans la plage de codes de condition jusqu'à ce qu'il rencontre le ''0xFF'' suivant, ce qui le ramène en mode de commande AGI normal. normal de l'AGI. 
  
-When the interpreter encounters a 0xFF it will then interpret the following code values as being in the condition code range until it encounters the next 0xFF which switches it back into normal AGI command +Les deux octets qui suivent immédiatement le deuxième ''0xFF'' déterminent le nombre d'octets que dure cette instruction //if// avant que le //if// ne se termine.  
-mode. The two bytes immediately following the second 0xFF determine how many bytes this ''if'' statement lasts for before the ''if'' is ended.  When the second 0xFF is encountered the interpreter, be it +
-us or the machine, does three things:+
  
-  - Reads in the following two bytes. +Lorsque le deuxième ''0xFF'' est rencontré, l'interprète, que ce soit nous ou la machine, fait trois chosesl'interprète, que ce soit nous ou la machine, fait trois choses :
-  - Opens a bracket. +
-  - Switches to AGI command mode.+
  
-Example: KQ1, Room 2.+  - Il lit les deux octets suivants. 
 +  - Il ouvre une parenthèse. 
 +  - Il passe en mode de commande AGI. 
 + 
 +Exemple: KQ1, Room 2.
  
 <code C> <code C>
Ligne 331: Ligne 347:
 </code> </code>
  
-==== The ''else'' command and more on brackets ====+==== la commande **else** et plus sur les parenthèses ====
  
-The ''else'' statement will always continue after an ''if'' bracket block. This next feature is important and has caused a number of hassles in the past. When an ''else'' statement follows an ''if'', then the bracket distance given after the ''if'' statement //will be three bytes longer// (this is a consequence of the way the interpreter handles ''if'' and ''else'' codes which is discussed later).+L'instruction **else** continue toujours après un bloc de crochets **if**
  
-Here's an example:+Cette caractéristique est importante et a causé un certain nombre de problèmes dans le passé.  
 + 
 +Lorsqu'une instruction **else** suit une instruction **if**, la distance entre les crochets après l'instruction **if** //sera plus longue de trois octets// (ceci est une conséquence de la manière dont l'interpréteur gère les codes **if** et **else**, ce qui est discuté plus loin). 
 + 
 +voici un exemple:
  
 <code C> <code C>
Ligne 352: Ligne 372:
 </code> </code>
  
-Usually you would expect the bracket distance to be 0x0002 but in the above case it is clearly 0x0005 which illustrates the difference between a straight ''if'' statement and an ''if..else'' structure. The situation is the same for nested ''if..else'' structures. 
  
-The ''else'' statements themselves are a lot like ''if'' statements except that they're test condition is given after the 0xFE code but is instead the inverse of the condition given by the above ''if'' statementOnly the bracket distance is given after the 0xFE code and then the AGI command clock that the ''else'' statement encompasses.+En général, on s'attend à ce que la distance entre les crochets soit de 0x0002, mais dans le cas ci-dessus, elle est clairement de 0x0005, ce qui illustre la différence entre une instruction **if** directe et une structure **if..else**
  
-==== Test conditions ====+La situation est la même pour les structures **if..else** imbriquées.
  
-Conditions can be one of the following types:+Les instructions **else** elles-mêmes ressemblent beaucoup aux instructions **if**, sauf que leur condition de test est donnée après le code ''0xFE'', mais est l'inverse de la condition donnée par l'instruction **if** ci-dessus.  
 + 
 +Seule la distance entre les crochets est donnée après le code ''0xFE'' et ensuite l'horloge de commande AGI que l'instruction **else** englobe. 
 + 
 +==== Test de conditions ==== 
 + 
 +Les conditions peuvent être de l'un des types suivants:
  
 <code> <code>
- FF 07 05 FF                         One condition testedie. isset(5) + FF 07 05 FF                         Une condition testéec'est-à-dire isset(5) 
- FF FD 07 05 FF                      One condition NOTedie. !isset(5) + FF FD 07 05 FF                      Une condition Inversée (NOT)c'est-à-dire !isset(5) 
- FF 07 05 07 06 FF                   Multiple conditions, ANDed+ FF 07 05 07 06 FF                   Plusieurs conditions, liée par un ET logique (AND)
- FF FC 07 05 07 06 FC FF             Multiple conditions ORed.+ FF FC 07 05 07 06 FC FF             Plusieurs conditions, liée par un OU logique (OR).
  FF FC 07 06 07 06 FC FD 07 08 FF    Combination.  FF FC 07 06 07 06 FC FD 07 08 FF    Combination.
 </code> </code>
  
-These conditions translate to:+Ces conditions se traduisent comme ceci:
  
 <code C> <code C>
Ligne 378: Ligne 403:
 </code> </code>
  
-If multiple boolean expressions are grouped togetherthen there respective values are ANDed togetherIf multiple boolean expressions are grouped together and then surrounded by a pair of 0xFC codes, then +Si plusieurs expressions booléennes sont regroupéesleurs valeurs respectives sont combinées ensemble par un ET logique (AND) 
-their values are ORed together.+ 
 +Si plusieurs expressions booléennes sont regroupées et entourées d'une paire de codes ''0xFC''leurs valeurs sont combinées. leurs valeurs sont combinées par un OU logique (OR). 
 + 
 +Le code ''0xFD'' ne s'applique qu'au code de condition suivant dont il inverse la valeur booléenne.
  
-The 0xFD code only applies to the following condition code whose boolean value it inverts. 
  
 ==== Arguments ==== ==== Arguments ====
-You may well be asking how the interpreter knows how many arguments each code has and what type of argument each argument isThis information is stored in <tt>agidata.ovl</tt> in the MS-DOS version.  +Vous vous demandez peut-être comment l'interpréteur sait combien d'arguments possède chaque code (ou fonction) et quel type d'argument est associé à chaque argument.  
-Inside this file there is table which contains four bytes for each AGI command and condition code. These four bytes are interpreted as follows:+ 
 +Cette information est stockée dans le fichier ''agidata.ovl'' de la version MS-DOS.  
 + 
 +Dans ce fichier, il y un tableau qui contient quatre octets pour chaque commande AGI et chaque code de condition 
 + 
 +Ces quatre octets sont interprétés comme suit :
  
 ^ Offset   ^ Description                     ^ ^ Offset   ^ Description                     ^
-| 0-1      | Pointer to implementation code  | +| 0-1      | Pointeur vers le code de mise en œuvre  | 
-| 2        | Number of arguments             | +| 2        | Numbre d'arguments             | 
-| 3        | Type of arguments               |+| 3        | Type d'arguments               |
  
-The type of arguments value is interpreted as follows:+Le type de valeur des arguments est interprété comme suit :
  
 +<code>
  Bit        7                               0  Bit        7                               0
  command( arg1, arg2, arg3, arg4, arg5, arg6, arg7); (unknown)  command( arg1, arg2, arg3, arg4, arg5, arg6, arg7); (unknown)
 +</code>
  
-If the bit is set, argument is interpreted as a variable; otherwise +Si le bit est activél'argument est interprété comme une variable ; sinon, l'argument est interprété comme un nombre 
-the argument is interpreted as a numberIt is unknown what bit 0 does + 
-since no AGI command or AGI condition code has more than seven arguments.+La fonction du bit 0 n'est pas connue, car aucune commande AGI ni aucun code de condition AGI n'a plus de sept arguments.
  
 Examples: Examples:
  
-*0x80 Says that the commands first argument is a variable. +  * 0x80 Indique que le premier argument de la commande est une variable. 
-*0x60 Says that the second and third arguments are variable numbers.+  * 0x60 Indique que les deuxième et troisième arguments sont des nombres variables.
  
-===The messages section=== +==== la section messages ====
-The messages section of a logic script contains all the strings that can +
-be displayed by that logic script. These strings are encrypted by +
-xor'ing every eleven bytes with the string "Avis Durgan".+
  
-Example: KQ1, Room 2.+La section des messages d'un script logique contient toutes les chaînes qui peuvent être affichées par ce script logique
  
-<code type="C++">+Ces chaînes sont cryptées par **XOR** tous les onze octets avec la chaîne "Avis Durgan"
 + 
 +Exemple: KQ1, Room 2. 
 + 
 +<code C>
 if (said(look, alligators)) if (said(look, alligators))
 { {
Ligne 420: Ligne 455:
 </code> </code>
  
-In the above examplethe print statement is represented as:+Dans l'exemple ci-dessusl'instruction d'impression est représentée comme suit :
  
 +<code>
  65 08  65 08
 +</code>
 +
 +Le ''0x08'' est le numéro attribué à la chaîne et correspond à sa position dans la liste des chaînes à la fin du script logique. 
  
-The 0x08 is the number given to the string and corresponds to its +Le format de la section message est le suivant :
-position in the list of strings at the end of the logic script. +
-The format of the message section is as follows:+
  
-{| border="1"  cellspacing="0" cellpadding="5" +Offset   ^ Description                                                                                                                                                  ^ 
-|-  +| 0        | Number of messages                                                                                                                                           
-Offset +| 1-2      | Pointer to the end of the messages                                                                                                                           
-Description +| 3-4      | Array of message pointers                                                                                                                                    
-|-  +| ...      | Array of message pointers                                                                                                                                    
-|   +| ?        | Start of the text data. From this point the messages are encrypted with Avis Durgan (in their unencrypted form, each message is separated by a 0x00 value)   |
-| Number of messages +
-| +
-| 1-2 +
-| Pointer to the end of the messages +
-| +
-| 3-4 +
-| Array of message pointers +
-| +
-| ... +
-| Array of message pointers +
-| +
-  +
-| Start of the text data. From this point the messages are encrypted with Avis Durgan (in their unencrypted form, each message is separated by a 0x00 value) +
-|}+
  
-===Implementation=== +==== Implementation ==== 
-The implementation for each AGI statement is found in the <tt>agi</tt>/ +The implementation for each AGI statement is found in the //agi//file. This is the AGI interpreter itself. The data in the ''agidata.ovl'' file is used to find the start of the implementation for an AGI statement. Below are a couple of examples:
-file. This is the AGI interpreter itself. The data in the +
-<tt>agidata.ovl</tt> file is used to find the start of the +
-implementation for an AGI statement. Below are a couple of examples:+
  
 Example: MH2, equaln. Example: MH2, equaln.
  
-<code type="ASM">+<code asm>
 ;equaln   (eg.   if (work = 3)   ) ;equaln   (eg.   if (work = 3)   )
 0D71 AC            LODSB                       ;get variable number 0D71 AC            LODSB                       ;get variable number
Ligne 472: Ligne 492:
 Example: MH2, equalv. Example: MH2, equalv.
  
-<code type="ASM">+<code asm>
 ;equalv  (eg.   if (work = maxwork)   ) ;equalv  (eg.   if (work = maxwork)   )
 0D82 AC            LODSB                       ;get first var number 0D82 AC            LODSB                       ;get first var number
Ligne 487: Ligne 507:
 </code> </code>
  
-These two examples show the difference between how numbers and +These two examples show the difference between how numbers and variables are dealt with. In the case of a variable, the variables number is used as an index into the table of variable values to get the value which is being tested. It appears that the variable table is at offset 0x0009 in the data segment.
-variables are dealt with. In the case of a variable, the variables +
-number is used as an index into the table of variable values to get +
-the value which is being tested. It appears that the variable table is +
-at offset 0x0009 in the data segment.+
  
-===How the interpreter handles the code=== +==== How the interpreter handles the code ==== 
-The following 8086 assembly language code is the actual code from +The following 8086 assembly language code is the actual code from the MS-DOS version of Manhunter: San Francisco. There are some calls to routines which aren't displayed. Take my word for it that they do what the comment says. For those of you who can't follow whats going on, I'll explain the interpretation in steps after the code block.
-the MS-DOS version of Manhunter: San Francisco. There are some calls +
-to routines which aren't displayed. Take my word for it that they do +
-what the comment says. For those of you who can't follow whats going +
-on, I'll explain the interpretation in steps after the code block.+
  
-<code type="ASM">+<code asm>
 ;Decoding a LOGIC file. ;Decoding a LOGIC file.
 1E6C:2EF2 56            PUSH  SI 1E6C:2EF2 56            PUSH  SI
Ligne 605: Ligne 617:
 1E6C:2FA4 EBDE          JMP   2F84 1E6C:2FA4 EBDE          JMP   2F84
 1E6C:2FA6 AD            LODSW 1E6C:2FA6 AD            LODSW
-1E6C:2FA7 03F0          ADD   SI,AX         ;Skip over if (includes 3 else byte +1E6C:2FA7 03F0          ADD   SI,AX         ;Skip over if (includes 3 else bytes)
-s)+
 1E6C:2FA9 E954FF        JMP   2F00 1E6C:2FA9 E954FF        JMP   2F00
 </code> </code>
  
-''Situation 1.'' Every logic script starts in normal AGI command +//Situation 1.// 
-execution mode. In this routine, if the code is below 0xFC, then it is +Every logic script starts in normal AGI command execution mode. In this routine, if the code is below 0xFC, then it is presumed to be an AGI command. It will then call the main command execution routine which will jump to the relevant routine for the specific command using the jump table stored in ''agidata.ovl''.  
-presumed to be an AGI command. It will then call the main command +The command is performed and it returns to the main execution routine where it loops back to the top and deals with the next code in the logic file.
-execution routine which will jump to the relevant routine for the +
-specific command using the jump table stored in <tt>agidata.ovl</tt>+
-The command is performed and it returns to the main execution routine +
-where it loops back to the top and deals with the next code in the +
-logic file.+
  
-''Situation 2.'' +//Situation 2.// 
-If the code is an 0xFF code, then if jumps to the '''if''' +If the code is an 0xFF code, then if jumps to the **if** statement handler. In this routine is basically assesses whether the whole test condition evaluates to true or to false. It does this by treating each test separately and calling the relevant test command routines using the jump table in the ''agidata.ovl'' file. Each test command routine will return a value in //AL/which says whether it is true or not. Depending on the NOTs and ORs, the whole expression is evaluated. If at any stage during the evaluation the routine decides that the expression will be false, it exits to another routine which skips the rest of the **if** statement and then adds the two byte word following the closing 0xFF code to the execution pointer. This usually has the affect of jumping over the **if** block of code. If the **if** handler gets to the ending 0xFF then it knows the expression is true simply because it hasn't exited out of the routine yet. At this stage it jumps over the two bytes following the closing 0xFF and then goes back to executing straight AGI commands.
-statement handler. In this routine is basically assesses whether the +
-whole test condition evaluates to true or to false. It does this by +
-treating each test separately and calling the relevant test command +
-routines using the jump table in the <tt>agidata.ovl</tt> file. +
-Each test command routine will return a value in <tt>AL</tt> which +
-says whether it is true or not. Depending on the NOTs and ORs, the +
-whole expression is evaluated. If at any stage during the evaluation +
-the routine decides that the expression will be false, it exits to +
-another routine which skips the rest of the '''if''' statement +
-and then adds the two byte word following the closing 0xFF code to +
-the execution pointer. This usually has the affect of jumping over +
-the '''if''' block of code. If the '''if''' handler gets +
-to the ending 0xFF then it knows the expression is true simply because +
-it hasn't exited out of the routine yet. At this stage it jumps over +
-the two bytes following the closing 0xFF and then goes back to +
-executing straight AGI commands.+
  
-''/Situation 3.'' If in the normal execution of AGI commands, +//Situation 3.// 
-the code 0xFE is encountered, a very simple action takes place. The +If in the normal execution of AGI commands, the code 0xFE is encountered, a very simple action takes place. The two bytes which follow form a 16-bit twos complement value which is added to execution pointer. This is all it does. Previously we said that the 0xFE code stood for the **else** statement which is in actual fact correct for over 90% of the time, but the small number of other occurrences are best described as **goto** statements. 
-two bytes which follow form a 16-bit twos complement value which is +If you're confused by this, the following example will probably explain things.
-added to execution pointer. This is all it does. Previously we said +
-that the 0xFE code stood for the '''else''' statement which is +
-in actual fact correct for over 90% of the time, but the small number +
-of other occurrences are best described as '''goto''' statements. +
-If you're confused by this, the following example will probably explain +
-things.+
  
 Example: Example:
  
-<code type="C++">+<code C>
 if (said( open, door)) { if (said( open, door)) {
     // first block of AGI statements     // first block of AGI statements
Ligne 659: Ligne 643:
 </code> </code>
  
-The above example is how the original coder would have written the AGI +The above example is how the original coder would have written the AGI code. If we now look at the following example, it is not hard to see that it would achieve the same thing.
-code. If we now look at the following example, it is not hard to see +
-that it would achieve the same thing.+
  
-<code type="C++">+<code C>
 if (!said( open, door)) goto label1; if (!said( open, door)) goto label1;
     // first block of AGI statements     // first block of AGI statements
Ligne 674: Ligne 656:
 </code> </code>
  
-This is exactly how all '''if'''s and '''else'''s are +This is exactly how all **if**s and **else**s are implemented in the logic code. The **if** statement is a conditional branch where the branch is taken if the condition is not met, while the **else** statement is a nonconditional jump. If a 0xFE code appears in the middle of some AGI code and wasn't actually originally coded as an **else**, then it was most likely a **goto** statement. 
-implemented in the logic code. The '''if''' statement is a + 
-conditional branch where the branch is taken if the condition is +==== The **said** test command ====
-not met, while the '''else''' statement is a nonconditional +
-jump. If a 0xFE code appears in the middle of some AGI code and +
-wasn't actually originally coded as an '''else''', then it was +
-most likely a '''goto''' statement.+
  
-===The <tt>said</tt> test command=== 
 The above assembly language code does raise a very important point. The above assembly language code does raise a very important point.
-The '''said''' command can have a variable number of arguments. Its +The **said** command can have a variable number of arguments. Its code is 0x0E, and the byte following this byte gives the number of two byte words that follow as parameters.
-code is 0x0E, and the byte following this byte gives the number of +
-two byte words that follow as parameters.+
  
 Examples: Examples:
  
-<code type="C++">+<code C>
 if (said(marble))                          FF 0E 01 1E 01 FF if (said(marble))                          FF 0E 01 1E 01 FF
 if (said( open, door))                     FF 0E 02 37 02 73 00 FF if (said( open, door))                     FF 0E 02 37 02 73 00 FF
 </code> </code>
  
-In the above examples, the values 0x011E, 0x0237, and 0x0073 are just +In the above examples, the values 0x011E, 0x0237, and 0x0073 are just random word numbers that could stand for the words given.
-random word numbers that could stand for the words given.+
  
-===Inner loops=== +==== Inner loops ==== 
-At first I almost totally discarded the existence of loops in the AGI +At first I almost totally discarded the existence of loops in the AGI code because it seemed to me that execution of the logic script continually looped. Loop code like "while", "do..while", and "for" statements wouldn't be needed because you could just use a variable to increment with each pass and an **if** statement to test the value of the variable and take action if it was withing the desired range.
-code because it seemed to me that execution of the logic script +
-continually looped. Loop code like "while", "do..while", and "for" +
-statements wouldn't be needed because you could just use a variable to +
-increment with each pass and an '''if''' statement to test the +
-value of the variable and take action if it was withing the desired range.+
  
 Example: Example:
  
-<code type="C++">+<code C>
 if (greatern(30, 45) && lessn(30, 55)) { if (greatern(30, 45) && lessn(30, 55)) {
     print("You're in the hot zone!");     print("You're in the hot zone!");
Ligne 715: Ligne 684:
 </code> </code>
  
-I have found evidence of this sort of thing taking place which means +I have found evidence of this sort of thing taking place which means that they must loop over continuously. I don't know whether this is something that the interpreter does itself or whether it is part of 
-that they must loop over continuously. I don't know whether this is +the AGI code, e.g. at the end of one logic script it calls another which then calls the first one again. With the existence of the conditional branching and unconditional branching nature of the **if** and 
-something that the interpreter does itself or whether it is part of +**else** statement, it is easy to see that some of the structures such as "do..while" can infact be coded into logic scripts.
-the AGI code, e.g. at the end of one logic script it calls another which +
-then calls the first one again. With the existence of the conditional +
-branching and unconditional branching nature of the '''if''' and +
-'''else''' statement, it is easy to see that some of the +
-structures such as "do..while" can infact be coded into logic scripts.+
  
 Example: Example:
  
-<code type="C++">+<code C>
 FF FD 0D FF 03 00 FE F7 FF FF FD 0D FF 03 00 FE F7 FF
  
Ligne 733: Ligne 697:
 </code> </code>
  
-The above translation is a simple one which is taken from SQ2. The +The above translation is a simple one which is taken from SQ2. The value 0xFFF7 is the twos complement notation for -9 which is the exact branching value to take the execution back to the start of the **if** 
-value 0xFFF7 is the twos complement notation for -9 which is the exact +statement. If the above example had AGI code between the 0x00 and the 0xFE, then there would be code within the brackets of the "do..while" structure. I don't know whether the original AGI coders used these 
-branching value to take the execution back to the start of the '''if''' +statements or used **goto** statements to achieve the same result.
-statement. If the above example had AGI code between the 0x00 and the +
-0xFE, then there would be code within the brackets of the "do..while" +
-structure. I don't know whether the original AGI coders used these +
-statements or used '''goto''' statements to achieve the same result.+
  
agi-game/specifications-resources.1621861262.txt.gz · Dernière modification : 2021/05/24 15:01 de frater