Subversion Repositories Kolibri OS

Rev

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

Rev 111 Rev 122
Line 1... Line 1...
1
; SYSTEM HAEDER:
1
; SYSTEM HEADER:
2
   use32
2
   use32
3
   org 0x0
3
   org 0x0
4
   db  'MENUET01'  ; identifier
4
   db  'MENUET01'  ; identifier
5
   dd  0x01        ; version
5
   dd  0x01        ; version
6
   dd  START       ; pointer to start
6
   dd  START       ; pointer to start
7
   dd  TINYPAD_END ; size of file
7
   dd  TINYPAD_END ; size of file
8
   dd  0x300f00 ;0x500000; 0x3fff00;0x300000    ; size of memory
8
   dd  0x300f00 ;0x500000; 0x3fff00;0x300000    ; size of memory
9
   dd  0xeff0 ;0x4fffff ;0x3ff000;0xeff0      ; esp
9
   dd  0xeff0 ;0x4fffff ;0x3ff000;0xeff0      ; esp
10
   dd  I_PARAM     ; parameters
10
   dd  I_PARAM     ; parameters
11
   dd  0           ; reserved
11
   dd  0           ; reserved
12
include 'lang.inc'
-
 
13
include 'ascl.inc'
12
include 'ascl.inc'
-
 
13
include 'lang.inc'
14
include 'macros.inc' ; useful stuff
14
include 'macros.inc' ; useful stuff
15
include 'dialogs1.inc'
15
include 'dialogs1.inc'
16
include 'scroll.inc'
16
include 'scroll.inc'
17
;include 'debug.inc'
17
include 'debug.inc'
18
purge mov            ;  SPEED
18
purge mov            ;  SPEED
19
;******************************************************************************
19
;******************************************************************************
20
; INITIALIZING
20
; INITIALIZING
21
START:
21
START:
22
;debug_print_hex TINYPAD_END
22
;debug_print_hex TINYPAD_END
23
call mask_events
23
call mask_events
Line 24... Line 24...
24
 
24
 
25
    cmp    [I_PARAM],byte 0
25
    cmp    [I_PARAM],byte 0
Line -... Line 26...
-
 
26
    jz     noparams
-
 
27
 
-
 
28
;//Willow
-
 
29
    cmp    byte[I_PARAM],'*'
-
 
30
    jne    .noipc
-
 
31
; convert size from decimal representation to dword
-
 
32
        mov     esi, I_PARAM+1
-
 
33
        xor     edx, edx
-
 
34
        xor     eax, eax
-
 
35
@@:
-
 
36
        lodsb
-
 
37
        test    al, al
-
 
38
        jz      @f
-
 
39
        lea     edx, [edx*4+edx]
-
 
40
        lea     edx, [edx*2+eax]
-
 
41
        jmp     @b
-
 
42
@@:
-
 
43
    add    edx,20
-
 
44
    mcall  60,1,0x10000-16
-
 
45
    mov    dword[0x10000+-16+4],8
-
 
46
    mcall  40,1000000b
-
 
47
    mcall  23,200
-
 
48
;    dpd    eax
-
 
49
    cmp    eax,7
-
 
50
    jne    exit_now
-
 
51
    mov    esi,0x10000-16
-
 
52
    mov    byte[esi],1
-
 
53
    call   mask_events
-
 
54
    mov    eax,[esi+12]
-
 
55
    inc    eax
-
 
56
    call   file_found
-
 
57
    jmp    do_load_file.restorecursor
26
    jz     noparams
58
  .noipc:
27
 
59
;//Willow
28
    ; parameters are at I_PARAM
60
    ; parameters are at I_PARAM
29
    mov    esi,I_PARAM
61
    mov    esi,I_PARAM
30
    mov    edi,filename
62
    mov    edi,filename
Line 411... Line 443...
411
mov ecx,100*65536+170
443
mov ecx,100*65536+170
412
mov edx,cl_White
444
mov edx,cl_White
413
int 0x40
445
int 0x40
Line 414... Line 446...
414
 
446
 
415
 
447
 
Line 416... Line 448...
416
 
448
if lang eq ru
417
 putlabel 190,120,'‘®åà ­¨âì ¤®ªã¬¥­â?',cl_White
449
 putlabel 190,120,'‘®åà ­¨âì ¤®ªã¬¥­â?',cl_White
418
 
450
 
-
 
451
 drawlbut 170,140,30,15,'„ ',49,[sc.work_button],cl_White
-
 
452
 drawlbut 230,140,30,15,'¥â',48,[sc.work_button],cl_White
-
 
453
 drawlbut 290,140,45,15,'Žâ¬¥­ ',47,[sc.work_button],cl_White
-
 
454
else
-
 
455
 putlabel 190,120,'Save the document?',cl_White
-
 
456
 
-
 
457
 drawlbut 170,140,30,15,'Yes',49,[sc.work_button],cl_White
Line 419... Line 458...
419
 drawlbut 170,140,30,15,'„ ',49,[sc.work_button],cl_White
458
 drawlbut 230,140,30,15,'No',48,[sc.work_button],cl_White
420
 drawlbut 230,140,30,15,'¥â',48,[sc.work_button],cl_White
459
 drawlbut 290,140,45,15,'Cancel',47,[sc.work_button],cl_White
Line 421... Line 460...
421
 drawlbut 290,140,45,15,'Žâ¬¥­ ',47,[sc.work_button],cl_White
460
end if
Line 2535... Line 2574...
2535
    mov  esi,38
2574
    mov  esi,38
2536
    int  0x40
2575
    int  0x40
Line 2537... Line 2576...
2537
 
2576
 
2538
    cmp [modified],1
2577
    cmp [modified],1
-
 
2578
    jne no_mod
2539
    jne no_mod
2579
if lang eq ru
-
 
2580
     putlabel 270,386,'ˆ‡Œ……',[sc.work_button_text]
-
 
2581
else
-
 
2582
     putlabel 270,386,'MODIFIED',[sc.work_button_text]
2540
     putlabel 270,386,'ˆ‡Œ……',[sc.work_button_text]
2583
end if
2541
    no_mod:
2584
    no_mod:
Line 2542... Line 2585...
2542
    popa
2585
    popa
Line 2573... Line 2616...
2573
mov ebx,55*65536+435
2616
mov ebx,55*65536+435
2574
mov ecx,160*65536+160
2617
mov ecx,160*65536+160
2575
mov edx,cl_White
2618
mov edx,cl_White
2576
int 0x40
2619
int 0x40
Line 2577... Line 2620...
2577
 
2620
 
2578
 
2621
if lang eq ru
2579
drawlbut 375,110,50,15,'®¨áª',50,[sc.work_button],[sc.work_button_text]
2622
drawlbut 375,110,50,15,'®¨áª',50,[sc.work_button],[sc.work_button_text]
-
 
2623
drawlbut 375,130,50,15,'Žâ¬¥­ ',94,[sc.work_button],[sc.work_button_text]
-
 
2624
else
-
 
2625
drawlbut 375,110,50,15,'Search',50,[sc.work_button],[sc.work_button_text]
-
 
2626
drawlbut 375,130,50,15,'Cancel',94,[sc.work_button],[sc.work_button_text]
Line 2580... Line 2627...
2580
drawlbut 375,130,50,15,'Žâ¬¥­ ',94,[sc.work_button],[sc.work_button_text]
2627
end if
Line 2581... Line 2628...
2581
 
2628
 
2582
call read_string
2629
call read_string
Line 2616... Line 2663...
2616
mov ebx,350*65536+350
2663
mov ebx,350*65536+350
2617
mov ecx,100*65536+170
2664
mov ecx,100*65536+170
2618
mov edx,cl_White
2665
mov edx,cl_White
2619
int 0x40
2666
int 0x40
Line 2620... Line 2667...
2620
 
2667
 
2621
 
2668
if lang eq ru
-
 
2669
 putlabel 195,120,'‘âப  ­¥ ­ ©¤¥­ !',cl_White
-
 
2670
else
-
 
2671
 putlabel 195,120,'String not found!',cl_White
Line 2622... Line 2672...
2622
 putlabel 195,120,'‘âப  ­¥ ­ ©¤¥­­ !',cl_White
2672
end if
Line 2623... Line 2673...
2623
 
2673
 
Line 3499... Line 3549...
3499
mov ebx,350*65536+350
3549
mov ebx,350*65536+350
3500
mov ecx,100*65536+170
3550
mov ecx,100*65536+170
3501
mov edx,cl_White
3551
mov edx,cl_White
3502
int 0x40
3552
int 0x40
Line 3503... Line 3553...
3503
 
3553
 
3504
 
3554
if lang eq ru
Line 3505... Line 3555...
3505
 putlabel 190,120,'‘®åà ­¨âì ¤®ªã¬¥­â?',cl_White
3555
 putlabel 190,120,'‘®åà ­¨âì ¤®ªã¬¥­â?',cl_White
3506
 
3556
 
3507
 drawlbut 170,140,30,15,'„ ',46,[sc.work_button],cl_White
3557
 drawlbut 170,140,30,15,'„ ',46,[sc.work_button],cl_White
-
 
3558
 drawlbut 230,140,30,15,'¥â',45,[sc.work_button],cl_White
-
 
3559
 drawlbut 290,140,45,15,'Žâ¬¥­ ',47,[sc.work_button],cl_White
-
 
3560
else
-
 
3561
 putlabel 190,120,'Save document?',cl_White
-
 
3562
 
-
 
3563
 drawlbut 170,140,30,15,'Yes',46,[sc.work_button],cl_White
-
 
3564
 drawlbut 230,140,30,15,'No',45,[sc.work_button],cl_White
Line 3508... Line 3565...
3508
 drawlbut 230,140,30,15,'¥â',45,[sc.work_button],cl_White
3565
 drawlbut 290,140,45,15,'Cancel',47,[sc.work_button],cl_White
3509
 drawlbut 290,140,45,15,'Žâ¬¥­ ',47,[sc.work_button],cl_White
3566
end if
3510
 
3567
 
3511
 mov [exit_wnd_on],1
3568
 mov [exit_wnd_on],1
Line 3664... Line 3721...
3664
int 0x40
3721
int 0x40
3665
mov ecx,39*65536+5
3722
mov ecx,39*65536+5
3666
mov edx,0x00aaaaaa
3723
mov edx,0x00aaaaaa
3667
int 0x40
3724
int 0x40
Line -... Line 3725...
-
 
3725
 
3668
 
3726
if lang eq ru
3669
drawlbut 5,22,70,15,'” ©«',97,[sc.work_button],[sc.work_button_text]
3727
drawlbut 5,22,70,15,'” ©«',97,[sc.work_button],[sc.work_button_text]
3670
drawlbut 75,22,70,15,'Š®¤',98,[sc.work_button],[sc.work_button_text]
3728
drawlbut 75,22,70,15,'Š®¤',98,[sc.work_button],[sc.work_button_text]
3671
drawlbut 145,22,70,15,'’¥ªáâ',96,[sc.work_button],[sc.work_button_text]
3729
drawlbut 145,22,70,15,'’¥ªáâ',96,[sc.work_button],[sc.work_button_text]
-
 
3730
drawlbut 431,22,70,15,'‘¯à ¢ª ',99,[sc.work_button],[sc.work_button_text]
-
 
3731
else
-
 
3732
drawlbut 5,22,70,15,'File',97,[sc.work_button],[sc.work_button_text]
-
 
3733
drawlbut 75,22,70,15,'Code',98,[sc.work_button],[sc.work_button_text]
-
 
3734
drawlbut 145,22,70,15,'Text',96,[sc.work_button],[sc.work_button_text]
-
 
3735
drawlbut 431,22,70,15,'Help',99,[sc.work_button],[sc.work_button_text]
Line 3672... Line 3736...
3672
drawlbut 431,22,70,15,'‘¯à ¢ª ',99,[sc.work_button],[sc.work_button_text]
3736
end if
Line 3673... Line 3737...
3673
 
3737
 
3674
ret
3738
ret
Line 3686... Line 3750...
3686
;mov ecx,40*65536+47
3750
;mov ecx,40*65536+47
3687
;mov edx,0x00ff0000
3751
;mov edx,0x00ff0000
3688
;int 0x40
3752
;int 0x40
3689
mov [menu_is_on],1
3753
mov [menu_is_on],1
Line -... Line 3754...
-
 
3754
 
3690
 
3755
if lang eq ru
3691
drawlbut 5,38,70,15,'®¢®¥ ®ª­®',100,[sc.grab_button],[sc.grab_button_text]
3756
drawlbut 5,38,70,15,'®¢®¥ ®ª­®',100,[sc.grab_button],[sc.grab_button_text]
3692
drawlbut 5,53,70,15,'®¢ë©',101,[sc.grab_button],[sc.grab_button_text]
3757
drawlbut 5,53,70,15,'®¢ë©',101,[sc.grab_button],[sc.grab_button_text]
3693
drawlbut 5,68,70,15,'‘®åà ­¨âì',2,[sc.grab_button],[sc.grab_button_text]
3758
drawlbut 5,68,70,15,'‘®åà ­¨âì',2,[sc.grab_button],[sc.grab_button_text]
3694
drawlbut 5,83,70,15,'‘®åà. ª ª',102,[sc.grab_button],[sc.grab_button_text]
3759
drawlbut 5,83,70,15,'‘®åà. ª ª',102,[sc.grab_button],[sc.grab_button_text]
3695
drawlbut 5,98,70,15,'Žâªàëâì',103,[sc.grab_button],[sc.grab_button_text]
3760
drawlbut 5,98,70,15,'Žâªàëâì',103,[sc.grab_button],[sc.grab_button_text]
-
 
3761
drawlbut 5,113,70,15,'‚ë室',104,[sc.grab_button],[sc.grab_button_text]
-
 
3762
else
-
 
3763
drawlbut 5,38,70,15,'New window',100,[sc.grab_button],[sc.grab_button_text]
-
 
3764
drawlbut 5,53,70,15,'New',101,[sc.grab_button],[sc.grab_button_text]
-
 
3765
drawlbut 5,68,70,15,'Save',2,[sc.grab_button],[sc.grab_button_text]
-
 
3766
drawlbut 5,83,70,15,'Save as',102,[sc.grab_button],[sc.grab_button_text]
-
 
3767
drawlbut 5,98,70,15,'Open',103,[sc.grab_button],[sc.grab_button_text]
-
 
3768
drawlbut 5,113,70,15,'Exit',104,[sc.grab_button],[sc.grab_button_text]
3696
drawlbut 5,113,70,15,'‚ë室',104,[sc.grab_button],[sc.grab_button_text]
3769
end if
Line 3697... Line 3770...
3697
jmp still
3770
jmp still
3698
 
3771
 
3699
draw_win_menu_code:
3772
draw_win_menu_code:
-
 
3773
call clear_screen
3700
call clear_screen
3774
call drawwindow
3701
call drawwindow
3775
if lang eq ru
3702
drawlbut 75,38,70,15,'Š®¬¯¨«.',10000,[sc.grab_button],[sc.grab_button_text]
3776
drawlbut 75,38,70,15,'Š®¬¯¨«.',10000,[sc.grab_button],[sc.grab_button_text]
3703
drawlbut 75,53,70,15,'‡ ¯ãáâ¨âì',10001,[sc.grab_button],[sc.grab_button_text]
3777
drawlbut 75,53,70,15,'‡ ¯ãáâ¨âì',10001,[sc.grab_button],[sc.grab_button_text]
-
 
3778
drawlbut 75,68,70,15,'„®áª  ®â«.',10002,[sc.grab_button],[sc.grab_button_text]
-
 
3779
drawlbut 75,83,70,15,'SysFunc',10003,[sc.grab_button],[sc.grab_button_text]
-
 
3780
else
-
 
3781
drawlbut 75,38,70,15,'Compile',10000,[sc.grab_button],[sc.grab_button_text]
-
 
3782
drawlbut 75,53,70,15,'Run',10001,[sc.grab_button],[sc.grab_button_text]
-
 
3783
drawlbut 75,68,70,15,'Debug board',10002,[sc.grab_button],[sc.grab_button_text]
3704
drawlbut 75,68,70,15,'„®áª  ®â«.',10002,[sc.grab_button],[sc.grab_button_text]
3784
drawlbut 75,83,70,15,'SysFunc',10003,[sc.grab_button],[sc.grab_button_text]
3705
drawlbut 75,83,70,15,'SysFunc',10003,[sc.grab_button],[sc.grab_button_text]
3785
end if
Line 3706... Line 3786...
3706
mov [menu_is_on],1
3786
mov [menu_is_on],1
3707
jmp still
3787
jmp still
3708
 
3788
 
-
 
3789
draw_win_menu_text:
3709
draw_win_menu_text:
3790
call clear_screen
3710
call clear_screen
3791
call drawwindow
3711
call drawwindow
3792
if lang eq ru
-
 
3793
drawlbut 145,38,70,15,'GoTo Line#',95,[sc.grab_button],[sc.grab_button_text]
-
 
3794
drawlbut 145,53,70,15,' ©â¨',92,[sc.grab_button],[sc.grab_button_text]
-
 
3795
drawlbut 145,68,70,15,' ©â¨ ¤ «¥¥',50,[sc.grab_button],[sc.grab_button_text]
-
 
3796
else
-
 
3797
drawlbut 145,38,70,15,'GoTo Line#',95,[sc.grab_button],[sc.grab_button_text]
3712
drawlbut 145,38,70,15,'GoTo Line#',95,[sc.grab_button],[sc.grab_button_text]
3798
drawlbut 145,53,70,15,'Find',92,[sc.grab_button],[sc.grab_button_text]
3713
drawlbut 145,53,70,15,' ©â¨',92,[sc.grab_button],[sc.grab_button_text]
3799
drawlbut 145,68,70,15,'Find next',50,[sc.grab_button],[sc.grab_button_text]
Line 3714... Line 3800...
3714
drawlbut 145,68,70,15,' ©â¨ ¤ «¥¥',50,[sc.grab_button],[sc.grab_button_text]
3800
end if
3715
mov [menu_is_on],1
3801
mov [menu_is_on],1
Line 3722... Line 3808...
3722
int 0x40
3808
int 0x40
3723
jmp still
3809
jmp still
Line 3724... Line 3810...
3724
 
3810
 
3725
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3811
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
 
3812
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3726
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3813
if lang eq ru
3727
openerrtext db 'Žè¨¡ª  ®âªàëâ¨ï ä ©«  ¨«¨ ®âªàë⨥ ®â¬¥­¥­®!',0
3814
openerrtext db 'Žè¨¡ª  ®âªàëâ¨ï ä ©«  ¨«¨ ®âªàë⨥ ®â¬¥­¥­®!',0
3728
saveerrtext db 'Žè¨¡ª  á®åà ­¥­¨ï ä ©«  ¨«¨ á®åà ­¥­¨¥ ®â¬¥­¥­®!',0
3815
saveerrtext db 'Žè¨¡ª  á®åà ­¥­¨ï ä ©«  ¨«¨ á®åà ­¥­¨¥ ®â¬¥­¥­®!',0
-
 
3816
newfileerror db '¥¢®§¬®¦­® ᮧ¤ âì ­®¢ë© ä ©«',0
-
 
3817
else
-
 
3818
openerrtext db 'Error while opening file or opening canceled!',0
-
 
3819
saveerrtext db 'Error while saving file or saving canceled!',0
-
 
3820
newfileerror db 'Cannot create new file',0
3729
newfileerror db '¥¢®§¬®¦­® á®å¤ âì ­®¢ë© ä ©«',0
3821
end if
3730
; ********************
3822
; ********************
3731
; ******  DATA  ******
3823
; ******  DATA  ******
3732
; ********************
3824
; ********************
3733
sz fasm_filename,    'FASM        '
3825
sz fasm_filename,    'FASM        '