Difference between revisions of "Interpreter cycle"

From AGI Wiki
Jump to navigationJump to search
Line 1: Line 1:
 
The interpreter cycle in [[AGI]] works thusly:
 
The interpreter cycle in [[AGI]] works thusly:
  
{|
+
[[File:InterpreterWorkCycle.png]]
 +
<!-- {|
 
|<pre>
 
|<pre>
 
                         +---------------------------+
 
                         +---------------------------+
Line 65: Line 66:
 
     +----------------------------+              |
 
     +----------------------------+              |
 
     | Execute:                  |              V
 
     | Execute:                  |              V
     | ~~~~~~~~~~~~~~~~~~~~~~~~   |  +------------------------+
+
     | 23:53, 28 December 2013 (CST)23:53, 28 December 2013 (CST)23:53, 28 December 2013 (CST)23:53, 28 December 2013 (CST)[[User:Collector|Collector]] ([[User talk:Collector|talk]]) 23:53, 28 December 2013 (CST)   |  +------------------------+
 
     | - stop.update;            |  | Update all controlled  |
 
     | - stop.update;            |  | Update all controlled  |
 
     | - unanimate.all;          |  | objects on the screen. |
 
     | - unanimate.all;          |  | objects on the screen. |
Line 88: Line 89:
 
     +----------------------------+              +--------------+
 
     +----------------------------+              +--------------+
 
</pre>
 
</pre>
|}
+
|} -->
  
 
== See Also ==
 
== See Also ==

Revision as of 00:53, 29 December 2013

The interpreter cycle in AGI works thusly:

InterpreterWorkCycle.png

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
    | 23:53, 28 December 2013 (CST)23:53, 28 December 2013 (CST)23:53, 28 December 2013 (CST)23:53, 28 December 2013 (CST)Collector (talk) 23:53, 28 December 2013 (CST)   |  +------------------------+
    | - 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 |
    +----------------------------+               +--------------+

|} -->

See Also