diff --git a/programs/demos/crownscr/trunk/crownscr.asm b/programs/demos/crownscr/trunk/crownscr.asm index b939ee0b91..870da1ecc9 100644 --- a/programs/demos/crownscr/trunk/crownscr.asm +++ b/programs/demos/crownscr/trunk/crownscr.asm @@ -4,7 +4,7 @@ ; ; You may add you own figures. See file FIGURES.INC ; -; Compile with FASM v1.48 for Menuet or hier (FASM v1.40 contains bug) +; Compile with FASM v1.73 for Kolibri or hier ; ; Copyright(c) 2002-2004 Crown_s Soft. All rights reserved. ; @@ -35,12 +35,13 @@ copyrightlen: include "lang.inc" include "figuresi.inc" include "..\..\..\macros.inc" +include "..\..\..\KOSfuncs.inc" start: cmp dword[params], '@ss' setz [screensaver] mov ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON cmovz ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE - mcall 40 + mcall SF_SET_EVENTS_MASK cmp [flscr],0 jz @f @@ -48,9 +49,9 @@ start: xor eax, eax mov ecx, 32*32 rep stosd - mcall 37, 4, transparent_cursor, 2 + mcall SF_MOUSE_GET, SSF_LOAD_CURSOR, transparent_cursor, 2 mov ecx, eax - mcall 37, 5 + mcall SF_MOUSE_GET, SSF_SET_CURSOR @@: cld finit @@ -62,8 +63,7 @@ start: cmp [flscr],0 jz nofullscreen - mov eax,14 - mcall + mcall SF_GET_SCREEN_SIZE mov [maxy],ax sub ax,const480 @@ -95,7 +95,7 @@ red: call draw_window still: - mcall 23,delay ; wait here for event + mcall SF_WAIT_EVENT_TIMEOUT, delay ; wait here for event cmp eax,1 ; redraw request ? je red @@ -107,7 +107,7 @@ still: je close call calcframe - mov eax,07 ; putimage + mov eax,SF_PUT_IMAGE mov ebx,scr ; ebx pointer to image in memory mov ecx,[outsize] ; ecx=image position in window [w]*65536+[h] mov edx,dword [posy] ; edx=image position in window [x]*65536+[y] @@ -118,8 +118,7 @@ key: cmp [screensaver], 0 jnz close - mov eax,2 - mcall + mcall SF_GET_KEY cmp al,1 ; is key in buffer ? jz still @@ -130,9 +129,9 @@ jmp still close: cmp [screensaver], 0 jz @f - mcall 70, f70 + mcall SF_FILE, f70 @@: - mcall -1 + mcall SF_TERMINATE_PROCESS ; ********************************************* @@ -141,16 +140,16 @@ close: draw_window: - mcall 12, 1 ;start draw + mcall SF_REDRAW, SSF_BEGIN_DRAW ;start draw cmp [flscr],0 jnz m2 - mcall 48,4 + mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT mov esi, eax ; DRAW WINDOW mov ecx,100*65536+const480+4 ; [y start] *65536 + [y size] add ecx, esi - mcall 0, 100*65536+const480+9,,0x74000000,,copyright + mcall SF_CREATE_WINDOW, 100*65536+const480+9,,0x74000000,,copyright jmp m3 m2: @@ -165,11 +164,10 @@ draw_window: inc bx inc cx - mov eax,13 ; functiom 13 : draw bar - mcall + mcall SF_DRAW_RECT m3: - mcall 12, 2 ;end draw + mcall SF_REDRAW, SSF_END_DRAW ;end draw ret @@ -326,8 +324,7 @@ ret filling_alfbet: ; Initialize RND - mov eax,3 - mcall + mcall SF_GET_SYS_TIME ; eax - fist random number mov ecx,n_points @@ -394,7 +391,7 @@ align 2 z1 dd ? f70: ; run - dd 7, 0, 0, 0, 0 + dd SSF_START_APP, 0, 0, 0, 0 db '/sys/@SS',0 screensaver db ? diff --git a/programs/demos/cslide/trunk/cslide.asm b/programs/demos/cslide/trunk/cslide.asm index 13b0b60b55..3f5cae91d3 100644 --- a/programs/demos/cslide/trunk/cslide.asm +++ b/programs/demos/cslide/trunk/cslide.asm @@ -2,7 +2,7 @@ ; ; ; Color Slider Control Demonstration ; ; ; -; Compile with FASM for Menuet ; +; Compile with FASM for Kolibri ; ; ; ; Author: Jason Delozier ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -21,6 +21,7 @@ use32 include 'lang.inc' include '..\..\..\macros.inc' +include '..\..\..\KOSfuncs.inc' START: ; start of execution call draw_window ; at first, draw the window @@ -28,7 +29,7 @@ START: ; start of execution still: call mouse_info - mcall 23, 2 + mcall SF_WAIT_EVENT_TIMEOUT, 2 cmp eax,1 ; redraw request ? je red @@ -44,17 +45,17 @@ still: jmp still key: ; key - mcall 2 ; just read it and ignore + mcall SF_GET_KEY ; just read it and ignore jmp still button: ; button - mcall 17 ; get id + mcall SF_GET_BUTTON ; get id shr eax,8 cmp eax,1 ; button id=1 ? jne noclose - mcall -1 ; close this program + mcall SF_TERMINATE_PROCESS ; close this program noclose: @@ -68,9 +69,9 @@ still: draw_window: - mcall 12, 1 ; 1, start of draw - mcall 0, <100,200>, <100,200>, 0x14ffffff, , title ; DRAW WINDOW - mcall 12,2 ; end WINDOW redraw + mcall SF_REDRAW, SSF_BEGIN_DRAW + mcall SF_CREATE_WINDOW, <100,200>, <100,200>, 0x14ffffff, , title + mcall SF_REDRAW, SSF_END_DRAW call draw_slider_info @@ -95,10 +96,10 @@ mousex dw 0 mouseb dd 0 mouse_info: - mcall 37, 1 ;get mouse cordinates + mcall SF_MOUSE_GET, SSF_WINDOW_POSITION mov ecx, eax ; push ecx ; - mcall 37, 2 ;get mouse buttons + mcall SF_MOUSE_GET, SSF_BUTTON cmp [mouseb], eax ;compare old mouse states to new states jne redraw_mouse_info ; cmp [mousey], cx ; @@ -150,7 +151,7 @@ ret draw_slider_info: ;Repaint value background - mcall 13, 144*65536+36, 72*65536+9, 0x00ffffff + mcall SF_DRAW_RECT, 144*65536+36, 72*65536+9, 0x00ffffff ;Draw Color Box xor edx, edx movzx ecx,word [slider_1+12] @@ -162,11 +163,11 @@ draw_slider_info: mov dl,cl mov ebx, 0x00860035 mov ecx, 0x00590040 - mov eax, 13 + mov eax, SF_DRAW_RECT mcall ;draw current value of slider mov ecx, edx - mov eax, 47 + mov eax, SF_DRAW_NUMBER mov ebx, 0x00060100 mov esi, 0 mov edx, 144*65536+72 @@ -234,12 +235,9 @@ slider_3: box_h dw 10 ;static slider box height draw_slider: - push eax - push ebx - push ecx - push edx + push eax ebx ecx edx ;Draw slider background - mov eax, 13 ;slider background + mov eax, SF_DRAW_RECT ;slider background mov ebx, [ebp] ;x start/width mov ecx, [ebp+4] ;y start/height mov edx, 0x00EBEBEB ;color @@ -256,7 +254,7 @@ draw_slider: add ecx, 0x000A0000 ; add ecx, [ebp+6] ;y start sub ecx, 10 ; - mov edx, 0x00 ;color + mov edx, 0x00 ;color mcall ; ;Draw slider box movzx eax,word [ebp+4] ;height @@ -275,20 +273,14 @@ draw_slider: sub ecx, eax ;*slide box y position shl ecx, 16 ; mov cx, [box_h] ;height - mov eax, 13 ;draw bar sys function + mov eax, SF_DRAW_RECT ;draw bar sys function mov edx, 0x00 ;color mcall ;draw slider box - pop edx - pop ecx - pop ebx - pop eax + pop edx ecx ebx eax ret slider_mouse_over: - push eax - push ebx - push ecx - push edx + push eax ebx ecx edx cmp [mouseb], 1 jne slider_mouse_over_done movzx eax,word [ebp+4] @@ -322,10 +314,7 @@ slider_mouse_change: ; call draw_slider ; call draw_slider_info ; slider_mouse_over_done: ; - pop edx - pop ecx - pop ebx - pop eax + pop edx ecx ebx eax ret diff --git a/programs/demos/movback/trunk/movback.asm b/programs/demos/movback/trunk/movback.asm index 6be90ca34b..39a81d0d37 100644 --- a/programs/demos/movback/trunk/movback.asm +++ b/programs/demos/movback/trunk/movback.asm @@ -1,5 +1,6 @@ include "lang.inc" include "../../../macros.inc" +include "../../../KOSfuncs.inc" WND_SIZE_X = 320 WND_SIZE_Y = 200 @@ -13,23 +14,18 @@ CODE call init_sinus_table call init_background call init_palette - mov eax,40 - mov ebx,101b - mcall + mcall SF_SET_EVENTS_MASK, 101b jmp .paint_window .event_loop: - mov eax,23 - mov ebx,1 - mcall + mcall SF_WAIT_EVENT_TIMEOUT, 1 test eax,eax je .draw_screen dec eax je .paint_window - or eax,-1 - mcall + mcall SF_TERMINATE_PROCESS .draw_screen: test [proc_info.wnd_state], 0x04 @@ -38,29 +34,25 @@ CODE add word [hor_counter],HC_DELTA call handle_animation xor ebp,ebp - mcall 65,virtual_screen_8,,<0,0>,8,_palette + mcall SF_PUT_IMAGE_EXT, virtual_screen_8,,<0,0>,8,_palette jmp .event_loop .paint_window: - mcall 9,proc_info,-1 - mov eax,12 - mov ebx,1 - mcall + mcall SF_THREAD_INFO, proc_info,-1 + mcall SF_REDRAW, SSF_BEGIN_DRAW - mcall 48,4 ; get skin height + mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT lea ecx,[eax + (100 shl 16) + WND_SIZE_Y+4] mov edi,title - mcall 0,<100,WND_SIZE_X+9>,,0x74000000 + mcall SF_CREATE_WINDOW, <100,WND_SIZE_X+9>,,0x74000000 test [proc_info.wnd_state], 0x04 jnz @f xor ebp,ebp - mcall 65,virtual_screen_8,,<0,0>,8,_palette + mcall SF_PUT_IMAGE_EXT, virtual_screen_8,,<0,0>,8,_palette @@: - mov eax,12 - mov ebx,2 - mcall + mcall SF_REDRAW, SSF_END_DRAW jmp .event_loop diff --git a/programs/media/piano/piano.asm b/programs/media/piano/piano.asm index dc4ca0ac46..107f405be6 100644 --- a/programs/media/piano/piano.asm +++ b/programs/media/piano/piano.asm @@ -17,6 +17,7 @@ include "lang.inc" include "../../macros.inc" +include "../../KOSfuncs.inc" START: @@ -27,9 +28,7 @@ red: ; still: - ;mcall 10 ; функция 10 - ждать события - mov eax, 10 - int 0x40 + mcall SF_WAIT_EVENT cmp eax,2 ; нажата клавиша ? je key ; если да - на key @@ -46,7 +45,7 @@ still: key: ; нажата клавиша на клавиатуре - mcall 2 ; функция 2 - считать код символа (в ah) + mcall SF_GET_KEY ; считать код символа (в ah) cmp ah, 0x41 ; A - if Caps Lock ON @@ -562,13 +561,13 @@ still: ; функция 55-55: системный динамик ("PlayNote") ; esi - адрес мелодии - mov eax,55 + mov eax,SF_SPEAKER_PLAY mov ebx,eax mov esi,M int 0x40 ; или коротко: - ;mcall 55, , , , Music + ;mcall SF_SPEAKER_PLAY, , , , Music jmp still ; вернуться к началу цикла @@ -576,7 +575,7 @@ still: ;--------------------------------------------------------------------- button: - mcall 17 ; 17 - получить идентификатор нажатой кнопки + mcall SF_GET_BUTTON cmp ah, 0xa1 ; button 1 jnz @f @@ -782,7 +781,7 @@ still: jne still ; вернуться .exit: - mcall -1 ; иначе конец программы + mcall SF_TERMINATE_PROCESS ; иначе конец программы ;--------------------------------------------------------------------- @@ -795,81 +794,81 @@ BLACK_X=34 ; Black key X offset draw_window: - mcall 12, 1 ; функция 12: сообщить ОС о начале отрисовки + mcall SF_REDRAW, SSF_BEGIN_DRAW ; сообщить ОС о начале отрисовки - mcall 48, 3, sc,sizeof.system_colors + mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, sc,sizeof.system_colors mov edx, [sc.work] ; цвет фона or edx, 0x33000000 ; и тип окна 3 - mcall 0, <20,WHITE_W*15+9>, <200,250>, , ,caption + mcall SF_CREATE_WINDOW, <20,WHITE_W*15+9>, <200,250>, , ,caption - mcall 8, , <0,100>, 0x21, 0xff7a74 - mcall 8, , <0,100>, 0x23, 0x907040 - mcall 8, , <0,100>, 0x25, 0xa08050 - mcall 8, , <0,100>, 0x26, 0xb09060 - mcall 8, , <00,100>, 0x28, 0xc0a070 - mcall 8, , <00,100>, 0x2a, 0xd0b080 - mcall 8, , <0,100>, 0x2c, 0xe0c090 - mcall 8, , <0,100>, 0x31, 0xffa97c - mcall 8, , <0,100>, 0x33, 0xaf8d8d - mcall 8, , <0,100>, 0x35, 0xbf9d9d - mcall 8, , <0,100>, 0x36, 0xcfadad - mcall 8, , <00,100>, 0x38, 0xdfbdbd - mcall 8, , <00,100>, 0x3a, 0xefcdcd - mcall 8, , <0,100>, 0x3c, 0xffdddd - mcall 8, , <0,100>, 0x41, 0xffe558 + mcall SF_DEFINE_BUTTON, , <0,100>, 0x21, 0xff7a74 + mcall , , <0,100>, 0x23, 0x907040 + mcall , , , 0x25, 0xa08050 + mcall , , , 0x26, 0xb09060 + mcall , , , 0x28, 0xc0a070 + mcall , , , 0x2a, 0xd0b080 + mcall , , , 0x2c, 0xe0c090 + mcall , , , 0x31, 0xffa97c + mcall , , , 0x33, 0xaf8d8d + mcall , , , 0x35, 0xbf9d9d + mcall , , , 0x36, 0xcfadad + mcall , , , 0x38, 0xdfbdbd + mcall , , , 0x3a, 0xefcdcd + mcall , , , 0x3c, 0xffdddd + mcall , , , 0x41, 0xffe558 - mcall 8, , <0,50>, 0x22, 0x221100 - mcall 8, , <0,50>, 0x24, 0x221100 - mcall 8, , <0,50>, 0x27, 0x221100 - mcall 8, , <0,50>, 0x29, 0x221100 - mcall 8, , <0,50>, 0x2b, 0x221100 - mcall 8, , <0,50>, 0x32, 0x221100 - mcall 8, , <0,50>, 0x34, 0x221100 - mcall 8, , <0,50>, 0x37, 0x221100 - mcall 8, , <0,50>, 0x39, 0x221100 - mcall 8, , <0,50>, 0x3b, 0x221100 + mcall , , <0,50>, 0x22, 0x221100 + mcall , , , 0x24, + mcall , , , 0x27, + mcall , , , 0x29, + mcall , , , 0x2b, + mcall , , , 0x32, + mcall , , , 0x34, + mcall , , , 0x37, + mcall , , , 0x39, + mcall , , , 0x3b, - mcall 8, , <100,100>, 0xa1, 0x702050 - mcall 8, , <100,100>, 0x03, 0x683638 - mcall 8, , <100,100>, 0x05, 0x784648 - mcall 8, , <100,100>, 0x06, 0x885658 - mcall 8, , <100,100>, 0x08, 0x986668 - mcall 8, , <100,100>, 0x0a, 0xa87678 - mcall 8, , <100,100>, 0x0c, 0xb88688 - mcall 8, , <100,100>, 0x11, 0x880040 - mcall 8, , <100,100>, 0x13, 0x90622b - mcall 8, , <100,100>, 0x15, 0xa0723b - mcall 8, , <100,100>, 0x16, 0xb0824b - mcall 8, , <100,100>, 0x18, 0xc0925b - mcall 8, , <100,100>, 0x1a, 0xd0a26b - mcall 8, , <100,100>, 0x1c, 0xe0b27b - mcall 8, , <100,100>, 0x21, 0xff7a74 + mcall , , <100,100>, 0xa1, 0x702050 + mcall , , , 0x03, 0x683638 + mcall , , , 0x05, 0x784648 + mcall , , , 0x06, 0x885658 + mcall , , , 0x08, 0x986668 + mcall , , , 0x0a, 0xa87678 + mcall , , , 0x0c, 0xb88688 + mcall , , , 0x11, 0x880040 + mcall , , , 0x13, 0x90622b + mcall , , , 0x15, 0xa0723b + mcall , , , 0x16, 0xb0824b + mcall , , , 0x18, 0xc0925b + mcall , , , 0x1a, 0xd0a26b + mcall , , , 0x1c, 0xe0b27b + mcall , , , 0x21, 0xff7a74 - mcall 8, , <100,50>, 0x02, 0x221100 - mcall 8, , <100,50>, 0x04, 0x221100 - mcall 8, , <100,50>, 0x07, 0x221100 - mcall 8, , <100,50>, 0x09, 0x221100 - mcall 8, , <100,50>, 0x0b, 0x221100 - mcall 8, , <100,50>, 0x12, 0x221100 - mcall 8, , <100,50>, 0x14, 0x221100 - mcall 8, , <100,50>, 0x17, 0x221100 - mcall 8, , <100,50>, 0x19, 0x221100 - mcall 8, , <100,50>, 0x1b, 0x221100 + mcall , , <100,50>, 0x02, 0x221100 + mcall , , , 0x04, + mcall , , , 0x07, + mcall , , , 0x09, + mcall , , , 0x0b, + mcall , , , 0x12, + mcall , , , 0x14, + mcall , , , 0x17, + mcall , , , 0x19, + mcall , , , 0x1b, ; вывод текстовой строки mov ecx, [sc.work_text] ; цвет фона or ecx, 0x90000000 ; и тип строки - mcall 4, <50, 205>, , message - mcall 4, <10, 235>, , message1 - mcall 4, <10, 260>, , message2 - mcall 4, <10, 285>, , message3 - mcall 4, <10, 310>, , message4 - mcall 4, <16, 185>, , t_notes + mcall SF_DRAW_TEXT, <50, 205>, , message + mcall , <10, 235>, , message1 + mcall , <10, 260>, , message2 + mcall , <10, 285>, , message3 + mcall , <10, 310>, , message4 + mcall , <16, 185>, , t_notes - mcall 12, 2 ; функция 12.2, закончили рисовать + mcall SF_REDRAW, SSF_END_DRAW ; закончили рисовать ret