Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9646 → Rev 9647

/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
 
/programs/media/piano/piano.asm
17,6 → 17,7
 
include "lang.inc"
include "../../macros.inc"
include "../../KOSfuncs.inc"
 
 
START:
27,9 → 28,7
 
 
still:
;mcall 10 ; äã­ªæ¨ï 10 - ¦¤ âì ᮡëâ¨ï
mov eax, 10
int 0x40
mcall SF_WAIT_EVENT
 
cmp eax,2 ; ­ ¦ â  ª« ¢¨è  ?
je key ; ¥á«¨ ¤  - ­  key
46,7 → 45,7
 
 
key: ; ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãà¥
mcall 2 ; äã­ªæ¨ï 2 - áç¨â âì ª®¤ ᨬ¢®«  (¢ ah)
mcall SF_GET_KEY ; áç¨â âì ª®¤ ᨬ¢®«  (¢ ah)
 
 
cmp ah, 0x41 ; A - if Caps Lock ON
562,13 → 561,13
; äã­ªæ¨ï 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
;---------------------------------------------------------------------
 
button:
mcall 17 ; 17 - ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
mcall SF_GET_BUTTON
 
cmp ah, 0xa1 ; button 1
jnz @f
782,7 → 781,7
jne still ; ¢¥à­ãâìáï
 
.exit:
mcall -1 ; ¨­ ç¥ ª®­¥æ ¯à®£à ¬¬ë
mcall SF_TERMINATE_PROCESS ; ¨­ ç¥ ª®­¥æ ¯à®£à ¬¬ë
 
 
;---------------------------------------------------------------------
795,81 → 794,81
 
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, <WHITE_W*0,WHITE_W>, <0,100>, 0x21, 0xff7a74
mcall 8, <WHITE_W*1,WHITE_W>, <0,100>, 0x23, 0x907040
mcall 8, <WHITE_W*2,WHITE_W>, <0,100>, 0x25, 0xa08050
mcall 8, <WHITE_W*3,WHITE_W>, <0,100>, 0x26, 0xb09060
mcall 8, <WHITE_W*4,WHITE_W>, <00,100>, 0x28, 0xc0a070
mcall 8, <WHITE_W*5,WHITE_W>, <00,100>, 0x2a, 0xd0b080
mcall 8, <WHITE_W*6,WHITE_W>, <0,100>, 0x2c, 0xe0c090
mcall 8, <WHITE_W*7,WHITE_W>, <0,100>, 0x31, 0xffa97c
mcall 8, <WHITE_W*8,WHITE_W>, <0,100>, 0x33, 0xaf8d8d
mcall 8, <WHITE_W*9,WHITE_W>, <0,100>, 0x35, 0xbf9d9d
mcall 8, <WHITE_W*10,WHITE_W>, <0,100>, 0x36, 0xcfadad
mcall 8, <WHITE_W*11,WHITE_W>, <00,100>, 0x38, 0xdfbdbd
mcall 8, <WHITE_W*12,WHITE_W>, <00,100>, 0x3a, 0xefcdcd
mcall 8, <WHITE_W*13,WHITE_W>, <0,100>, 0x3c, 0xffdddd
mcall 8, <WHITE_W*14,WHITE_W>, <0,100>, 0x41, 0xffe558
mcall SF_DEFINE_BUTTON, <WHITE_W*0,WHITE_W>, <0,100>, 0x21, 0xff7a74
mcall , <WHITE_W*1,WHITE_W>, <0,100>, 0x23, 0x907040
mcall , <WHITE_W*2,WHITE_W>, , 0x25, 0xa08050
mcall , <WHITE_W*3,WHITE_W>, , 0x26, 0xb09060
mcall , <WHITE_W*4,WHITE_W>, , 0x28, 0xc0a070
mcall , <WHITE_W*5,WHITE_W>, , 0x2a, 0xd0b080
mcall , <WHITE_W*6,WHITE_W>, , 0x2c, 0xe0c090
mcall , <WHITE_W*7,WHITE_W>, , 0x31, 0xffa97c
mcall , <WHITE_W*8,WHITE_W>, , 0x33, 0xaf8d8d
mcall , <WHITE_W*9,WHITE_W>, , 0x35, 0xbf9d9d
mcall , <WHITE_W*10,WHITE_W>, , 0x36, 0xcfadad
mcall , <WHITE_W*11,WHITE_W>, , 0x38, 0xdfbdbd
mcall , <WHITE_W*12,WHITE_W>, , 0x3a, 0xefcdcd
mcall , <WHITE_W*13,WHITE_W>, , 0x3c, 0xffdddd
mcall , <WHITE_W*14,WHITE_W>, , 0x41, 0xffe558
 
mcall 8, <WHITE_W*0+BLACK_X,BLACK_W>, <0,50>, 0x22, 0x221100
mcall 8, <WHITE_W*1+BLACK_X,BLACK_W>, <0,50>, 0x24, 0x221100
mcall 8, <WHITE_W*3+BLACK_X,BLACK_W>, <0,50>, 0x27, 0x221100
mcall 8, <WHITE_W*4+BLACK_X,BLACK_W>, <0,50>, 0x29, 0x221100
mcall 8, <WHITE_W*5+BLACK_X,BLACK_W>, <0,50>, 0x2b, 0x221100
mcall 8, <WHITE_W*7+BLACK_X,BLACK_W>, <0,50>, 0x32, 0x221100
mcall 8, <WHITE_W*8+BLACK_X,BLACK_W>, <0,50>, 0x34, 0x221100
mcall 8, <WHITE_W*10+BLACK_X,BLACK_W>, <0,50>, 0x37, 0x221100
mcall 8, <WHITE_W*11+BLACK_X,BLACK_W>, <0,50>, 0x39, 0x221100
mcall 8, <WHITE_W*12+BLACK_X,BLACK_W>, <0,50>, 0x3b, 0x221100
mcall , <WHITE_W*0+BLACK_X,BLACK_W>, <0,50>, 0x22, 0x221100
mcall , <WHITE_W*1+BLACK_X,BLACK_W>, , 0x24,
mcall , <WHITE_W*3+BLACK_X,BLACK_W>, , 0x27,
mcall , <WHITE_W*4+BLACK_X,BLACK_W>, , 0x29,
mcall , <WHITE_W*5+BLACK_X,BLACK_W>, , 0x2b,
mcall , <WHITE_W*7+BLACK_X,BLACK_W>, , 0x32,
mcall , <WHITE_W*8+BLACK_X,BLACK_W>, , 0x34,
mcall , <WHITE_W*10+BLACK_X,BLACK_W>, , 0x37,
mcall , <WHITE_W*11+BLACK_X,BLACK_W>, , 0x39,
mcall , <WHITE_W*12+BLACK_X,BLACK_W>, , 0x3b,
 
mcall 8, <WHITE_W*0,WHITE_W>, <100,100>, 0xa1, 0x702050
mcall 8, <WHITE_W*1,WHITE_W>, <100,100>, 0x03, 0x683638
mcall 8, <WHITE_W*2,WHITE_W>, <100,100>, 0x05, 0x784648
mcall 8, <WHITE_W*3,WHITE_W>, <100,100>, 0x06, 0x885658
mcall 8, <WHITE_W*4,WHITE_W>, <100,100>, 0x08, 0x986668
mcall 8, <WHITE_W*5,WHITE_W>, <100,100>, 0x0a, 0xa87678
mcall 8, <WHITE_W*6,WHITE_W>, <100,100>, 0x0c, 0xb88688
mcall 8, <WHITE_W*7,WHITE_W>, <100,100>, 0x11, 0x880040
mcall 8, <WHITE_W*8,WHITE_W>, <100,100>, 0x13, 0x90622b
mcall 8, <WHITE_W*9,WHITE_W>, <100,100>, 0x15, 0xa0723b
mcall 8, <WHITE_W*10,WHITE_W>, <100,100>, 0x16, 0xb0824b
mcall 8, <WHITE_W*11,WHITE_W>, <100,100>, 0x18, 0xc0925b
mcall 8, <WHITE_W*12,WHITE_W>, <100,100>, 0x1a, 0xd0a26b
mcall 8, <WHITE_W*13,WHITE_W>, <100,100>, 0x1c, 0xe0b27b
mcall 8, <WHITE_W*14,WHITE_W>, <100,100>, 0x21, 0xff7a74
mcall , <WHITE_W*0,WHITE_W>, <100,100>, 0xa1, 0x702050
mcall , <WHITE_W*1,WHITE_W>, , 0x03, 0x683638
mcall , <WHITE_W*2,WHITE_W>, , 0x05, 0x784648
mcall , <WHITE_W*3,WHITE_W>, , 0x06, 0x885658
mcall , <WHITE_W*4,WHITE_W>, , 0x08, 0x986668
mcall , <WHITE_W*5,WHITE_W>, , 0x0a, 0xa87678
mcall , <WHITE_W*6,WHITE_W>, , 0x0c, 0xb88688
mcall , <WHITE_W*7,WHITE_W>, , 0x11, 0x880040
mcall , <WHITE_W*8,WHITE_W>, , 0x13, 0x90622b
mcall , <WHITE_W*9,WHITE_W>, , 0x15, 0xa0723b
mcall , <WHITE_W*10,WHITE_W>, , 0x16, 0xb0824b
mcall , <WHITE_W*11,WHITE_W>, , 0x18, 0xc0925b
mcall , <WHITE_W*12,WHITE_W>, , 0x1a, 0xd0a26b
mcall , <WHITE_W*13,WHITE_W>, , 0x1c, 0xe0b27b
mcall , <WHITE_W*14,WHITE_W>, , 0x21, 0xff7a74
 
mcall 8, <WHITE_W*0+BLACK_X,BLACK_W>, <100,50>, 0x02, 0x221100
mcall 8, <WHITE_W*1+BLACK_X,BLACK_W>, <100,50>, 0x04, 0x221100
mcall 8, <WHITE_W*3+BLACK_X,BLACK_W>, <100,50>, 0x07, 0x221100
mcall 8, <WHITE_W*4+BLACK_X,BLACK_W>, <100,50>, 0x09, 0x221100
mcall 8, <WHITE_W*5+BLACK_X,BLACK_W>, <100,50>, 0x0b, 0x221100
mcall 8, <WHITE_W*7+BLACK_X,BLACK_W>, <100,50>, 0x12, 0x221100
mcall 8, <WHITE_W*8+BLACK_X,BLACK_W>, <100,50>, 0x14, 0x221100
mcall 8, <WHITE_W*10+BLACK_X,BLACK_W>, <100,50>, 0x17, 0x221100
mcall 8, <WHITE_W*11+BLACK_X,BLACK_W>, <100,50>, 0x19, 0x221100
mcall 8, <WHITE_W*12+BLACK_X,BLACK_W>, <100,50>, 0x1b, 0x221100
mcall , <WHITE_W*0+BLACK_X,BLACK_W>, <100,50>, 0x02, 0x221100
mcall , <WHITE_W*1+BLACK_X,BLACK_W>, , 0x04,
mcall , <WHITE_W*3+BLACK_X,BLACK_W>, , 0x07,
mcall , <WHITE_W*4+BLACK_X,BLACK_W>, , 0x09,
mcall , <WHITE_W*5+BLACK_X,BLACK_W>, , 0x0b,
mcall , <WHITE_W*7+BLACK_X,BLACK_W>, , 0x12,
mcall , <WHITE_W*8+BLACK_X,BLACK_W>, , 0x14,
mcall , <WHITE_W*10+BLACK_X,BLACK_W>, , 0x17,
mcall , <WHITE_W*11+BLACK_X,BLACK_W>, , 0x19,
mcall , <WHITE_W*12+BLACK_X,BLACK_W>, , 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