Rev 8288 | Rev 8996 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8288 | Rev 8993 | ||
---|---|---|---|
Line 107... | Line 107... | ||
107 | y_minimal_size equ 250 |
107 | y_minimal_size equ 250 |
108 | ;--------------------------------------------------------------------- |
108 | ;--------------------------------------------------------------------- |
109 | START: |
109 | START: |
110 | mcall SF_SYS_MISC,SSF_HEAP_INIT |
110 | mcall SF_SYS_MISC,SSF_HEAP_INIT |
111 | ;mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 |
111 | ;mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 |
112 | mcall SF_SET_EVENTS_MASK,0x27 |
112 | mcall SF_SET_EVENTS_MASK,EVM_REDRAW+EVM_KEY+\ |
- | 113 | EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER |
|
113 | ;-------------------------------------- |
114 | ;-------------------------------------- |
114 | load_libraries l_libs_start,end_l_libs |
115 | load_libraries l_libs_start,end_l_libs |
115 | test eax,eax |
116 | test eax,eax |
116 | jnz button.exit_2 |
117 | jnz button.exit_2 |
117 | ;-------------------------------------- |
118 | ;-------------------------------------- |
Line 123... | Line 124... | ||
123 | mov [palette_SIZE_X],eax |
124 | mov [palette_SIZE_X],eax |
124 | mov ax,p_size_y |
125 | mov ax,p_size_y |
125 | mov [palette_SIZE_Y],eax |
126 | mov [palette_SIZE_Y],eax |
126 | mov [tone_SIZE_X],eax |
127 | mov [tone_SIZE_X],eax |
127 | mov [tone_SIZE_Y],eax |
128 | mov [tone_SIZE_Y],eax |
- | 129 | ||
- | 130 | ;set the last used color as a current one |
|
- | 131 | mov eax,[communication_area] |
|
128 | mov eax,0xff0000 |
132 | add eax,28 |
129 | mov [tone_color],eax |
133 | mov eax,[eax] |
130 | mov [selected_color],eax |
134 | mov [selected_color],eax |
- | 135 | mov [tone_color],eax |
|
131 | call prepare_scrollbars_position_from_color |
136 | call prepare_scrollbars_position_from_color |
132 | ;-------------------------------------- |
137 | ;-------------------------------------- |
133 | mov ecx,[palette_SIZE_Y] |
138 | mov ecx,[palette_SIZE_Y] |
134 | imul ecx,[palette_SIZE_X] |
139 | imul ecx,[palette_SIZE_X] |
135 | lea ecx,[ecx*3] |
140 | lea ecx,[ecx*3] |
Line 149... | Line 154... | ||
149 | call create_tone |
154 | call create_tone |
150 | ;--------------------------------------------------------------------- |
155 | ;--------------------------------------------------------------------- |
151 | align 4 |
156 | align 4 |
152 | red: |
157 | red: |
153 | call draw_window |
158 | call draw_window |
- | 159 | ;mov ah,0 |
|
- | 160 | ;jmp button.history_click |
|
154 | ;--------------------------------------------------------------------- |
161 | ;--------------------------------------------------------------------- |
155 | align 4 |
162 | align 4 |
156 | still: |
163 | still: |
157 | mcall SF_WAIT_EVENT |
164 | mcall SF_WAIT_EVENT |
Line 188... | Line 195... | ||
188 | 195 | ||
189 | cmp ah, 39 |
196 | cmp ah, 39 |
Line 190... | Line 197... | ||
190 | ja @f |
197 | ja @f |
- | 198 | ||
- | 199 | sub ah,30 |
|
191 | 200 | ||
192 | sub ah,30 |
201 | .history_click: |
193 | movzx eax,ah |
202 | movzx eax,ah |
194 | shl eax,2 |
203 | shl eax,2 |
195 | add eax,[communication_area] |
204 | add eax,[communication_area] |
Line 300... | Line 309... | ||
300 | je @f |
309 | je @f |
301 | mov [edi+24],dword 1 |
310 | mov [edi+24],dword 1 |
302 | add edi,28 |
311 | add edi,28 |
303 | mov ecx,10 |
312 | mov ecx,10 |
304 | cld |
313 | cld |
305 | mov eax,0xffffff |
314 | mov eax,0x06BEEE |
306 | rep stosd |
315 | rep stosd |
307 | @@: |
316 | @@: |
308 | ret |
317 | ret |
309 | ;--------------------------------------------------------------------- |
318 | ;--------------------------------------------------------------------- |
310 | align 4 |
319 | align 4 |
Line 410... | Line 419... | ||
410 | ret |
419 | ret |
411 | ;--------------------------------------------------------------------- |
420 | ;--------------------------------------------------------------------- |
412 | align 4 |
421 | align 4 |
413 | key: |
422 | key: |
414 | mcall SF_GET_KEY |
423 | mcall SF_GET_KEY |
- | 424 | ||
415 | test word[edit1.flags],10b ;ed_focus |
425 | test word[edit1.flags],10b ;ed_focus |
- | 426 | jne @f |
|
- | 427 | cmp ah,027 ; Esc |
|
- | 428 | je button.exit |
|
416 | je still |
429 | jmp still |
- | 430 | @@: |
|
417 | stdcall [edit_box_key], edit1 |
431 | stdcall [edit_box_key], edit1 |
418 | stdcall conv_str_to_int, [edit1.text] |
432 | stdcall conv_str_to_int, [edit1.text] |
419 | cmp [selected_color],eax |
433 | cmp [selected_color],eax |
420 | je still |
434 | je still |
421 | mov [selected_color],eax |
435 | mov [selected_color],eax |
Line 463... | Line 477... | ||
463 | jmp still |
477 | jmp still |
464 | ;--------------------------------------------------------------------- |
478 | ;--------------------------------------------------------------------- |
465 | align 4 |
479 | align 4 |
466 | draw_selected_color: |
480 | draw_selected_color: |
467 | mcall SF_DRAW_RECT, |
481 | mcall SF_DRAW_RECT, |
468 | stdcall hex_in_str, sz_0x+2,[selected_color],6 |
482 | stdcall hex_in_str, sz_0x,[selected_color],6 |
469 | mov byte[sz_0x+8],0 |
483 | mov byte[sz_0x+6],0 |
470 | stdcall [edit_box_set_text],edit1,sz_0x |
484 | stdcall [edit_box_set_text],edit1,sz_0x |
471 | stdcall [edit_box_draw],edit1 |
485 | stdcall [edit_box_draw],edit1 |
472 | ret |
486 | ret |
473 | ;--------------------------------------------------------------------- |
487 | ;--------------------------------------------------------------------- |
474 | align 4 |
488 | align 4 |
Line 640... | Line 654... | ||
640 | popad |
654 | popad |
641 | ret |
655 | ret |
642 | endp |
656 | endp |
643 | ;--------------------------------------------------------------------- |
657 | ;--------------------------------------------------------------------- |
644 | ;input: |
658 | ;input: |
645 | ; buf - указатель на строку, число должно быть в 10 или 16 ричном виде |
659 | ; buf - pointer hexadecimal string |
646 | ;output: |
660 | ;output: |
647 | ; eax - число |
661 | ; eax - number |
648 | align 4 |
662 | align 4 |
649 | proc conv_str_to_int uses ebx ecx esi, buf:dword |
663 | proc conv_str_to_int uses ebx ecx esi, buf:dword |
650 | xor eax,eax |
664 | xor eax,eax |
651 | xor ebx,ebx |
665 | xor ebx,ebx |
652 | mov esi,[buf] |
666 | mov esi,[buf] |
Line 653... | Line -... | ||
653 | - | ||
654 | ;на случай если перед числом находятся пробелы |
- | |
655 | @@: |
- | |
656 | cmp byte[esi],' ' |
- | |
657 | jne @f |
- | |
658 | inc esi |
- | |
659 | jmp @b |
- | |
660 | @@: |
- | |
661 | - | ||
662 | ;определение отрицательных чисел |
- | |
663 | xor ecx,ecx |
- | |
664 | inc ecx |
- | |
665 | cmp byte[esi],'-' |
- | |
666 | jne @f |
- | |
667 | dec ecx |
- | |
668 | inc esi |
- | |
669 | @@: |
- | |
670 | - | ||
671 | cmp word[esi],'0x' |
- | |
672 | je .load_digit_16 |
- | |
673 | - | ||
674 | .load_digit_10: ;считывание 10-тичных цифр |
- | |
675 | mov bl,byte[esi] |
- | |
676 | cmp bl,'0' |
- | |
677 | jl @f |
- | |
678 | cmp bl,'9' |
- | |
679 | jg @f |
- | |
680 | sub bl,'0' |
- | |
681 | imul eax,10 |
- | |
682 | add eax,ebx |
- | |
683 | inc esi |
- | |
684 | jmp .load_digit_10 |
- | |
685 | jmp @f |
- | |
686 | 667 | ||
687 | .load_digit_16: ;считывание 16-ричных цифр |
- | |
688 | add esi,2 |
- | |
689 | .cycle_16: |
668 | .cycle_16: ;считывание 16-ричных цифр |
690 | mov bl,byte[esi] |
669 | mov bl,byte[esi] |
691 | cmp bl,'0' |
670 | cmp bl,'0' |
692 | jl @f |
671 | jl @f |
693 | cmp bl,'f' |
672 | cmp bl,'f' |