Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 485 → Rev 484

/programs/develop/heed/trunk/heed.asm
23,7 → 23,7
dd 0x0 , 0x0 ; I_Param , I_Icon
 
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
 
 
START: ; start of execution
30,16 → 30,14
 
mov eax,40
mov ebx,100111b ;event mouse
mcall
int 0x40
mov dword [process_info+42],540
mov dword [process_info+46],414
 
red:
call draw_window
 
still:
mov eax,10 ; wait here for event
mcall
int 0x40
dec al ; redraw request ?
je red
dec al ; key in buffer ?
50,7 → 48,7
mouse:
mov eax,37
mov ebx,2
mcall
int 0x40
or eax,eax
jz still
cmp [menu_opened],1
57,10 → 55,13
jne still
mov [menu_opened],0
 
red: ; redraw
call redraw_window
jmp still
 
key: ; key
mov eax,2
mcall
int 0x40
; test al,al
; jnz still
cmp ah,KEY_ESC
229,18 → 230,18
or edx,edi
mov eax,47
add edx,8
mcall
int 0x40
call redraw_window
jmp still
 
button: ; button
mov eax,17 ; get id
mcall
int 0x40
dec ah ;close programm button
jne @f
close:
mov eax,-1 ; close this program
mcall
int 0x40
@@:
dec ah
jne @f
382,7 → 383,7
xor ecx,ecx
or edx,-1
mov esi,0x10000
mcall
int 0x40
inc [o_s_flag]
mov [sizefile],eax
jmp end_Go
394,7 → 395,7
xor esi,esi
dec edx
mov eax,33
mcall
int 0x40
end_Go:
call CtrlHome
jmp still
645,7 → 646,7
sub edx,0x10
mov esi,0x10
mov eax,4
mcall
int 0x40
pop eax
pop ecx
loop @b
667,7 → 668,7
add edx,[esp+0x24] ;­ ç «® ¯® “
mov esi,0x00ffffff ;梥â
mov eax,47 ;¢ë¢¥á⨠ç¨á«®
mcall
int 0x40
add edx,0x600000 ;0x40 - 8chars + 0x20 - space
mov ebx,0x20100 ;2 æ¨äàë, 16-à¨ç­ë¥, ç¨á«® ¢ ecx
@@:
676,7 → 677,7
and ecx,0xff
cmp edi,0x11
jz endstr
mcall
int 0x40
add edx,0x100000
jmp @b
endstr:
694,12 → 695,12
mov ecx,[esp+0x24]
mov edx,[color]
mov eax,13
mcall
int 0x40
movzx edi,[o_s_flag]
and edi,8
jnz @f
add ebx,[text_cursor]
mcall
int 0x40
@@:
popad
ret 4
730,13 → 731,13
mov ecx,[sc.work_button_text]
or ecx,0x10000000
sub eax,4
mcall
int 0x40
add ebx,0x0c ;next full base text
add edx,4 ;next string
mcall
int 0x40
add ebx,0x0c
add edx,4
mcall
int 0x40
ret
 
menucoding:
758,7 → 759,7
or ecx,0x10000000
sub eax,4
@@:
mcall
int 0x40
add ebx,0x0c
add edx,8 ;next string
dec edi
781,11 → 782,11
mov ecx,[sc.work_button_text]
or ecx,0x10000000
sub eax,4
mcall
int 0x40
add ebx,0x0c
inc esi ;add lebgth output text
add edx,4
mcall
int 0x40
ret
 
f1:;uses for drawing low-level menu buttons
797,7 → 798,7
push ecx ;for output text
@@:
add ecx,0xc0000
mcall
int 0x40
inc edx ;id
dec edi ;counter
jnz @b
818,7 → 819,7
mov edx,0x10000a0
mov eax,47
mov esi,0x00ffffff
mcall
int 0x40
popad
ret 4
 
832,11 → 833,11
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
mcall
int 0x40
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
; [x start] *65536 + [x size]
844,7 → 845,7
; [y start] *65536 + [y size]
mov ecx,[process_info+46]
mov edx,0x03000000 ; color of work area RRGGBB,8->color gl
mcall
int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
852,7 → 853,7
or ecx,0x10000000 ; font 1 & color ( 0xF0RRGGBB )
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
mcall
int 0x40
;check for only header window output
cmp dword [process_info+46],25
jle minimaze_view
872,7 → 873,7
shl ecx,0x10
mov eax,13
add ecx,0x10
mcall
int 0x40
;MENU BUTTONS
;now in hi-half ecx register begin Y-coord. menu area
;in hi-half ebx begin X-coord.
887,18 → 888,18
mov [xf_menu],ebx;for low-level menus func.
mov eax,8
push ebx ;for output buttons texts
mcall
int 0x40
;registers is't change
;menu 'Coding'
add ebx,0x290018 ;80x12
inc edx ;menu 'coding' id = 3
mov [xe_menu],ebx;for low-level menus func.
mcall
int 0x40
;menu 'Help'
add ebx,0x40ffe8 ;+0x280000 - 0x28, 40x12
inc edx ;menu 'Help' id = 4
mov [xh_menu],ebx;for low-level menus func.
mcall
int 0x40
;MENU BUTTONS TEXTS
;'File'
pop ebx
913,7 → 914,7
mov ecx,[sc.work_button_text]
or ecx,0x10000000 ; font 1 & color ( 0xF0RRGGBB )
push esi ;for 'Help' menu text
mcall
int 0x40
;'coding'
;registers is't change
add ebx,0x2d0000
921,7 → 922,7
add esi,2
; mov edx,e_menu
add edx,4
mcall
int 0x40
;'Help'
add ebx,0x3b0000
; mov esi,4
928,7 → 929,7
pop esi
; mov edx,h_menu
add edx,6
mcall
int 0x40
;LOW_LEVEL MENU
;for every hi-level menu exists one procedure
;in begin programm they are not calls,
950,7 → 951,7
shl ecx,16 ;y start
mov eax,13
add ecx,20
mcall
int 0x40
 
;filename input area
; mov ecx,[process_info+46]
965,7 → 966,7
add ecx,16
mov eax,13
push ecx ;for button 'Go'
mcall
int 0x40
 
;button 'Go', press in case open/save if filename input complete
;button size = 24x16
975,7 → 976,7
dec ecx
mov edx,0xff ;id
mov esi,[sc.work_button]
mcall
int 0x40
shr ecx,0x10
and ebx,0xffff0000
add ecx,0x50004
985,7 → 986,7
mov ecx,[sc.work_button_text]
or ecx,0x10000000
sub eax,4
mcall
int 0x40
 
;where output cursor?
mov al,[o_s_flag]
1010,7 → 1011,7
add ebx,eax
movzx esi,[name_l]
mov eax,4
mcall
int 0x40
 
;info strings
; sizefile text
1023,13 → 1024,13
mov edx,sizestr ; pointer to text beginning
mov eax,4
mov esi,5
mcall
int 0x40
add ebx,0x00530000
inc esi
; mov edx,offst
add edx,5
inc esi
mcall
int 0x40
;sizefile
mov ecx,[sizefile]
mov edx,ebx
1037,10 → 1038,10
sub edx,0x00350000
mov eax,47
mov ebx,0x80100
mcall
int 0x40
mov ecx,[current]
add edx,0x005f0000
mcall
int 0x40
 
push [text_cursor] ;íâ® ¯®§¨æ¨ï ªãàá®à  ¢ ⥪á⮢®© áâப¥
call draw_cursor
1051,7 → 1052,7
minimaze_view:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
popad
ret
 
1065,7 → 1066,7
mov ebx,process_info
xor ecx,ecx
dec ecx
mcall
int 0x40
popad
ret
 
1103,7 → 1104,7
mov ecx,[esp+0x24]
inc ebx
mov edx,0x7E000 ;0x1000
mcall
int 0x40
popad
ret 4
 
1111,7 → 1112,7
call help_window
help_still:
mov eax,10
mcall
int 0x40
dec eax
jz help_red
dec eax
1125,28 → 1126,28
help_key:
inc eax
inc eax
mcall
int 0x40
jmp help_still
help_button:
mov eax,17
mcall
int 0x40
dec ah
jne help_still
shr eax,8
dec eax
mcall
int 0x40
 
help_window:
pushad
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,0x500140 ; [x start] *65536 + [x size]
mov ecx,0x700110 ; [y start] *65536 + [y size]
mov edx,0x03000000 ; color of work area RRGGBB,8->color gl
mcall
int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
1153,7 → 1154,7
mov ecx,0x10ffffff ; font 1 & color ( 0xF0RRGGBB )
mov edx,help_label ; pointer to text beginning
mov esi,14 ; text length
mcall
int 0x40
; HELP TEXT
add edx,14 ;help_text addr.
add esi,37 ; = 51 - length 1 line
1161,7 → 1162,7
mov edi,(help_end-help_text)/51
@@:
add ebx,0x10
mcall
int 0x40
add edx,51
dec edi
jnz @b
1169,7 → 1170,7
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
popad
ret
 
1177,7 → 1178,7
call about_window
about_still:
mov eax,10
mcall
int 0x40
dec eax
jz about_red
dec eax
1191,28 → 1192,28
about_key:
inc eax
inc eax
mcall
int 0x40
jmp about_still
about_button:
mov eax,17
mcall
int 0x40
dec ah
jne about_still
shr eax,8
dec eax
mcall
int 0x40
 
about_window:
pushad
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,0x500140 ; [x start] *65536 + [x size]
mov ecx,0x700110 ; [y start] *65536 + [y size]
mov edx,0x03000000 ; color of work area RRGGBB,8->color gl
mcall
int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
1220,7 → 1221,7
or ecx,0x10000000 ; font 1 & color ( 0xF0RRGGBB )
mov edx,about_label ; pointer to text beginning
mov esi,17 ; text length
mcall
int 0x40
; ABOUT TEXT
add edx,17 ;about_text addr.
add esi,34 ; = 51 - length 1 line
1228,7 → 1229,7
mov edi,15
@@:
add ebx,0x10
mcall
int 0x40
add edx,51
dec edi
jnz @b
1235,7 → 1236,7
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
popad
ret