Subversion Repositories Kolibri OS

Rev

Rev 7696 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7696 Rev 7983
Line 1... Line 1...
1
(*
1
(*
2
    BSD 2-Clause License
2
    BSD 2-Clause License
Line 3... Line 3...
3
 
3
 
4
    Copyright (c) 2018-2019, Anton Krotov
4
    Copyright (c) 2018-2020, Anton Krotov
5
    All rights reserved.
5
    All rights reserved.
Line 6... Line 6...
6
*)
6
*)
Line 21... Line 21...
21
    OS = HOST.OS;
21
    OS = HOST.OS;
Line 22... Line 22...
22
 
22
 
23
    min32* = -2147483647-1;
23
    min32* = -2147483647-1;
Line -... Line 24...
-
 
24
    max32* =  2147483647;
-
 
25
 
-
 
26
    vMajor* = 1;
-
 
27
    vMinor* = 29;
-
 
28
 
-
 
29
    FILE_EXT* = ".ob07";
-
 
30
    RTL_NAME* = "RTL";
-
 
31
 
Line 24... Line 32...
24
    max32* =  2147483647;
32
    MAX_GLOBAL_SIZE* = 1600000000;
Line 25... Line 33...
25
 
33
 
Line 108... Line 116...
108
PROCEDURE splitf* (x: REAL; VAR a, b: INTEGER): INTEGER;
116
PROCEDURE splitf* (x: REAL; VAR a, b: INTEGER): INTEGER;
109
    RETURN HOST.splitf(x, a, b)
117
    RETURN HOST.splitf(x, a, b)
110
END splitf;
118
END splitf;
Line -... Line 119...
-
 
119
 
-
 
120
 
-
 
121
PROCEDURE d2s* (x: REAL): INTEGER;
-
 
122
    RETURN HOST.d2s(x)
-
 
123
END d2s;
111
 
124
 
112
 
125
 
113
PROCEDURE isRelative* (path: ARRAY OF CHAR): BOOLEAN;
126
PROCEDURE isRelative* (path: ARRAY OF CHAR): BOOLEAN;
Line 141... Line 154...
141
 
154
 
142
    RETURN res
155
    RETURN res
Line 143... Line 156...
143
END UnixTime;
156
END UnixTime;
144
 
157
 
145
 
158
 
146
PROCEDURE SetBitDepth* (BitDepth: INTEGER);
159
PROCEDURE SetBitDepth* (BitDepth: INTEGER; Double: BOOLEAN);
147
BEGIN
160
BEGIN
Line 148... Line 161...
148
    ASSERT((BitDepth = 16) OR (BitDepth = 32) OR (BitDepth = 64));
161
    ASSERT((BitDepth = 16) OR (BitDepth = 32) OR (BitDepth = 64));
149
    bit_diff := bit_depth - BitDepth;
162
    bit_diff := bit_depth - BitDepth;
150
    ASSERT(bit_diff >= 0);
163
    ASSERT(bit_diff >= 0);
151
 
164
 
152
    target.bit_depth := BitDepth;
165
    target.bit_depth := BitDepth;
-
 
166
    target.maxSet    := BitDepth - 1;
-
 
167
    target.maxHex    := BitDepth DIV 4;
-
 
168
    target.minInt    := ASR(minint, bit_diff);
-
 
169
    target.maxInt    := ASR(maxint, bit_diff);
153
    target.maxSet    := BitDepth - 1;
170
 
154
    target.maxHex    := BitDepth DIV 4;
171
    IF Double THEN
-
 
172
        target.maxReal := maxreal
155
    target.minInt    := ASR(minint, bit_diff);
173
    ELSE
Line 156... Line 174...
156
    target.maxInt    := ASR(maxint, bit_diff);
174
        target.maxReal := 1.9;
157
    target.maxReal   := 1.9;
175
        PACK(target.maxReal, 127)
Line 195... Line 213...
195
PROCEDURE Log2* (x: INTEGER): INTEGER;
213
PROCEDURE Log2* (x: INTEGER): INTEGER;
196
VAR
214
VAR
197
    n: INTEGER;
215
    n: INTEGER;
Line 198... Line 216...
198
 
216
 
199
BEGIN
-
 
200
    ASSERT(x > 0);
-
 
201
 
217
BEGIN
202
    n := 0;
218
    n := 0;
203
    WHILE ~ODD(x) DO
219
    WHILE ~ODD(x) DO
204
        x := x DIV 2;
220
        x := x DIV 2;
205
        INC(n)
221
        INC(n)
Line 256... Line 272...
256
 
272
 
257
 
273
 
258
BEGIN
274
BEGIN
259
    time := GetTickCount();
275
    time := GetTickCount();
260
    COPY(HOST.eol, eol);
-
 
261
    maxreal := 1.9;
276
    COPY(HOST.eol, eol);
262
    PACK(maxreal, 1023);
277
    maxreal := HOST.maxreal;