Difference between revisions of "Interpreter cycle"

From AGI Wiki
Jump to navigationJump to search
(Replaced content with "The interpreter cycle in AGI works thusly: 500px == <br />See Also == *AGI Specifications: Chapter 3 - AGI Internals|AGI Interna...")
Line 1: Line 1:
 
The interpreter cycle in [[AGI]] works thusly:
 
The interpreter cycle in [[AGI]] works thusly:
  
[[File:InterpreterWorkCycle.png]]
+
[[File:InterpreterWorkCycle.png|500px]]
<!-- {|
 
|<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
 
    | 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  |
 
    | - 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>
 
|} -->
 
  
== See Also ==
+
== <br />See Also ==
  
 
*[[AGI Specifications: Chapter 3 - AGI Internals|AGI Internals]]
 
*[[AGI Specifications: Chapter 3 - AGI Internals|AGI Internals]]

Revision as of 00:54, 29 December 2013

The interpreter cycle in AGI works thusly:

InterpreterWorkCycle.png


See Also