Subversion Repositories Kolibri OS

Rev

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

Rev 332 Rev 370
Line 10... Line 10...
10
 
10
 
11
NORMAL_MODE    = 8
11
NORMAL_MODE    = 8
Line 12... Line 12...
12
CONSOLE_MODE   = 32
12
CONSOLE_MODE   = 32
13
 
-
 
14
MAGIC1         = 6*(text.line_size-1)+14
-
 
15
MAGIC2         = 14
-
 
16
MAGIC3         = 1
-
 
17
MAGIC4         = 7
13
 
Line 18... Line 14...
18
OUTPUTXY       = 7 shl 16 + 53
14
MAGIC1         = 6*(text.line_size-1)+14
Line 19... Line 15...
19
MAX_PATH       = 100
15
MAX_PATH       = 100
Line 162... Line 158...
162
    mpack ecx,1,1
158
    mpack ecx,1,1
163
    mov   ebx,[pinfo.x_size]
159
    mov   ebx,[pinfo.x_size]
164
    sub   ebx,10
160
    sub   ebx,10
Line 165... Line 161...
165
 
161
 
166
    push  ecx
162
    push  ecx
167
    madd  ecx,MAGIC2*3+2,MAGIC2*3+2
163
    madd  ecx, 14*3+2, 14*3+2
168
    mcall 38,,,[sc.work_graph]
164
    mcall 38,,,[sc.work_graph]
Line 169... Line 165...
169
    pop   ecx
165
    pop   ecx
170
 
166
 
171
    sub   ebx,MAGIC1+3
167
    sub   ebx,MAGIC1+3
172
    mcall
168
    mcall
173
    madd  ecx,MAGIC2,MAGIC2
169
    madd  ecx, 14, 14
174
    mcall
170
    mcall
175
    madd  ecx,MAGIC2,MAGIC2
171
    madd  ecx, 14, 14
176
    mcall
172
    mcall
177
    madd  ecx,MAGIC2,MAGIC2
173
    madd  ecx, 14, 14
178
    mcall
174
    mcall
179
    push  ebx
175
    push  ebx
180
    mpack ebx,MAGIC1,MAGIC1
176
    mpack ebx,MAGIC1,MAGIC1
181
    sub   ecx,MAGIC2*3
177
    sub   ecx, 14*3
182
    mcall
178
    mcall
183
    mov   ebx,[esp-2]
179
    mov   ebx,[esp-2]
184
    pop   bx
180
    pop   bx
Line 185... Line 181...
185
    mcall
181
    mcall
186
    add   esp,2
182
    add   esp,2
187
 
183
 
188
    mpack ebx,0,MAGIC1-1
184
    mpack ebx,0,MAGIC1-1
189
    mpack ecx,MAGIC3+1,MAGIC2-2
185
    mpack ecx,1+1, 14-2
190
    mcall 8,,,0x4000000B       ; Button: Enter Infile
186
    mcall 8,,,0x4000000B       ; Button: Enter Infile
191
    madd  ecx,MAGIC2,0
187
    madd  ecx, 14,0
Line 192... Line 188...
192
    mcall  ,,,0x4000000C       ; Button: Enter Outfile
188
    mcall  ,,,0x4000000C       ; Button: Enter Outfile
193
    madd  ecx,MAGIC2,0
189
    madd  ecx, 14,0
194
    mcall  ,,,0x4000000D       ; Button: Enter Path
190
    mcall  ,,,0x4000000D       ; Button: Enter Path
195
 
191
 
196
    mpack ebx,[pinfo.x_size],MAGIC1
192
    mpack ebx,[pinfo.x_size],MAGIC1
197
    msub  ebx,MAGIC1+10+1,0
193
    msub  ebx,MAGIC1+10+1,0
198
    mpack ecx,0,MAGIC2*3/2-1
194
    mpack ecx,0, 14*3/2-1
Line 199... Line 195...
199
    madd  ecx,MAGIC3,0
195
    madd  ecx,1,0
200
    mcall  ,,,0x00000002,[sc.work_button]
196
    mcall  ,,,0x00000002,[sc.work_button]
201
    madd  ecx,MAGIC2*3/2+1,0
197
    madd  ecx, 14*3/2+1,0
202
    mcall  ,,,0x00000003
198
    mcall  ,,,0x00000003
203
 
199
 
204
    mpack ebx,6,0    ; Draw Window Text
200
    mpack ebx,6,0    ; Draw Window Text
205
    add  ebx,MAGIC3+MAGIC2/2-3
201
    add  ebx,1+ 14/2-3
206
    mov  ecx,[sc.work_text]
202
    mov  ecx,[sc.work_text]
207
    mov  edx,text
203
    mov  edx,text
208
    mov  esi,text.line_size
204
    mov  esi,text.line_size
209
    mov  eax,4
205
    mov  eax,4
210
   newline:
206
   newline:
Line 211... Line 207...
211
    int  0x40
207
    int  0x40
212
    add  ebx,MAGIC2
208
    add  ebx, 14
213
    add  edx,text.line_size
209
    add  edx,text.line_size
214
    cmp  byte[edx],'x'
210
    cmp  byte[edx],'x'
215
    jne  newline
211
    jne  newline
216
 
212
 
217
    mov   ebx,[pinfo.x_size]
213
    mov   ebx,[pinfo.x_size]
Line 218... Line 214...
218
    sub   ebx,MAGIC1+10+1-9
214
    sub   ebx,MAGIC1+10+1-9
219
    shl   ebx,16
215
    shl   ebx,16
220
    add   ebx,MAGIC3+(MAGIC2*3/2-1)/2-3
216
    add   ebx,1+( 14*3/2-1)/2-3
221
    mcall  ,,[sc.work_button_text],s_compile,7
217
    mcall  ,,[sc.work_button_text],s_compile,7
222
    add   ebx,MAGIC2*3/2+1
218
    add   ebx,14*3/2+1
223
    mcall ,,,s_run
219
    mcall ,,,s_run
224
 
220
 
225
    mpack ebx,MAGIC1+6,0
221
    mpack ebx,MAGIC1+6,0
226
    add   ebx,MAGIC3+MAGIC2/2-3+MAGIC2*0
222
    add   ebx,1+ 14/2-3+ 14*0
227
    mov   esi,[pinfo.x_size]
223
    mov   esi,[pinfo.x_size]
228
    sub   esi,MAGIC1*2+5*2+6+3
224
    sub   esi,MAGIC1*2+5*2+6+3
229
    mov   eax,esi
225
    mov   eax,esi
230
    mov   cl,6
226
    mov   cl,6
231
    div   cl
227
    div   cl
232
    cmp   al,MAX_PATH
228
    cmp   al,MAX_PATH
233
    jbe   @f
229
    jbe   @f
Line 234... Line 230...
234
    mov   al,MAX_PATH
230
    mov   al,MAX_PATH
Line 235... Line 231...
235
@@: movzx esi,al
231
@@: movzx esi,al
Line 248... Line 244...
248
 
244
 
Line 249... Line 245...
249
bottom_right dd ?
245
bottom_right dd ?
250
 
246
 
251
draw_messages:
247
draw_messages:
252
    mov    eax,13      ; clear work area
248
    mov    eax,13      ; clear work area
253
    mpack  ebx,MAGIC4-2,[pinfo.x_size]
249
    mpack  ebx,7-2,[pinfo.x_size]
254
    sub    ebx,5*2+MAGIC4*2-1-2*2
250
    sub    ebx,5*2+7*2-1-2*2
255
    mpack  ecx,0,[pinfo.y_size]
251
    mpack  ecx,0,[pinfo.y_size]
256
    madd   ecx,MAGIC2*3+MAGIC3+MAGIC4+1,-(MAGIC2*3+MAGIC3+MAGIC4*2+25)
252
    madd   ecx, 14*3+1+7+1,-( 14*3+1+7*2+25)
257
    mov    word[bottom_right+2],bx
253
    mov    word[bottom_right+2],bx
258
    mov    word[bottom_right],cx
254
    mov    word[bottom_right],cx
259
    msub   [bottom_right],7,11
255
    msub   [bottom_right],7,11
260
    add    [bottom_right],OUTPUTXY
256
    add    [bottom_right],7 shl 16 + 53
261
    mov    edx,[sc.work]
257
    mov    edx,[sc.work]
262
    int    0x40
258
    int    0x40
263
_cy = 0
259
_cy = 0
264
_sy = 2
260
_sy = 2
265
_cx = 4
261
_cx = 4
266
_sx = 6
262
_sx = 6
267
    push   ebx ecx
263
    push   ebx ecx
268
    mpack  ebx,MAGIC4-3,MAGIC4-2
264
    mpack  ebx,4,5
269
    add    bx,[esp+_cx]
265
    add    bx,[esp+_cx]
270
    mov    ecx,[esp+_sy-2]
266
    mov    ecx,[esp+_sy-2]
271
    mov    cx,[esp+_sy]
267
    mov    cx,[esp+_sy]
Line 275... Line 271...
275
    add    cx,si
271
    add    cx,si
276
    shl    esi,16
272
    shl    esi,16
277
    add    ecx,esi
273
    add    ecx,esi
278
    madd   ecx,1,1
274
    madd   ecx,1,1
279
    mcall
275
    mcall
280
    mpack  ebx,MAGIC4-3,MAGIC4-3
276
    mpack  ebx,4,4
281
    mov    esi,[esp+_sy-2]
277
    mov    esi,[esp+_sy-2]
282
    mov    si,cx
278
    mov    si,cx
283
    mov    ecx,esi
279
    mov    ecx,esi
284
    mcall
280
    mcall
285
    mov    si,[esp+_cx]
281
    mov    si,[esp+_cx]
Line 292... Line 288...
292
    ret
288
    ret
Line 293... Line 289...
293
 
289
 
Line 294... Line 290...
294
; read string
290
; read string
295
 
291
 
296
f1: mov  [addr],infile
292
f1: mov  [addr],infile
297
    add  [ya],MAGIC2*0
293
    add  [ya], 14*0
298
    jmp  rk
294
    jmp  rk
299
f2: mov  [addr],outfile
295
f2: mov  [addr],outfile
300
    add  [ya],MAGIC2*1
296
    add  [ya], 14*1
301
    jmp  rk
297
    jmp  rk
302
f3: mov  [addr],path
298
f3: mov  [addr],path
Line 303... Line 299...
303
    add  [ya],MAGIC2*2
299
    add  [ya], 14*2
304
rk:
300
rk:
305
 
301
 
Line 363... Line 359...
363
    jmp    still
359
    jmp    still
Line 364... Line 360...
364
 
360
 
Line 365... Line 361...
365
print_text:
361
print_text:
366
 
362
 
367
    mpack ebx,MAGIC1+6,[pinfo.x_size]
363
    mpack ebx,MAGIC1+6,[pinfo.x_size]
368
    sub   ebx,MAGIC1*2+5*2+6+3
364
    sub   ebx,MAGIC1*2+19
369
    movzx esi,bx
365
    movzx esi,bx
370
    mov   ecx,[ya-2]
366
    mov   ecx,[ya-2]
Line 429... Line 425...
429
    cmp    [_mode],NORMAL_MODE
425
    cmp    [_mode],NORMAL_MODE
430
    jne    @f
426
    jne    @f
431
    call   draw_messages
427
    call   draw_messages
432
    push   0
428
    push   0
433
    pop    [textxy]
429
    pop    [textxy]
434
    add    [textxy],OUTPUTXY
430
    add    [textxy],7 shl 16 + 53
435
@@:
431
@@:
436
    mov    esi,_logo
432
    mov    esi,_logo
437
    call   display_string
433
    call   display_string
Line 438... Line 434...
438
 
434
 
Line 495... Line 491...
495
@@:
491
@@:
496
    jmp    exit_program
492
    jmp    exit_program
Line 497... Line 493...
497
 
493
 
498
 
-
 
499
include 'system.inc'
494
 
500
 
495
include 'system.inc'
501
include 'version.inc'
496
include 'version.inc'
502
include 'errors.inc'
497
include 'errors.inc'
503
include 'expressi.inc'
498
include 'expressi.inc'