/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 |
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 |
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 |
cmp [flscr],0 |
jz nofullscreen |
mov eax,14 |
mcall |
mcall SF_GET_SCREEN_SIZE |
mov [maxy],ax |
sub ax,const480 |
95,7 → 95,7 |
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 |
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 |
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 |
close: |
cmp [screensaver], 0 |
jz @f |
mcall 70, f70 |
mcall SF_FILE, f70 |
@@: |
mcall -1 |
mcall SF_TERMINATE_PROCESS |
; ********************************************* |
141,16 → 140,16 |
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 |
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 |
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 |
z1 dd ? |
f70: ; run |
dd 7, 0, 0, 0, 0 |
dd SSF_START_APP, 0, 0, 0, 0 |
db '/sys/@SS',0 |
screensaver db ? |
/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 |
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 |
still: |
call mouse_info |
mcall 23, 2 |
mcall SF_WAIT_EVENT_TIMEOUT, 2 |
cmp eax,1 ; redraw request ? |
je red |
44,17 → 45,17 |
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 |
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 |
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 |
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 |
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 |
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 |
275,20 → 273,14 |
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 |
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 |
/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,15 → 14,11 |
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 |
28,8 → 25,7 |
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 |
add word [hor_counter],HC_DELTA |
call handle_animation |
xor ebp,ebp |
mcall 65,virtual_screen_8,<WND_SIZE_X,WND_SIZE_Y>,<0,0>,8,_palette |
mcall SF_PUT_IMAGE_EXT, virtual_screen_8,<WND_SIZE_X,WND_SIZE_Y>,<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,<WND_SIZE_X,WND_SIZE_Y>,<0,0>,8,_palette |
mcall SF_PUT_IMAGE_EXT, virtual_screen_8,<WND_SIZE_X,WND_SIZE_Y>,<0,0>,8,_palette |
@@: |
mov eax,12 |
mov ebx,2 |
mcall |
mcall SF_REDRAW, SSF_END_DRAW |
jmp .event_loop |