Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 272 → Rev 316

/programs/demos/3dcube2/trunk/3DCUBE2.ASM
49,7 → 49,7
; cmp eax,3 ; button in buffer ?
jz button
 
fps 280,8,cl_White,cl_Black
fps 230,8,cl_White,cl_Black
 
main_loop:
 
104,26 → 104,18
mov eax,0 ;Draw window
mov ebx,100*65536+(SCREEN_X+9) ;x start*65536+x size
mov ecx,100*65536+(SCREEN_Y+26) ;y start*65536+y size
mov edx,0x03000000 ;0x03 use skinned window
mov edx,0x13000000 ;0x03 use skinned window
mov edi,header
int 0x40
 
mov eax,4 ;Out Text
mov ebx,8*65536+8 ;x start*65536+y start
mov ecx,0x00ffffff ;color White
mov edx,head_label
mov esi,hl_end-head_label
int 0x40
 
mov eax,12 ;End
mov ebx,2
int 0x40
ret
 
head_label: db "3D TEST SAMPLE FOR MENUETOS"
hl_end:
header db '3D TEST SAMPLE FOR MENUETOS',0
 
 
 
; Draw faces procedure
 
draw_faces:
/programs/demos/bcdclk/bcdclk/bcdclk.asm
13,8 → 13,8
dd 0x01
dd START
dd I_END
dd 0x100000
dd 0x7fff0
dd 0x1000
dd 0x1000
dd 0x0 , 0x0
 
include "lang.inc"
22,7 → 22,7
 
 
START:
 
red:
call drawwindow
 
still:
42,17 → 42,13
 
jmp still
 
red: ; redraw
call drawwindow
jmp still
 
button:
mov eax,17 ; get id
mov al,17 ; get id
int 0x40
 
cmp ah,1 ; button id=1 ?
jne noclose
mov eax,-1 ; close this program
or eax,-1 ; close this program
int 0x40
noclose:
 
77,7 → 73,7
mov ebx,74*65536+10
mov edi,dg1
digitlp:
mov ecx,30*65536+10
mov ecx,10*65536+10
xor esi,esi
plotlp:
xor edx,edx
122,24 → 118,15
mov ebx,1 ; start redraw
int 0x40
 
mov eax,0 ; window
mov ebx,100*65536+100
mov ecx,100*65536+100
mov edx,0x83400088
mov esi,0x805080d0
mov edi,0x000000ff
xor eax,eax ; window
mov ebx,100*65536+107
mov ecx,100*65536+105
mov edx,0x33400088
mov edi,header
int 0x40
 
call drawclock
 
mov eax,4 ; text
mov ebx,8*65536+8
mov ecx,0x10ddeeff
mov edx,title
mov esi,titlend-title
int 0x40
 
 
mov eax,12
mov ebx,2 ; end redraw
int 0x40
146,12 → 133,6
 
ret
 
 
 
title:
db 'BCD Clock'
titlend:
 
dg1: db ?
 
I_END:
header db 'BCD Clock',0
I_END:
dg1: db ?
/programs/demos/bgitest/trunk/bgitest.asm
64,7 → 64,7
dd START
dd I_END
dd 0x100000
dd 0x0cfff0
dd 0x100000
dd 0x0
not1strun dd 0x0
 
223,12 → 223,19
jmp still
 
draw_window:
 
mov eax,48
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
int 0x40
 
mov eax,12
mov ebx,1
int 0x40
 
xor eax,eax
mov ebx,10*65536+_X*2
mov ebx,10*65536+_X*2+30
mov ecx,100*65536+_Y*2
mov edx,0x03261212
mov esi,0x805080d0
237,7 → 244,8
 
mov eax,4
mov ebx,8*65536+8
mov ecx,0x10ddeeff
mov ecx,[sc.grab_text]
or ecx,0x10000000
mov edx,title
mov esi,title_end-title
cmp [help],2
439,5 → 447,5
help db ?
pinfo:
times 1024 db ?
rb 10000 ; reserve, unless process info will corrupt our fonts (why?)
sc system_colors
I_END:
/programs/demos/colorref/trunk/colorref.asm
148,16 → 148,9
mov eax,0 ; DRAW WINDOW
mov ebx,1*65536+200 ; [x start] *65536 + [x size]
mov ecx,200*65536+240 ; [y start] *65536 + [y size]
mov edx,0x03000000 ; work area color (type II)
mov esi,0x82a0a0a0 ; grab bar color (w/glide)
mov edi,0x82bbbbbb ; frame color
mov edx,0x13000000 ; work area color (type II)
mov edi,header ; frame color
int 0x40
mov eax,4 ; WINDOW LABEL
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0xeeeeee ; color of text (white)
mov edx,prog_name ; pointer to header
mov esi,namelen-prog_name ; text length
int 0x40
call palette ; display color palette
 
325,9 → 318,7
; ********** DATA DEFINITIONS AREA ***********
; *********************************************
 
prog_name:
db 'COLOR REFERENCE H>HELP'
namelen:
header db 'COLOR REFERENCE H>HELP',0
 
picks:
dd 31,2 ; selected top/bot colors
/programs/demos/cslide/trunk/cslide.asm
79,17 → 79,9
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+200 ; [x start] *65536 + [x size]
mov ecx,100*65536+200 ; [y start] *65536 + [y size]
mov edx,0x03ffffff ; color of work area RRGGBB,8->color gl
mov esi,0x806688cc
mov edi,0x006688cc
mov edx,0x13ffffff ; color of work area RRGGBB,8->color gl
mov edi,header ; WINDOW LABEL
int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ddeeff ; color of text RRGGBB
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
 
call draw_slider_info
 
382,10 → 374,5
;**************************************************
 
; DATA AREA
labelt: db 'Color Slider'
labellen:
I_END:
 
 
 
 
header db 'Color Slider',0
I_END:
/programs/demos/free3d04/trunk/free3d04.asm
9,6 → 9,8
; Willow - greatly srinked code size by using GIF texture and FPU to calculate sine table
;
; !!!! Don't use GIF.INC in your apps - it's modified for FREE3D !!!!
;
; Heavyiron - new 0-function of drawing window from kolibri (do not work correctly with menuet)
 
TEX_SIZE equ 64*64*4
ceil = sinus+16*1024
29,8 → 31,8
dd 0x01 ; header version
dd START ; start of code
dd I_END ; size of image
dd APP_MEM;0x300000 ; memory for app
dd APP_MEM;0x300000 ; esp
dd APP_MEM;0x100000 ; memory for app
dd APP_MEM;0x100000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include 'macros.inc'
307,28 → 309,10
mov eax,0 ; function 0 : define and draw window
mov ebx,50*65536+649 ; [x start] *65536 + [x size]
mov ecx,50*65536+504 ; [y start] *65536 + [y size]
mov edx,0x02ffffff ; color of work area RRGGBB,8->color gl
mov esi,0x80777777 ; color of grab bar RRGGBB,8->color gl
mov edi,0x00777777 ; color of frames RRGGBB
mov edx,0x33ffffff ; color of work area RRGGBB,8->color gl
mov edi,header
int 0x40
 
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ddeeff ; color of text RRGGBB
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
 
; CLOSE BUTTON
mov eax,8 ; function 8 : define and draw button
mov ebx,(649-19)*65536+12 ; [x start] *65536 + [x size]
mov ecx,5*65536+12 ; [y start] *65536 + [y size]
mov edx,1 ; button id
mov esi,0x777777 ; button color RRGGBB
int 0x40
 
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
826,7 → 810,7
mov eax,7
mov ebx,0x80000
mov ecx,640*65536+480
mov edx,5*65536+20
xor edx,edx
int 0x40
 
ret
1007,10 → 991,8
vpy:
dd 0x0001FFFF
 
labelt:
db 'FISHEYE RAYCASTING ENGINE ETC. FREE3D'
header db 'FISHEYE RAYCASTING ENGINE ETC. FREE3D',0
 
labellen:
sindegree dd 0.0
sininc dd 0.0017453292519943295769236907684886
sindiv dd 6553.5
/programs/demos/movback/trunk/movback.asm
38,7 → 38,7
mov eax,7
mov ebx,virtual_screen_32
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
mov edx,(5 shl 16)+23
xor edx,edx
int 0x40
jmp .event_loop
 
50,22 → 50,16
xor eax,eax
mov ebx,(100 shl 16)+(WND_SIZE_X+9)
mov ecx,(100 shl 16)+(WND_SIZE_Y+28)
mov edx,0x03000000
mov edx,0x33000000
mov edi,header
int 0x40
 
mov eax,7
mov ebx,virtual_screen_32
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
mov edx,(5 shl 16)+23
xor edx,edx
int 0x40
 
mov eax,4
mov ebx,0x00060006
mov ecx,0x10ffffff
mov edx,window_title
mov esi,window_title_len
int 0x40
 
mov eax,12
mov ebx,2
int 0x40
166,9 → 160,7
delta_angle dd 0.0245436926066 ; pi/128
scale_sin dd 128.0
 
window_title:
db 'MoveBack'
window_title_len = $ - window_title
header db 'MoveBack',0
 
UDATA
ver_counter dd ?
/programs/demos/plasma/trunk/plasma.asm
31,7 → 31,7
mov al,7
mov ebx,virtual_screen_32
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
mov edx,(4 shl 16)+24
xor edx,edx
int 0x40
call rotate_pal
jmp .event_loop
45,23 → 45,17
 
xor eax,eax
mov ebx,(100 shl 16)+(WND_SIZE_X+8)
mov ecx,(100 shl 16)+(WND_SIZE_Y+28)
mov edx,0x03000000
mov ecx,(100 shl 16)+(WND_SIZE_Y+25)
mov edx,0x33000000
mov edi,header
int 0x40
 
mov al,7
mov ebx,virtual_screen_32
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
mov edx,(4 shl 16)+24
xor edx,edx
int 0x40
 
mov al,4
mov ebx,0x00060006
mov ecx,0x10ffffff
mov edx,window_title
mov esi,window_title_len
int 0x40
 
pop eax
and ebx,2 ; bit 1 is set
int 0x40
167,9 → 161,7
DATA
_multiplier dd 63.5
 
window_title:
db 'Plasma'
window_title_len = $ - window_title
header db 'Plasma',0
 
UDATA
_fpom32 rd 1
/programs/demos/timer/trunk/timer.asm
1,5 → 1,5
;
; TIMER
; TIMER (show how much system works)
;
; Compile with flat assembler
;
53,11 → 53,6
; *********************************************
 
draw_clock:
mov eax, 13 ; clear area
mov ebx, 10*65536+55
mov ecx, 30*65536+10
mov edx, [sc.work]
int 0x40
 
mov eax, 26 ; get system counter
mov ebx, 9
84,9 → 79,10
 
mov eax,47 ; HH
mov esi,[sc.work_text]
or esi,0x10000000
or esi,0x50000000
mov edi,[sc.work]
mov ebx,0x00020000
mov edx,10*65536+30
mov edx,15*65536+5
int 0x40
 
pop eax ; MM
122,32 → 118,14
int 0x40
 
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+75 ; [x start] *65536 + [x size]
mov ecx,100*65536+45 ; [y start] *65536 + [y size]
xor eax,eax ; function 0 : define and draw window
mov ebx,100*65536+100 ; [x start] *65536 + [x size]
mov ecx,100*65536+40 ; [y start] *65536 + [y size]
mov edx,[sc.work] ; color of work area RRGGBB,8->color gl
mov esi,[sc.grab] ; color of grab bar RRGGBB,8->color gl
or esi,0x80000000
mov edi,[sc.frame] ; color of frames RRGGBB
or edx,0x33000000
mov edi,header
int 0x40
 
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,6*65536+7 ; [x start] *65536 + [y start]
mov ecx,[sc.grab_text] ; font 1 & color ( 0xF0RRGGBB )
or ecx,0x10000000
mov edx,header ; pointer to text beginning
mov esi,header.len ; text length
int 0x40
 
; CLOSE BUTTON
mov eax,8 ; function 8 : define and draw button
mov ebx,(75-16)*65536+12 ; [x start] *65536 + [x size]
mov ecx,4*65536+12 ; [y start] *65536 + [y size]
mov edx,1 ; button id
mov esi,[sc.grab_button] ; button color RRGGBB
int 0x40
 
call draw_clock
 
mov eax,12 ; function 12:tell os about windowdraw
160,13 → 138,9
; DATA AREA
 
if lang eq ru
header:
db '’€‰Œ…'
.len = $ - header
header db '’€‰Œ…',0
else
header:
db 'TIMER'
.len = $ - header
header db 'TIMER',0
end if
 
 
/programs/demos/transp/trunk/transp.asm
24,7 → 24,9
mov [procinfo.x_size], 200
mov [procinfo.y_start], 80
mov [procinfo.y_size], 300
 
call draw_window
red:
call get_transparent
call draw_window ; at first, draw the window
 
still:
38,26 → 40,20
je key
cmp eax,3 ; button in buffer ?
je button
 
jmp still
 
red: ; redraw
call get_transparent
call draw_window
jmp still
 
key: ; key
mov eax,2 ; just read it and ignore
mov al,2 ; just read it and ignore
int 0x40
jmp still
 
button: ; button
mov eax,17 ; get id
mov al,17 ; get id
int 0x40
 
cmp ah,1 ; button id=1 ?
jne noclose
mov eax,-1 ; close this program
or eax,-1 ; close this program
int 0x40
noclose:
 
75,29 → 71,19
mov ebx,1 ; 1, start of draw
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
xor eax,eax ; function 0 : define and draw window
mov ebx,[procinfo.x_start]
shl ebx,16
add ebx,[procinfo.x_size]
dec ebx
mov ecx,[procinfo.y_start]
shl ecx,16
add ecx,[procinfo.y_size]
dec ecx
mov edx,0x03000000 ; color of work area RRGGBB,8->color gl
mov edx,0x33000000 ; color of work area RRGGBB,8->color gl
mov edi,header ; WINDOW LABEL
int 0x40
 
call draw_transparent
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x10ddeeff ; color of text RRGGBB
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
 
; call draw_transparent
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
116,7 → 102,7
mov ecx,[procinfo.x_size]
shl ecx,16
add ecx,[procinfo.y_size]
mov edx,4*65536+22
xor edx,edx
int 0x40
 
popa
131,10 → 117,6
mov ebx,I_END
mov ecx,-1
int 0x40
; mov eax,[I_END+34]
; mov [x_start],eax
; mov eax,[I_END+38]
; mov [y_start],eax
 
mov eax,14
int 0x40
168,8 → 150,6
mov eax,35
int 0x40
 
; shr eax,1
; and eax,0x7f7f7f
or eax, 0x4e4e4e
 
mov ebx,[esp+4]
213,9 → 193,7
 
scx dd 640
 
labelt:
db 'EXAMPLE APPLICATION'
labellen:
header db 'Transparent',0
 
I_END:
procinfo process_information
/programs/demos/trantest/trunk/trantest.asm
87,7 → 87,7
xor eax,eax ;Draw window
mov ebx,100*65536+(SCREEN_X+9) ;x start*65536+x size
mov ecx,100*65536+(SCREEN_Y+26) ;y start*65536+y size
mov edx,0x13000000 ;0x33 use skinned window
mov edx,0x13000000 ;0x13 use skinned window
mov edi,header
int 0x40
 
/programs/demos/tube/trunk/tube.asm
5,6 → 5,8
 
; Menuet port by VT
 
appname equ 'TUBE - FPU'
 
use32
org 0x0
 
13,7 → 15,7
dd START
dd I_END
dd 0x40000
dd 0x3ff00
dd 0x40000
dd 0,0
 
include 'macros.inc'
47,7 → 49,7
cmp eax,0
je still
 
mov eax,-1
or eax,-1
int 0x40
 
 
175,7 → 177,7
 
mov eax,7
mov ecx,320*65536+160
mov edx,10*65536+27
xor edx,edx
mov ebx,0x10000
int 0x40
 
192,21 → 194,13
mov ebx,1
int 0x40
 
mov eax,0
mov ebx,100*65536+339
mov ecx,100*65536+198
mov edx,0x03225588
mov esi,0x0
mov esi,0x0
xor eax,eax
mov ebx,100*65536+329
mov ecx,100*65536+186
mov edx,0x33000000
mov edi,header
int 0x40
 
mov eax,4
mov ebx,8*65536+8
mov ecx,0xffffff
mov edx,labeltext
mov esi,19
int 0x40
 
mov eax,12
mov ebx,2
int 0x40
214,7 → 208,7
popa
ret
 
labeltext db 'TUBE.ASM - with FPU'
header db appname,0
 
db 41,0,0xC3,0x3C