Subversion Repositories Kolibri OS

Rev

Rev 7599 | Rev 9449 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7599 Rev 7665
1
;
1
;
2
; Spiral demo using Turtle graphics
2
; Spiral demo using Turtle graphics
3
;
3
;
4
; Written in UASM by 0CorErr
4
; Written in UASM by 0CorErr
5
; Translated to FASM by dunkaist
5
; Translated to FASM by dunkaist
6
;
6
;
7
 
7
 
8
use32
8
use32
9
    org 0
9
    org 0
10
    db  'MENUET01'
10
    db  'MENUET01'
11
    dd  0x01,start,i_end,e_end,e_end,params,0
11
    dd  0x01,start,i_end,e_end,e_end,params,0
12
 
12
 
13
include 'proc32.inc'
13
include 'proc32.inc'
14
include 'macros.inc'
14
include 'macros.inc'
15
 
15
 
16
struct RGB
16
struct RGB
17
    Blue  db ?
17
    Blue  db ?
18
    Green db ?
18
    Green db ?
19
    Red   db ?
19
    Red   db ?
20
ends
20
ends
21
 
21
 
22
struct HSV
22
struct HSV
23
    Hue dw ?
23
    Hue dw ?
24
    Sat db ?
24
    Sat db ?
25
    Val db ?
25
    Val db ?
26
ends
26
ends
27
 
27
 
28
struct Turtle
28
struct Turtle
29
    PosX        dd ?
29
    PosX        dd ?
30
    PosY        dd ?
30
    PosY        dd ?
31
    Orientation dd ?
31
    Orientation dd ?
32
    PenColor    HSV
32
    PenColor    HSV
33
ends
33
ends
34
 
34
 
35
 
35
 
36
proc forward _t, _d
36
proc forward _t, _d
37
locals
37
locals
38
    .x1 dd ?
38
    .x1 dd ?
39
    .x2 dd ?
39
    .x2 dd ?
40
    .y1 dd ?
40
    .y1 dd ?
41
    .y2 dd ?
41
    .y2 dd ?
42
endl
42
endl
43
        mov     eax, [_t]
43
        mov     eax, [_t]
44
 
44
 
45
        fld     [eax+Turtle.PosX]
45
        fld     [eax+Turtle.PosX]
46
        fistp   [.x1]
46
        fistp   [.x1]
47
 
47
 
48
        fld     [eax+Turtle.PosY]
48
        fld     [eax+Turtle.PosY]
49
        fistp   [.y1]
49
        fistp   [.y1]
50
 
50
 
51
        fld     [eax+Turtle.Orientation]
51
        fld     [eax+Turtle.Orientation]
52
        fcos
52
        fcos
53
        fmul    [_d]
53
        fmul    [_d]
54
        fadd    [eax+Turtle.PosX]
54
        fadd    [eax+Turtle.PosX]
55
        fstp    [eax+Turtle.PosX]
55
        fstp    [eax+Turtle.PosX]
56
 
56
 
57
        fld     [eax+Turtle.Orientation]
57
        fld     [eax+Turtle.Orientation]
58
        fsin
58
        fsin
59
        fmul    [_d]
59
        fmul    [_d]
60
        fadd    [eax+Turtle.PosY]
60
        fadd    [eax+Turtle.PosY]
61
        fstp    [eax+Turtle.PosY]
61
        fstp    [eax+Turtle.PosY]
62
 
62
 
63
        fld     [eax+Turtle.PosX]
63
        fld     [eax+Turtle.PosX]
64
        fistp   [.x2]
64
        fistp   [.x2]
65
 
65
 
66
        fld     [eax+Turtle.PosY]
66
        fld     [eax+Turtle.PosY]
67
        fistp   [.y2]
67
        fistp   [.y2]
68
 
68
 
69
        mov     ebx, [.x1]
69
        mov     ebx, [.x1]
70
        shl     ebx, 16
70
        shl     ebx, 16
71
        add     ebx, [.x2]
71
        add     ebx, [.x2]
72
        mov     ecx, [.y1]
72
        mov     ecx, [.y1]
73
        shl     ecx, 16
73
        shl     ecx, 16
74
        add     ecx, [.y2]
74
        add     ecx, [.y2]
75
        mov     edx, [color]
75
        mov     edx, [color]
76
        mcall   38
76
        mcall   38
77
        ret
77
        ret
78
endp
78
endp
79
 
79
 
80
 
80
 
81
proc turn _t, _degrees
81
proc turn _t, _degrees
82
        mov     eax, [_t]
82
        mov     eax, [_t]
83
        fldpi
83
        fldpi
84
        fmul    [_degrees]
84
        fmul    [_degrees]
85
        fdiv    [float_180]
85
        fdiv    [float_180]
86
        fadd    [eax+Turtle.Orientation]
86
        fadd    [eax+Turtle.Orientation]
87
        fstp    [eax+Turtle.Orientation]
87
        fstp    [eax+Turtle.Orientation]
88
        ret
88
        ret
89
endp
89
endp
90
 
90
 
91
 
91
 
92
proc reposition _t, _x, _y
92
proc reposition _t, _x, _y
93
        mov     eax, [_t]
93
        mov     eax, [_t]
94
        mov     ecx, [_x]
94
        mov     ecx, [_x]
95
        mov     [eax+Turtle.PosX], ecx
95
        mov     [eax+Turtle.PosX], ecx
96
        mov     ecx, [_y]
96
        mov     ecx, [_y]
97
        mov     [eax+Turtle.PosY], ecx
97
        mov     [eax+Turtle.PosY], ecx
98
        ret
98
        ret
99
endp
99
endp
100
 
100
 
101
 
101
 
102
; H = 0..360, S = 0..255, V = 0..255  -->  R = 0..255, G = 0..255, B = 0..255
102
; H = 0..360, S = 0..255, V = 0..255  -->  R = 0..255, G = 0..255, B = 0..255
103
proc hsv_to_rgb uses ebx, _h, _s, _v, _rgb
103
proc hsv_to_rgb uses ebx, _h, _s, _v, _rgb
104
locals
104
locals
105
        .f  dd ?
105
        .f  dd ?
106
        .vs dd ?
106
        .vs dd ?
107
endl
107
endl
108
        mov     ebx, [_rgb]
108
        mov     ebx, [_rgb]
109
        cmp     [_s], 0
109
        cmp     [_s], 0
110
        jnz     @f
110
        jnz     @f
111
        mov     eax, [_v]
111
        mov     eax, [_v]
112
        mov     [ebx+RGB.Red], al
112
        mov     [ebx+RGB.Red], al
113
        mov     [ebx+RGB.Green], al
113
        mov     [ebx+RGB.Green], al
114
        mov     [ebx+RGB.Blue], al
114
        mov     [ebx+RGB.Blue], al
115
        jmp     .end
115
        jmp     .end
116
    @@:
116
    @@:
117
        cmp     [_h], 360
117
        cmp     [_h], 360
118
        jnz     @f
118
        jnz     @f
119
        mov     [_h], 0
119
        mov     [_h], 0
120
    @@:
120
    @@:
121
        mov     eax, [_v]
121
        mov     eax, [_v]
122
        mul     [_s]
122
        mul     [_s]
123
        mov     [.vs], eax
123
        mov     [.vs], eax
124
        mov     eax, [_h]
124
        mov     eax, [_h]
125
        mov     ecx, 60
125
        mov     ecx, 60
126
        xor     edx, edx
126
        xor     edx, edx
127
        div     ecx
127
        div     ecx
128
        mov     [.f], edx
128
        mov     [.f], edx
129
 
129
 
130
        test    eax, eax
130
        test    eax, eax
131
        jnz     @f
131
        jnz     @f
132
        mov     eax, [_v]
132
        mov     eax, [_v]
133
        mov     [ebx+RGB.Red], al
133
        mov     [ebx+RGB.Red], al
134
        mov     eax, 60
134
        mov     eax, 60
135
        sub     eax, [.f]
135
        sub     eax, [.f]
136
        mul     [.vs]
136
        mul     [.vs]
137
        xor     edx, edx
137
        xor     edx, edx
138
        div     [dword_255_mul_60]
138
        div     [dword_255_mul_60]
139
        mov     edx, [_v]
139
        mov     edx, [_v]
140
        sub     dl, al
140
        sub     dl, al
141
        mov     [ebx+RGB.Green], dl
141
        mov     [ebx+RGB.Green], dl
142
        mov     eax, [.vs]
142
        mov     eax, [.vs]
143
        xor     edx, edx
143
        xor     edx, edx
144
        div     [dword_255]
144
        div     [dword_255]
145
        mov     edx, [_v]
145
        mov     edx, [_v]
146
        sub     dl, al
146
        sub     dl, al
147
        mov     [ebx+RGB.Blue], dl
147
        mov     [ebx+RGB.Blue], dl
148
        jmp     .end
148
        jmp     .end
149
    @@:
149
    @@:
150
        cmp     eax, 1
150
        cmp     eax, 1
151
        jnz     @f
151
        jnz     @f
152
        mov     eax, [.vs]
152
        mov     eax, [.vs]
153
        mul     [.f]
153
        mul     [.f]
154
        xor     edx, edx
154
        xor     edx, edx
155
        div     [dword_255_mul_60]
155
        div     [dword_255_mul_60]
156
        mov     edx, [_v]
156
        mov     edx, [_v]
157
        sub     dl, al
157
        sub     dl, al
158
        mov     [ebx+RGB.Red], dl
158
        mov     [ebx+RGB.Red], dl
159
        mov     eax, [_v]
159
        mov     eax, [_v]
160
        mov     [ebx+RGB.Green], al
160
        mov     [ebx+RGB.Green], al
161
        mov     eax, [.vs]
161
        mov     eax, [.vs]
162
        xor     edx, edx
162
        xor     edx, edx
163
        div     [dword_255]
163
        div     [dword_255]
164
        mov     edx, [_v]
164
        mov     edx, [_v]
165
        sub     dl, al
165
        sub     dl, al
166
        mov     [ebx+RGB.Blue], dl
166
        mov     [ebx+RGB.Blue], dl
167
        jmp     .end
167
        jmp     .end
168
    @@:
168
    @@:
169
        cmp     eax, 2
169
        cmp     eax, 2
170
        jnz     @f
170
        jnz     @f
171
        mov     eax, [.vs]
171
        mov     eax, [.vs]
172
        xor     edx, edx
172
        xor     edx, edx
173
        div     [dword_255]
173
        div     [dword_255]
174
        mov     edx, [_v]
174
        mov     edx, [_v]
175
        sub     dl, al
175
        sub     dl, al
176
        mov     [ebx+RGB.Red], dl
176
        mov     [ebx+RGB.Red], dl
177
        mov     eax, [_v]
177
        mov     eax, [_v]
178
        mov     [ebx+RGB.Green], al
178
        mov     [ebx+RGB.Green], al
179
        mov     eax, 60
179
        mov     eax, 60
180
        sub     eax, [.f]
180
        sub     eax, [.f]
181
        mul     [.vs]
181
        mul     [.vs]
182
        xor     edx, edx
182
        xor     edx, edx
183
        div     [dword_255_mul_60]
183
        div     [dword_255_mul_60]
184
        mov     edx, [_v]
184
        mov     edx, [_v]
185
        sub     dl, al
185
        sub     dl, al
186
        mov     [ebx+RGB.Blue], dl
186
        mov     [ebx+RGB.Blue], dl
187
        jmp     .end
187
        jmp     .end
188
    @@:
188
    @@:
189
        cmp     eax, 3
189
        cmp     eax, 3
190
        jnz     @f
190
        jnz     @f
191
        mov     eax, [.vs]
191
        mov     eax, [.vs]
192
        xor     edx, edx
192
        xor     edx, edx
193
        div     [dword_255]
193
        div     [dword_255]
194
        mov     edx, [_v]
194
        mov     edx, [_v]
195
        sub     dl, al
195
        sub     dl, al
196
        mov     [ebx+RGB.Red], dl
196
        mov     [ebx+RGB.Red], dl
197
        mov     eax, [.vs]
197
        mov     eax, [.vs]
198
        mul     [.f]
198
        mul     [.f]
199
        xor     edx, edx
199
        xor     edx, edx
200
        div     [dword_255_mul_60]
200
        div     [dword_255_mul_60]
201
        mov     edx, [_v]
201
        mov     edx, [_v]
202
        sub     dl, al
202
        sub     dl, al
203
        mov     [ebx+RGB.Green], dl
203
        mov     [ebx+RGB.Green], dl
204
        mov     eax, [_v]
204
        mov     eax, [_v]
205
        mov     [ebx+RGB.Blue], al
205
        mov     [ebx+RGB.Blue], al
206
        jmp     .end
206
        jmp     .end
207
    @@:
207
    @@:
208
        cmp     eax, 4
208
        cmp     eax, 4
209
        jnz     @f
209
        jnz     @f
210
        mov     eax, 60
210
        mov     eax, 60
211
        sub     eax, [.f]
211
        sub     eax, [.f]
212
        mul     [.vs]
212
        mul     [.vs]
213
        xor     edx, edx
213
        xor     edx, edx
214
        div     [dword_255_mul_60]
214
        div     [dword_255_mul_60]
215
        mov     edx, [_v]
215
        mov     edx, [_v]
216
        sub     dl, al
216
        sub     dl, al
217
        mov     [ebx+RGB.Red], dl
217
        mov     [ebx+RGB.Red], dl
218
        mov     eax, [.vs]
218
        mov     eax, [.vs]
219
        xor     edx, edx
219
        xor     edx, edx
220
        div     [dword_255]
220
        div     [dword_255]
221
        mov     edx, [_v]
221
        mov     edx, [_v]
222
        sub     dl, al
222
        sub     dl, al
223
        mov     [ebx+RGB.Green], dl
223
        mov     [ebx+RGB.Green], dl
224
        mov     eax, [_v]
224
        mov     eax, [_v]
225
        mov     [ebx+RGB.Blue], al
225
        mov     [ebx+RGB.Blue], al
226
        jmp     .end
226
        jmp     .end
227
    @@:
227
    @@:
228
        cmp     eax, 5
228
        cmp     eax, 5
229
        jnz     @f
229
        jnz     @f
230
        mov     eax, [_v]
230
        mov     eax, [_v]
231
        mov     [ebx+RGB.Red], al
231
        mov     [ebx+RGB.Red], al
232
        mov     eax, [.vs]
232
        mov     eax, [.vs]
233
        xor     edx, edx
233
        xor     edx, edx
234
        div     [dword_255]
234
        div     [dword_255]
235
        mov     edx, [_v]
235
        mov     edx, [_v]
236
        sub     dl, al
236
        sub     dl, al
237
        mov     [ebx+RGB.Green], dl
237
        mov     [ebx+RGB.Green], dl
238
        mov     eax, [.vs]
238
        mov     eax, [.vs]
239
        mul     [.f]
239
        mul     [.f]
240
        xor     edx, edx
240
        xor     edx, edx
241
        div     [dword_255_mul_60]
241
        div     [dword_255_mul_60]
242
        mov     edx, [_v]
242
        mov     edx, [_v]
243
        sub     dl, al
243
        sub     dl, al
244
        mov     [ebx+RGB.Blue], dl
244
        mov     [ebx+RGB.Blue], dl
245
    @@:
245
    @@:
246
  .end:
246
  .end:
247
        ret
247
        ret
248
endp
248
endp
249
 
249
 
250
 
250
 
251
proc hue_shift _t, _n
251
proc hue_shift _t, _n
252
        mov     ecx, [_t]
252
        mov     ecx, [_t]
253
        movzx   eax, [ecx+Turtle.PenColor.Hue]
253
        movzx   eax, [ecx+Turtle.PenColor.Hue]
254
        add     eax, [_n]
254
        add     eax, [_n]
255
        xor     edx, edx
255
        xor     edx, edx
256
        div     [dword_360]
256
        div     [dword_360]
257
        mov     [ecx+Turtle.PenColor.Hue], dx
257
        mov     [ecx+Turtle.PenColor.Hue], dx
258
 
258
 
259
        movzx   eax, [ecx+Turtle.PenColor.Hue]
259
        movzx   eax, [ecx+Turtle.PenColor.Hue]
260
        movzx   edx, [ecx+Turtle.PenColor.Sat]
260
        movzx   edx, [ecx+Turtle.PenColor.Sat]
261
        movzx   ecx, [ecx+Turtle.PenColor.Val]
261
        movzx   ecx, [ecx+Turtle.PenColor.Val]
262
 
262
 
263
        stdcall hsv_to_rgb, eax, edx, ecx, color
263
        stdcall hsv_to_rgb, eax, edx, ecx, color
264
        ret
264
        ret
265
endp
265
endp
266
 
266
 
267
 
267
 
268
proc query_perf
268
proc query_perf
269
locals
269
locals
270
        .diff    dd ?
270
        .diff    dd ?
271
endl
271
endl
272
        mcall   26, 9
272
        mcall   26, 9
273
        sub     eax, [frame_start]
273
        sub     eax, [frame_start]
274
        mov     [.diff], eax
274
        mov     [.diff], eax
275
        fild    [.diff]
275
        fild    [.diff]
276
        fild    [freq]
276
        fild    [freq]
277
        fdivrp
277
        fdivrp
278
        fstp    [instant]
278
        fstp    [instant]
279
        mcall   26, 9
279
        mcall   26, 9
280
        mov     [frame_start], eax
280
        mov     [frame_start], eax
281
        ret
281
        ret
282
endp
282
endp
283
 
283
 
284
 
284
 
285
proc waiting
285
proc waiting
286
        fld     [max_frame_rate]
286
        fld     [max_frame_rate]
287
        fld     [instant]
287
        fld     [instant]
288
        fcomip  st1
288
        fcompp
289
        fstp    st0
289
        fstsw   ax
-
 
290
        sahf
290
        jna     @f
291
        jc      @f
291
        inc     [sleep_time]
292
        inc     [sleep_time]
292
        jmp     .end
293
        jmp     .end
293
    @@:
294
    @@:
294
        fld     [min_frame_rate]
295
        fld     [min_frame_rate]
295
        fld     [instant]
296
        fld     [instant]
296
        fcomip  st1
297
        fcompp
297
        fstp    st0
298
        fstsw   ax
-
 
299
        sahf
298
        jnc     .end
300
        jnc     .end
299
        cmp     [sleep_time], 0
301
        cmp     [sleep_time], 0
300
        jz      .end
302
        jz      .end
301
        dec     [sleep_time]
303
        dec     [sleep_time]
302
  .end:
304
  .end:
303
        mcall   5, [sleep_time]
305
        mcall   5, [sleep_time]
304
        ret
306
        ret
305
endp
307
endp
306
 
308
 
307
 
309
 
308
proc drawing
310
proc drawing
309
locals
311
locals
310
        .i    dd ?
312
        .i    dd ?
311
        .n    dd ?
313
        .n    dd ?
312
        .posx dd ?
314
        .posx dd ?
313
        .posy dd ?
315
        .posy dd ?
314
endl
316
endl
315
        mov     [turtle.Orientation], 0
317
        mov     [turtle.Orientation], 0
316
        mov     eax, [window_width]
318
        mov     eax, [window_width]
317
        mov     ecx, [window_height]
319
        mov     ecx, [window_height]
318
        shr     eax, 1
320
        shr     eax, 1
319
        shr     ecx, 1
321
        shr     ecx, 1
320
        mov     [.posx], eax
322
        mov     [.posx], eax
321
        mov     [.posy], ecx
323
        mov     [.posy], ecx
322
        fild    [.posx]
324
        fild    [.posx]
323
        fstp    [.posx]
325
        fstp    [.posx]
324
        fild    [.posy]
326
        fild    [.posy]
325
        fstp    [.posy]
327
        fstp    [.posy]
326
        stdcall reposition, turtle, [.posx], [.posy]
328
        stdcall reposition, turtle, [.posx], [.posy]
327
        mov     [.n], 5.0
329
        mov     [.n], 5.0
328
        mov     eax, [window_height]
330
        mov     eax, [window_height]
329
        imul    eax, 15
331
        imul    eax, 15
330
        shr     eax, 4
332
        shr     eax, 4
331
        mov     ecx, eax
333
        mov     ecx, eax
332
        xor     edx, edx
334
        xor     edx, edx
333
        div     [dword_360]
335
        div     [dword_360]
334
        neg     edx
336
        neg     edx
335
        add     edx, ecx
337
        add     edx, ecx
336
        sub     edx, 10
338
        sub     edx, 10
337
        mov     [.i], edx
339
        mov     [.i], edx
338
    @@:
340
    @@:
339
        stdcall hue_shift, turtle, 1
341
        stdcall hue_shift, turtle, 1
340
        stdcall forward, turtle, [.n]
342
        stdcall forward, turtle, [.n]
341
        stdcall turn, turtle, 72.5
343
        stdcall turn, turtle, 72.5
342
        fld     [.n]
344
        fld     [.n]
343
        fadd    [ndelta]
345
        fadd    [ndelta]
344
        fstp    [.n]
346
        fstp    [.n]
345
        dec     [.i]
347
        dec     [.i]
346
        jnz     @b
348
        jnz     @b
347
        ret
349
        ret
348
endp
350
endp
349
 
351
 
350
 
352
 
351
start:
353
start:
352
        cmp     dword[params], '@ss'
354
        cmp     dword[params], '@ss'
353
        setz    [screensaver]
355
        setz    [screensaver]
354
        mov     ebx, EVM_REDRAW + EVM_KEY
356
        mov     ebx, EVM_REDRAW + EVM_KEY
355
        cmovz   ebx, EVM_REDRAW + EVM_KEY + EVM_MOUSE
357
        cmovz   ebx, EVM_REDRAW + EVM_KEY + EVM_MOUSE
356
        mcall   40
358
        mcall   40
357
 
359
 
358
        mov     edi, transparent_cursor
360
        mov     edi, transparent_cursor
359
        xor     eax, eax
361
        xor     eax, eax
360
        mov     ecx, 32*32
362
        mov     ecx, 32*32
361
        rep     stosd
363
        rep     stosd
362
        mcall   37, 4, transparent_cursor, 2
364
        mcall   37, 4, transparent_cursor, 2
363
        mov     ecx, eax
365
        mov     ecx, eax
364
        mcall   37, 5
366
        mcall   37, 5
365
 
367
 
366
        mcall   14
368
        mcall   14
367
        add     eax, 0x00010001
369
        add     eax, 0x00010001
368
        movzx   ecx, ax
370
        movzx   ecx, ax
369
        shr     eax, 16
371
        shr     eax, 16
370
        mov     [window_width], eax
372
        mov     [window_width], eax
371
        mov     [window_height], ecx
373
        mov     [window_height], ecx
372
        mcall   26, 9
374
        mcall   26, 9
373
        mov     [frame_start], eax
375
        mov     [frame_start], eax
374
  .still:
376
  .still:
375
	mcall	11
377
        mcall   11
376
        dec     eax
378
        dec     eax
377
        js      .draw_spiral    ; no event
379
        js      .draw_spiral    ; no event
378
        jnz     .quit
380
        jnz     .quit
379
        mcall   12, 1
381
        mcall   12, 1
380
        mcall   0, [window_width], [window_height], 0, 0x01000000
382
        mcall   0, [window_width], [window_height], 0, 0x01000000
381
        mcall   12, 2
383
        mcall   12, 2
382
  .draw_spiral:
384
  .draw_spiral:
383
        cmp     [screensaver], 0
385
        cmp     [screensaver], 0
384
        jz      @f
386
        jz      @f
385
        mcall   9, proc_info, -1
387
        mcall   9, proc_info, -1
386
        cmp     [proc_info.window_stack_position], ax
388
        cmp     [proc_info.window_stack_position], ax
387
        jnz     .quit
389
        jnz     .quit
388
    @@:
390
    @@:
389
        stdcall query_perf
391
        stdcall query_perf
390
        stdcall drawing
392
        stdcall drawing
391
        stdcall waiting
393
        stdcall waiting
392
        jmp     .still
394
        jmp     .still
393
  .quit:
395
  .quit:
394
        cmp     [screensaver], 0
396
        cmp     [screensaver], 0
395
        jz      @f
397
        jz      @f
396
        mcall   70, f70
398
        mcall   70, f70
397
    @@:
399
    @@:
398
        mcall   -1
400
        mcall   -1
399
 
401
 
400
 
402
 
401
align 4
403
align 4
402
dword_255_mul_60 dd 255 * 60
404
dword_255_mul_60 dd 255 * 60
403
dword_255        dd 255
405
dword_255        dd 255
404
dword_360        dd 360
406
dword_360        dd 360
405
float_180        dd 180.0
407
float_180        dd 180.0
406
ndelta           dd 0.6  ; used in drawing Proc: n = n + ndelta
408
ndelta           dd 0.6  ; used in drawing Proc: n = n + ndelta
407
max_frame_rate   dd 15.0 ; to keep the FrameRate
409
max_frame_rate   dd 15.0 ; to keep the FrameRate
408
min_frame_rate   dd 8.0  ; around min_frame_rate..max_frame_rate FPS
410
min_frame_rate   dd 8.0  ; around min_frame_rate..max_frame_rate FPS
409
 
411
 
410
freq       dd 100  ; GetTickCount return count of 1/100s of second
412
freq       dd 100  ; GetTickCount return count of 1/100s of second
411
instant    dd 0.0
413
instant    dd 0.0
412
sleep_time dd 0
414
sleep_time dd 0
413
 
415
 
414
turtle Turtle 0.0, 0.0, 0.0, <180, 255, 255>
416
turtle Turtle 0.0, 0.0, 0.0, <180, 255, 255>
415
 
417
 
416
f70:    ; run
418
f70:    ; run
417
        dd 7, 0, 0, 0, 0
419
        dd 7, 0, 0, 0, 0
418
        db '/sys/@ss',0
420
        db '/sys/@ss',0
419
i_end:
421
i_end:
420
 
422
 
421
align 4
423
align 4
422
window_width  dd ?
424
window_width  dd ?
423
window_height dd ?
425
window_height dd ?
424
frame_start   dd ?
426
frame_start   dd ?
425
color         dd ?
427
color         dd ?
426
 
428
 
427
proc_info process_information
429
proc_info process_information
428
params rb 0x400
430
params rb 0x400
429
transparent_cursor rd 32*32
431
transparent_cursor rd 32*32
430
screensaver db ?
432
screensaver db ?
431
align 4
433
align 4
432
rb 0x200
434
rb 0x200
433
e_end:
435
e_end: