Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 485
Line 48... Line 48...
48
    db file_name,0
48
    db file_name,0
49
open:
49
open:
50
    mov  dword [fileinfo+8],1 ; how many blocks to read (1)
50
    mov  dword [fileinfo+8],1 ; how many blocks to read (1)
51
    mov  eax,58
51
    mov  eax,58
52
    mov  ebx,fileinfo
52
    mov  ebx,fileinfo
53
    int  0x40
53
    mcall
54
    mov  eax,[file_load_area+2]
54
    mov  eax,[file_load_area+2]
55
    shr  eax,9 ; ¯®¤¥«¨¬ ­  512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢
55
    shr  eax,9 ; ¯®¤¥«¨¬ ­  512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢
56
    inc  eax
56
    inc  eax
57
    mov  dword [fileinfo+8],eax
57
    mov  dword [fileinfo+8],eax
58
    mov  eax,58
58
    mov  eax,58
59
    mov  ebx,fileinfo
59
    mov  ebx,fileinfo
60
    int  0x40
60
    mcall
61
}
61
}
Line 62... Line 62...
62
 
62
 
63
 
63
 
Line 141... Line 141...
141
    words2reg ebx,x,xs
141
    words2reg ebx,x,xs
142
    words2reg ecx,y,ys
142
    words2reg ecx,y,ys
143
    mov edx,id
143
    mov edx,id
144
    mov esi,bcolor
144
    mov esi,bcolor
145
    mov eax,8
145
    mov eax,8
146
    int 0x40
146
    mcall
Line 147... Line 147...
147
 
147
 
148
    mov eax,asd-lab          ;calc size
148
    mov eax,asd-lab          ;calc size
149
    mov ebx,6
149
    mov ebx,6
150
    mul ebx
150
    mul ebx
Line 166... Line 166...
166
 
166
 
167
    mov ecx,tcolor             ;arg4 color
167
    mov ecx,tcolor             ;arg4 color
168
    mov edx,lab
168
    mov edx,lab
169
    mov esi,asd-lab          ;calc size
169
    mov esi,asd-lab          ;calc size
170
    mov eax,4
170
    mov eax,4
171
    int 0x40
171
    mcall
Line 172... Line 172...
172
}
172
}
173
 
173
 
Line 195... Line 195...
195
 
195
 
196
; Get my PID in dec format 4 bytes
196
; Get my PID in dec format 4 bytes
197
    mov eax,9
197
    mov eax,9
198
    mov ebx,procinfo
198
    mov ebx,procinfo
199
    mov ecx,-1
199
    mov ecx,-1
Line 200... Line 200...
200
    int 0x40
200
    mcall
201
 
201
 
202
; convert eax bin to param dec
202
; convert eax bin to param dec
203
    mov eax,dword [procinfo+30]  ;offset of myPID
203
    mov eax,dword [procinfo+30]  ;offset of myPID
Line 229... Line 229...
229
; define IPC memory
229
; define IPC memory
230
    mov eax,60
230
    mov eax,60
231
    mov ebx,1        ; define IPC
231
    mov ebx,1        ; define IPC
232
    mov ecx,path     ; offset of area
232
    mov ecx,path     ; offset of area
233
    mov edx,150      ; size 150 bytes
233
    mov edx,150      ; size 150 bytes
234
    int 0x40
234
    mcall
Line 235... Line 235...
235
 
235
 
236
; change wanted events list 7-bit IPC event
236
; change wanted events list 7-bit IPC event
237
    mov eax,40
237
    mov eax,40
238
    mov ebx,01000111b
238
    mov ebx,01000111b
Line 239... Line 239...
239
    int 0x40
239
    mcall
240
 
240
 
241
;
241
;
Line 242... Line 242...
242
; STEP 3 run SYSTEM XTREE with parameters
242
; STEP 3 run SYSTEM XTREE with parameters
243
;
243
;
244
 
244
 
Line 245... Line 245...
245
    mov eax,58
245
    mov eax,58
Line 246... Line 246...
246
    mov ebx,run_fileinfo
246
    mov ebx,run_fileinfo
247
    int 0x40
247
    mcall
248
 
248
 
249
    call redproc
249
    call redproc
250
 
250
 
Line 251... Line 251...
251
    mov [get_loops],0
251
    mov [get_loops],0
252
getmesloop:
252
getmesloop:
253
    mov eax,23
253
    mov eax,23
254
    mov ebx,50     ;0.5 sec
254
    mov ebx,50     ;0.5 sec
Line 265... Line 265...
265
 
265
 
266
; Get number of procces
266
; Get number of procces
267
    mov ebx,procinfo
267
    mov ebx,procinfo
268
    mov ecx,-1
268
    mov ecx,-1
269
    mov eax,9
269
    mov eax,9
270
    int 0x40
270
    mcall
Line 271... Line 271...
271
    mov ebp,eax
271
    mov ebp,eax
272
 
272
 
273
loox:
273
loox:
274
    mov eax,9
274
    mov eax,9
275
    mov ebx,procinfo
275
    mov ebx,procinfo
276
    mov ecx,ebp
276
    mov ecx,ebp
277
    int 0x40
277
    mcall
278
    mov eax,[DLGPID]
278
    mov eax,[DLGPID]
279
    cmp [procinfo+30],eax    ;IF Dialog find
279
    cmp [procinfo+30],eax    ;IF Dialog find
280
    je  dlg_is_work          ;jmp to dlg_is_work
280
    je  dlg_is_work          ;jmp to dlg_is_work
Line 297... Line 297...
297
mred:
297
mred:
298
    call redproc
298
    call redproc
299
    jmp  getmesloop
299
    jmp  getmesloop
300
mkey:
300
mkey:
301
    mov  eax,2
301
    mov  eax,2
302
    int  0x40                   ; read (eax=2)
302
    mcall                   ; read (eax=2)
303
    jmp  getmesloop
303
    jmp  getmesloop
304
mbutton:
304
mbutton:
305
    mov  eax,17                 ; get id
305
    mov  eax,17                 ; get id
306
    int  0x40
306
    mcall
307
    cmp  ah,1                   ; button id=1 ?
307
    cmp  ah,1                   ; button id=1 ?
308
    jne  getmesloop
308
    jne  getmesloop
309
    mov  eax,-1                 ; close this program
309
    mov  eax,-1                 ; close this program
310
    int  0x40
310
    mcall
311
mgetmes:
311
mgetmes:
Line 312... Line 312...
312
 
312
 
313
; If dlg_pid_get then second message get jmp to still
313
; If dlg_pid_get then second message get jmp to still
314
    cmp  [dlg_pid_get],dword 1
314
    cmp  [dlg_pid_get],dword 1
Line 407... Line 407...
407
 
407
 
408
; Get my PID in dec format 4 bytes
408
; Get my PID in dec format 4 bytes
409
    mov eax,9
409
    mov eax,9
410
    mov ebx,procinfo
410
    mov ebx,procinfo
411
    mov ecx,-1
411
    mov ecx,-1
Line 412... Line 412...
412
    int 0x40
412
    mcall
413
 
413
 
414
; convert eax bin to param dec
414
; convert eax bin to param dec
415
    mov eax,dword [procinfo+30]  ;offset of myPID
415
    mov eax,dword [procinfo+30]  ;offset of myPID
Line 441... Line 441...
441
; define IPC memory
441
; define IPC memory
442
    mov eax,60
442
    mov eax,60
443
    mov ebx,1        ; define IPC
443
    mov ebx,1        ; define IPC
444
    mov ecx,path ; offset of area
444
    mov ecx,path ; offset of area
445
    mov edx,150      ; size 150 bytes
445
    mov edx,150      ; size 150 bytes
446
    int 0x40
446
    mcall
Line 447... Line 447...
447
 
447
 
448
; change wanted events list 7-bit IPC event
448
; change wanted events list 7-bit IPC event
449
    mov eax,40
449
    mov eax,40
450
    mov ebx,01000111b
450
    mov ebx,01000111b
Line 451... Line 451...
451
    int 0x40
451
    mcall
452
 
452
 
453
;
453
;
Line 454... Line 454...
454
; STEP 3 run SYSTEM XTREE with parameters
454
; STEP 3 run SYSTEM XTREE with parameters
455
;
455
;
456
 
456
 
Line 457... Line 457...
457
    mov eax,58
457
    mov eax,58
Line 458... Line 458...
458
    mov ebx,run_fileinfo
458
    mov ebx,run_fileinfo
459
    int 0x40
459
    mcall
460
 
460
 
461
    call redproc
461
    call redproc
462
 
462
 
Line 463... Line 463...
463
    mov [get_loops],0
463
    mov [get_loops],0
464
getmesloop:
464
getmesloop:
465
    mov eax,23
465
    mov eax,23
466
    mov ebx,50     ;0.5 sec
466
    mov ebx,50     ;0.5 sec
Line 477... Line 477...
477
 
477
 
478
; Get number of procces
478
; Get number of procces
479
    mov ebx,procinfo
479
    mov ebx,procinfo
480
    mov ecx,-1
480
    mov ecx,-1
481
    mov eax,9
481
    mov eax,9
482
    int 0x40
482
    mcall
Line 483... Line 483...
483
    mov ebp,eax
483
    mov ebp,eax
484
 
484
 
485
loox:
485
loox:
486
    mov eax,9
486
    mov eax,9
487
    mov ebx,procinfo
487
    mov ebx,procinfo
488
    mov ecx,ebp
488
    mov ecx,ebp
489
    int 0x40
489
    mcall
490
    mov eax,[DLGPID]
490
    mov eax,[DLGPID]
491
    cmp [procinfo+30],eax    ;IF Dialog find
491
    cmp [procinfo+30],eax    ;IF Dialog find
492
    je  dlg_is_work          ;jmp to dlg_is_work
492
    je  dlg_is_work          ;jmp to dlg_is_work
Line 509... Line 509...
509
mred:
509
mred:
510
    call redproc
510
    call redproc
511
    jmp  getmesloop
511
    jmp  getmesloop
512
mkey:
512
mkey:
513
    mov  eax,2
513
    mov  eax,2
514
    int  0x40                   ; read (eax=2)
514
    mcall                   ; read (eax=2)
515
    jmp  getmesloop
515
    jmp  getmesloop
516
mbutton:
516
mbutton:
517
    mov  eax,17                 ; get id
517
    mov  eax,17                 ; get id
518
    int  0x40
518
    mcall
519
    cmp  ah,1                   ; button id=1 ?
519
    cmp  ah,1                   ; button id=1 ?
520
    jne  getmesloop
520
    jne  getmesloop
521
    mov  eax,-1                 ; close this program
521
    mov  eax,-1                 ; close this program
522
    int  0x40
522
    mcall
523
mgetmes:
523
mgetmes:
Line 524... Line 524...
524
 
524
 
525
; If dlg_pid_get then second message get jmp to still
525
; If dlg_pid_get then second message get jmp to still
526
    cmp  [dlg_pid_get],dword 1
526
    cmp  [dlg_pid_get],dword 1
Line 669... Line 669...
669
}
669
}
Line 670... Line 670...
670
 
670
 
671
macro scank
671
macro scank
672
{
672
{
673
    mov eax,10
673
    mov eax,10
674
    int 0x40
674
    mcall
Line 675... Line 675...
675
}
675
}
676
 
676
 
677
macro putpix x,y,color
677
macro putpix x,y,color
678
{
678
{
679
    mov ebx,x
679
    mov ebx,x
680
    mov ecx,y
680
    mov ecx,y
681
    mov edx,color
681
    mov edx,color
682
    mov eax,1
682
    mov eax,1
Line 683... Line 683...
683
    int 0x40
683
    mcall
684
}
684
}
685
 
685
 
686
macro bar x,y,sizex,sizey,color
686
macro bar x,y,sizex,sizey,color
687
{
687
{
688
    words2reg ebx,x,sizex
688
    words2reg ebx,x,sizex
689
    words2reg ecx,y,sizey
689
    words2reg ecx,y,sizey
Line 690... Line 690...
690
    dword2reg edx,color
690
    dword2reg edx,color
Line 691... Line 691...
691
    mov eax,13
691
    mov eax,13
692
    int 0x40
692
    mcall
Line 706... Line 706...
706
 
706
 
707
;    mov ecx,color
707
;    mov ecx,color
708
;    mov edx,offs
708
;    mov edx,offs
709
    mov esi,size
709
    mov esi,size
710
    mov eax,4
710
    mov eax,4
711
    int 0x40
711
    mcall
Line 712... Line 712...
712
}
712
}
713
 
713
 
714
macro outcount data, x, y, color, numtype
714
macro outcount data, x, y, color, numtype
Line 718... Line 718...
718
    mov bl,0
718
    mov bl,0
719
;    mov edx,x*65536+y
719
;    mov edx,x*65536+y
720
    words2reg edx,x,y
720
    words2reg edx,x,y
721
    mov esi,color
721
    mov esi,color
722
    mov eax,47
722
    mov eax,47
723
    int 0x40
723
    mcall
724
}
724
}
Line 725... Line 725...
725
 
725
 
Line 726... Line 726...
726
; SCEVENT - Scan event
726
; SCEVENT - Scan event
727
 
727
 
728
macro scevent red,key,but
728
macro scevent red,key,but
729
{
729
{
730
    mov eax,11
730
    mov eax,11
731
    int 0x40
731
    mcall
732
    dec eax
732
    dec eax
733
    jz  red
733
    jz  red
734
    dec eax
734
    dec eax
Line 740... Line 740...
740
; WTEVENT - Wait event
740
; WTEVENT - Wait event
Line 741... Line 741...
741
 
741
 
742
macro wtevent red,key,but
742
macro wtevent red,key,but
743
{
743
{
744
    mov eax,10
744
    mov eax,10
745
    int 0x40
745
    mcall
746
    dec eax
746
    dec eax
747
    jz  red
747
    jz  red
748
    dec eax
748
    dec eax
749
    jz  key
749
    jz  key
Line 755... Line 755...
755
 
755
 
756
macro timeevent xfps,noevent,red,key,but
756
macro timeevent xfps,noevent,red,key,but
757
{
757
{
758
    mov eax,23
758
    mov eax,23
759
    mov ebx,xfps
759
    mov ebx,xfps
760
    int 0x40
760
    mcall
761
    cmp eax,0
761
    cmp eax,0
762
    je  noevent
762
    je  noevent
763
    dec eax
763
    dec eax
764
    jz  red
764
    jz  red
Line 772... Line 772...
772
; CLOSE - Close program
772
; CLOSE - Close program
Line 773... Line 773...
773
 
773
 
774
macro close
774
macro close
775
{
775
{
776
    mov eax,-1
776
    mov eax,-1
777
    int 0x40
777
    mcall
Line 778... Line 778...
778
}
778
}
779
 
779
 
780
; DELAY - Create delay 1/100 sec
780
; DELAY - Create delay 1/100 sec
Line 781... Line 781...
781
; (SYNTAX)  Delay time
781
; (SYNTAX)  Delay time
782
; (SAMPLE)  Delay 100   ;delay 2 sec 1/100*200=2 sec
782
; (SAMPLE)  Delay 100   ;delay 2 sec 1/100*200=2 sec
783
 
783
 
784
macro delay arg1
784
macro delay arg1
785
{
785
{
786
    mov eax,5
786
    mov eax,5
Line 787... Line 787...
787
    mov ebx,arg1
787
    mov ebx,arg1
788
    int 0x40
788
    mcall
789
}
789
}
Line 798... Line 798...
798
;    mov ecx,arg2*65536+arg4
798
;    mov ecx,arg2*65536+arg4
799
    words2reg ebx,arg1,arg3
799
    words2reg ebx,arg1,arg3
800
    words2reg ecx,arg2,arg4
800
    words2reg ecx,arg2,arg4
801
    mov edx,arg5
801
    mov edx,arg5
802
    mov eax,0
802
    mov eax,0
803
    int 0x40
803
    mcall
804
}
804
}
Line 805... Line 805...
805
 
805
 
806
macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7
806
macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7
807
{
807
{
808
    mov ebx,arg1*65536+arg3
808
    mov ebx,arg1*65536+arg3
809
    mov ecx,arg2*65536+arg4
809
    mov ecx,arg2*65536+arg4
810
    mov edx,arg5
810
    mov edx,arg5
811
    mov esi,arg6
811
    mov esi,arg6
812
    mov edi,arg7
812
    mov edi,arg7
813
    mov eax,0
813
    mov eax,0
814
    int 0x40
814
    mcall
Line 815... Line 815...
815
}
815
}
Line 816... Line 816...
816
 
816
 
817
 
817
 
818
; STARTWD - Start of window draw
818
; STARTWD - Start of window draw
819
 
819
 
820
macro startwd
820
macro startwd
821
{
821
{
Line 822... Line 822...
822
    mov eax,12
822
    mov eax,12
Line 823... Line 823...
823
    mov ebx,1
823
    mov ebx,1
824
    int 0x40
824
    mcall
825
}
825
}
826
 
826
 
827
; ENDWD - End window draw
827
; ENDWD - End window draw
828
 
828
 
Line 829... Line 829...
829
macro endwd
829
macro endwd
830
{
830
{
831
    mov eax,12
831
    mov eax,12
Line 852... Line 852...
852
   dword2reg ecx,arg4
852
   dword2reg ecx,arg4
Line 853... Line 853...
853
 
853
 
854
    mov edx,lab
854
    mov edx,lab
855
    mov esi,asd-lab          ;calc size
855
    mov esi,asd-lab          ;calc size
856
    mov eax,4
856
    mov eax,4
857
    int 0x40
857
    mcall
Line 858... Line 858...
858
}
858
}
859
 
859
 
860
;Key's
860
;Key's