Difference between revisions of "Interpreter cycle"

From AGI Wiki
Jump to navigationJump to search
Line 1: Line 1:
A '''hacked interpreter''' is an unofficial version of AGI that has been modified to add functionality that was not available in the official versions of the [[Interpreter|interpreter]].
+
The interpreter cycle in [[AGI]] works thusly:
  
Most, if not all, of the hacked interpreters work by changing the interpreter so that certain bytecodes are interpreted differently than they would be in a normal interpreter. The hacked interpreter that supports changing the palette, for example, alters the [[shake.screen]] functionality from the original interpreter, to allow the palette functionality.
+
<pre>
 +
                        +---------------------------+
 +
                        |      1. delay time        |
 +
                        +---------------------------+
 +
                                      |
 +
                                      V
 +
                        +----------------------------+
 +
                        |2. clear the keyboard buffer|
 +
                        +----------------------------+
 +
                                      |
 +
                                      V
 +
                        +---------------------------+
 +
                        |      Flag (2) - > 0      |
 +
                        |      Flag (4) - > 0      |
 +
                        +---------------------------+
 +
                                      |
 +
                                      V
 +
                    +-------------------------------------+
 +
                    | 3. poll keyboard and joystick      |
 +
                    +-------------------------------------+
 +
                                      |
 +
                                      V
 +
                    +-------------------------------------+
 +
                    | If the current mode is              |
 +
                    | - program_control, the direction of |
 +
                    |  Ego motion <-- var(6).            |
 +
                    | - player.control, var (6) --> dir.  |
 +
                    |  of Ego motion.                    |
 +
                    +-------------------------------------+
 +
                                      |
 +
                                      V
 +
    +---------------------------------------------------------------+
 +
    | For all objects for which command animate.obj, start_update  |
 +
    | and draw were carried out, the recalculation of the direction |
 +
    | of movement is performed.                                    |
 +
    +---------------------------------------------------------------+
 +
                                      |
 +
                                      V
 +
    +---------------------------------------------------------------+
 +
    | If the score has changed (var (3)) or the sound has been      |
 +
    | turned on or off (Flag (9)), the status line is updated.      |
 +
    +---------------------------------------------------------------+
 +
                                      |
 +
                                      +---------+
 +
                                                V
 +
                                  +--------------------------+
 +
                +---------------->| 4 Logic 0 is executed    |
 +
                |                +--------------------------+
 +
                |                              |
 +
                |                              V
 +
                |          +--------------------------------------+
 +
                |          | - Dir. of motion of Ego  <-- var (6) |
 +
                |          | - If score (var (3)) or Flag (9)    |
 +
                |          | have changed their values - update  |
 +
                |          | the status and score (on Var (3));  |
 +
                |          | - Var (5) - > 0;                    |
 +
                |          | - Var (4) - > 0;                    |
 +
                |          | - Flag (5) - > 0!!!!                |
 +
                |          | - Flag (6) - > 0;                    |
 +
                |          | - Flag (12) - > 0.                   |
 +
                |          +--------------------------------------+
 +
    +----------------------------+              |
 +
    | Execute:                  |              V
 +
    | ~~~~~~~~~~~~~~~~~~~~~~~~  |  +------------------------+
 +
    | - stop.update;            |  | Update all controlled  |
 +
    | - unanimate.all;          |  | objects on the screen. |
 +
    | - destroy all logic        |  +------------------------+
 +
    |  resources except        |                  |
 +
    |  for logic 0;            |                  V
 +
    | - player.control;          |            +--------------+
 +
    | - unblock;                |            | new.room n  |
 +
    | - set_horizon 36;          |            | or          |
 +
    | - var (1) = var (0);      |            | new.room.v n |
 +
    | - var (0) = n | Var(n);    |            | was issued?  |
 +
    | - var (4) = 0;            |            |              |
 +
    | - var (5) = 0;            |            +-------+------+
 +
    | - var (9) = 0;            |<-----------+  Yes  |  No  |
 +
    | - var (16) = number of    |            +-------+--+---+
 +
    | view assoc. w/Ego;        |                      |
 +
    | - Ego coords from var (2); |                      |
 +
    | - var (2) = 0;            |                      |
 +
    | - flag (2) - > 0;          |                      V
 +
    | - flag (5) - > 1!!!!      |              +--------------+
 +
    | - score < - var (3);      |              | Go to step 1 |
 +
    +----------------------------+              +--------------+
 +
</pre>
  
Without exception, the hacked interpreters require the player to have a copy of the hacked interpreter in order to play the game the way the author intended.
 
  
== <br />Hacked Interpreters ==
+
== Resources ==
  
<blockquote>
+
*[[AGI Specifications: Chapter 3 - AGI Internals|AGI Internals]]
See each hacked interpreter's article for a description of what the trade-offs for using the hack are.
 
 
 
:[[AGI Mouse]] - allows a point-and-click interface in an AGI game
 
:[[AGIPAL]] - allows color palettes other than the default
 
:[[AGI256]] - allows 256 color background images in AGI
 
:[[AGISB]] - plays [[Sound Resource|sounds]] through a Sound Blaster card instead of the internal speaker
 
:[[AGI-MIDI]] - plays sounds through a General MIDI sound card instead of the internal speaker
 
</blockquote>
 
  
 
&nbsp;
 
&nbsp;
  
[[Category:Hacked AGI Interpreters]]
+
[[Category:Interpreter]]

Revision as of 00:51, 29 December 2013

The interpreter cycle in AGI works thusly:

                         +---------------------------+
                         |      1. delay time        |
                         +---------------------------+
                                       |
                                       V
                         +----------------------------+
                         |2. clear the keyboard buffer|
                         +----------------------------+
                                       |
                                       V
                         +---------------------------+
                         |      Flag (2) - > 0       |
                         |      Flag (4) - > 0       |
                         +---------------------------+
                                       |
                                       V
                    +-------------------------------------+
                    | 3. poll keyboard and joystick       |
                    +-------------------------------------+
                                       |
                                       V
                    +-------------------------------------+
                    | If the current mode is              |
                    | - program_control, the direction of |
                    |   Ego motion <-- var(6).            |
                    | - player.control, var (6) --> dir.  |
                    |   of Ego motion.                    |
                    +-------------------------------------+
                                       |
                                       V
    +---------------------------------------------------------------+
    | For all objects for which command animate.obj, start_update   |
    | and draw were carried out, the recalculation of the direction |
    | of movement is performed.                                     |
    +---------------------------------------------------------------+
                                       |
                                       V
    +---------------------------------------------------------------+
    | If the score has changed (var (3)) or the sound has been      |
    | turned on or off (Flag (9)), the status line is updated.      |
    +---------------------------------------------------------------+
                                       |
                                       +---------+
                                                 V
                                   +--------------------------+
                 +---------------->| 4 Logic 0 is executed    |
                 |                 +--------------------------+
                 |                               |
                 |                               V
                 |          +--------------------------------------+
                 |          | - Dir. of motion of Ego  <-- var (6) |
                 |          | - If score (var (3)) or Flag (9)     |
                 |          | have changed their values - update   |
                 |          | the status and score (on Var (3));   |
                 |          | - Var (5) - > 0;                     |
                 |          | - Var (4) - > 0;                     |
                 |          | - Flag (5) - > 0!!!!                 |
                 |          | - Flag (6) - > 0;                    |
                 |          | - Flag (12) - > 0.                   |
                 |          +--------------------------------------+
     +----------------------------+               |
     | Execute:                   |               V
     | ~~~~~~~~~~~~~~~~~~~~~~~~   |  +------------------------+
     | - stop.update;             |  | Update all controlled  |
     | - unanimate.all;           |  | objects on the screen. |
     | - destroy all logic        |  +------------------------+
     |   resources except         |                   |
     |   for logic 0;             |                   V
     | - player.control;          |            +--------------+
     | - unblock;                 |            | new.room n   |
     | - set_horizon 36;          |            | or           |
     | - var (1) = var (0);       |            | new.room.v n |
     | - var (0) = n | Var(n);    |            | was issued?  |
     | - var (4) = 0;             |            |              |
     | - var (5) = 0;             |            +-------+------+
     | - var (9) = 0;             |<-----------+  Yes  |  No  |
     | - var (16) = number of     |            +-------+--+---+
     | view assoc. w/Ego;         |                       |
     | - Ego coords from var (2); |                       |
     | - var (2) = 0;             |                       |
     | - flag (2) - > 0;          |                       V
     | - flag (5) - > 1!!!!       |               +--------------+
     | - score < - var (3);       |               | Go to step 1 |
     +----------------------------+               +--------------+


Resources