DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦5d6f17747⟧ TextFile

    Length: 3762 (0xeb2)
    Types: TextFile
    Names: »B«

Derivation

└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00
    └─ ⟦0c20f784e⟧ »DATA« 
        └─⟦1abbe589f⟧ 
            └─⟦306851c02⟧ 
                └─⟦this⟧ 

TextFile

--/ if R1000 then
with System_Utilities;
--/ elsif TeleGen2 and then Unix then
--// with Unix_Time;
--/ elsif Cdf_Hpux then
--// with C_Library_Interface;
--// with Unix_Base_Types;
--/ else
--//  with something;
--/ end if;

separate (Puz_Main)  
procedure Calculate_Speed is
--/ if R1000 then
    Tv1           : Duration;  
    Tv2           : Duration;  
    Time_Per_Tile : Duration;
--/ elsif TeleGen2 and then Unix then
--//     Tv1           : S_Long;
--//     Tv2           : S_Long;
--//     Time_Per_Tile : S_Long;
--/ elsif Cdf_Hpux then
--//     Tv1           : Unix_Base_Types.Long;
--//     Tv2           : Unix_Base_Types.Long;
--//     Time_Per_Tile : Unix_Base_Types.Long;
--/ else
--//     Something : Here;
--/ end if;
    X : S_Long;  
    Y : S_Long;

begin

    if not First_Call then  
        return;  
    end if;  
    First_Call := False;

    X := Space_X * Tile_Width;  
    Y := Space_Y * Tile_Height;
--/ if R1000 then
    Time_Per_Tile := Duration (Duration (1.0) / -- 1 second
                               Duration (Tiles_Per_Second));

    X_Sync (Dpy, False);  
    Tv1 := System_Utilities.Elapsed;
--/ elsif TeleGen2 and then Unix then
--//     Time_Per_Tile := S_Long (1_000_000) / -- 1 second
--//                         Tiles_Per_Second;
--//
--//     X_Sync (Dpy, False);
--//     Tv1 := S_Long (Unix_Time.Clock);
--/ elsif Cdf_Hpux then
--//     Time_Per_Tile := Unix_Base_Types.Long (1_000_000) /
--//                         Unix_Base_Types.Long (Tiles_Per_Second);
--//
--//     X_Sync (Dpy, False);
--//     Tv1 := C_Library_Interface.Time.Clock;
--/ else
--//  Something;
--/ end if;
    Tv2 := Tv1;

    Move_Steps := 0;  
    while (Tv2 - Tv1) < Time_Per_Tile loop  
        Move_Area (Tile_Window, X, Y, X + 1, Y, Tile_Width, Tile_Height);  
        Rect_Set (Tile_Window, X, Y, 1, Tile_Height, Fg_Pixel);  
        Move_Steps := Move_Steps + 1;  
        X_Sync (Dpy, False);
--/ if R1000 then
        Tv2 := System_Utilities.Elapsed;
--/ elsif TeleGen2 and then Unix then
--//         Tv2 := S_Long (Unix_Time.Clock);
--/ elsif Cdf_Hpux then
--//         Tv2 := C_Library_Interface.Time.Clock;
--/ else
--//         Something;
--/ end if;
    end loop;

-- now, see how long this takes without all the extra b.s.
-- and compensate;

    X_Sync (Dpy, False);
--/ if R1000 then
    Tv1 := System_Utilities.Elapsed;
--/ elsif TeleGen2 and then Unix then
--//     Tv1 := S_Long (Unix_Time.Clock);
--/ elsif Cdf_Hpux then
--//     Tv1 := C_Library_Interface.Time.Clock;
--/ else
--//     Something;
--/ end if;
    for I in 0 .. Move_Steps - 1 loop  
        Move_Area (Tile_Window, X, Y, X + 1, Y, Tile_Width, Tile_Height);  
        Rect_Set (Tile_Window, X, Y, 1, Tile_Height, Fg_Pixel);  
    end loop;  
    X_Sync (Dpy, False);
--/ if R1000 then
    Tv2 := System_Utilities.Elapsed;
--/ elsif TeleGen2 and then Unix then
--//     Tv2 := S_Long (Unix_Time.Clock);
--/ elsif Cdf_Hpux then
--//     Tv2 := C_Library_Interface.Time.Clock;
--/ else
--//     Something;
--/ end if;
    if Tv2 = Tv1 then  
        Move_Steps := 1;  
    else
--/ if R1000 then
        Move_Steps := S_Natural (Duration (Duration (Move_Steps) *  
                                           Duration (Time_Per_Tile)) /  
                                 Duration (Tv2 - Tv1));
--/ elsif TeleGen2 and then Unix then
--//         Move_Steps := S_Natural ((Move_Steps * Time_Per_Tile) / (Tv2 - Tv1));
--/ elsif Cdf_Hpux then
--//         Move_Steps :=
--//            S_Natural ((Unix_Base_Types.Long (Move_Steps) * Time_Per_Tile) /
--//                       (Tv2 - Tv1));
--/ else
--//     Move_Steps := Something;
--/ end if;
    end if;  
    if Move_Steps = 0 then  
        Move_Steps := 1;  
    end if;

end Calculate_Speed;