Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 485 → Rev 484

/programs/system/vrr/trunk/macros.inc
0,0 → 1,269
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
dw ? ; +52 - reserved
.client_left dd ? ; +54
.client_top dd ? ; +58
.client_width dd ? ; +62
.client_height dd ? ; +66
.wnd_state db ? ; +70
rb (1024-71)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
/programs/system/vrr/trunk/vrr.asm
12,7 → 12,7
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; title version
dd 0x01 ; header version
dd START ; start of code
dd I_END ; size of image
dd 0x5000 ; memory for app
19,11 → 19,11
dd 0x4ff0 ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
include '..\..\..\macros.inc'
include 'macros.inc'
START: ; start of execution
mov eax,14
mcall
int 40h
mov ebx,eax
shr ebx,16
mov [oldX],ebx
36,7 → 36,7
mov ebx,13
mov ecx,1
mov edx,drvinfo
mcall
int 40h
cmp eax,0FFFFFFFFh ; = -1 - error or not installed
jne vrr_00
call warning_info
54,7 → 54,7
still:
mov eax,10 ; check here for event
mcall
int 0x40
cmp eax,1 ; redraw request ?
je red
67,7 → 67,7
key: ; key
mov al,2 ; just read it
mcall
int 0x40
cmp ah,'1'
jne key_loc_00
call safekey
141,12 → 141,12
button: ; button
mov al,17 ; get id
mcall
int 0x40
cmp ah,1 ; button id=1 ?
jne noclose
mov eax,-1 ; close this program
mcall
int 0x40
noclose:
cmp ah,2 ;'+' screen width
jne button_loc_01
194,7 → 194,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
201,8 → 201,8
mov ebx,100*65536+400 ; [x start] *65536 + [x size]
mov ecx,100*65536+200 ; [y start] *65536 + [y size]
mov edx,0x130020C0;0x00000040 ; color of work area RRGGBB,8->color glide
mov edi,title
mcall
mov edi,header
int 0x40
; BUTTONS
mov eax,8
211,29 → 211,29
mov ecx,84*65536+48
mov dl,2
mov esi,0x5599cc ; button color RRGGBB
mcall ; Button '+'Width
int 40h ; Button '+'Width
add ebx,30*65536
mov dl,3
mcall ; Button '-'Width
int 40h ; Button '-'Width
mov ebx,22*65536+85
mov ecx,170*65536+15
inc dl ;dl=4
mcall ; Button 'Ok'
int 40h ; Button 'Ok'
add ebx,90*65536
inc dl ;dl=5
mcall ; Button 'Cancel'
int 40h ; Button 'Cancel'
add ebx,90*65536
inc dl ;dl=6
mcall ; Button 'Return'
int 40h ; Button 'Return'
add ebx,90*65536
inc dl ;dl=7
mcall ; Button 'Default'
int 40h ; Button 'Default'
call draw_face
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
ret
246,7 → 246,7
mov eax,21
mov ebx,13
mov ecx,4
mcall
int 40h
pop edx
pop ecx
pop eax
267,7 → 267,7
mov eax,21
mov ebx,13
mov ecx,3
mcall
int 40h
mcall 5,50
mcall 15,3
pop edx
284,7 → 284,7
mov eax,21
mov ebx,13
mov ecx,5
mcall
int 40h
pop edx
pop ecx
pop ebx
295,7 → 295,7
mov ebx,buffer
xor ecx,ecx
dec ecx
mcall
int 40h
mov [totp],eax
mov eax,[ebx+30]
mov [mypid],eax
310,7 → 310,7
mov al,21
mov bl,13
mov cl,2
mcall
int 40h
mov [initrr],ebx
mov [refrate],ebx
ror ecx,16
328,15 → 328,15
mov ebx,9*65536+303
mov ecx,59*65536+87
xor edx,edx
mcall
int 40h
mov ebx,10*65536+300
mov ecx,60*65536+24
mov edx,00FF00FFh
mcall
int 40h
mov ebx,10*65536+36
mov ecx,72*65536+72
mov edx,0000FFFFh
mcall
int 40h
mov eax,38
mov edx,00FFFFFFh
mov ebx,10*65536+310
347,7 → 347,7
dt_loc_hor_line:
push ecx
mov ecx,edi
mcall
int 40h
add edi,esi
pop ecx
loop dt_loc_hor_line
355,7 → 355,7
mov edi,60*65536+144
mov esi,66*65536+66
mov ecx,edi
mcall
int 40h
add ebx,36*65536+36
xor ecx,ecx
mov cl,5
362,7 → 362,7
dt_loc_vert_line:
push ecx
mov ecx,edi
mcall
int 40h
add ebx,esi
pop ecx
loop dt_loc_vert_line
371,16 → 371,16
mov ecx,000000FFh
mov edx,_m1280x1024
mov esi,9
mcall
int 40h
add edx,9
add ebx,66*65536
mcall
int 40h
add edx,9
add ebx,66*65536
mcall
int 40h
add edx,9
add ebx,66*65536
mcall
int 40h
xor eax,eax
mov ebx,eax
mov ecx,eax
395,7 → 395,7
dt_loc_00:
push ecx
mov ecx,edi
mcall
int 40h
inc edi
add dx,12
pop ecx
409,7 → 409,7
dt_loc_01:
push ecx
mov ecx,edi
mcall
int 40h
inc edi
add edx,66*65536
pop ecx
419,11 → 419,11
mov ecx,000000FFh
mov edx,_mk
mov esi,4
mcall
int 40h
shl ecx,16
add bx,12
add edx,4
mcall
int 40h
retn
;IN: ah=keycode
490,24 → 490,24
mov edi,ecx
shr edi,16
mov cx,di
mcall
int 40h
pop ecx
push ecx
mov edi,ecx
ror ecx,16
mov cx,di
mcall
int 40h
pop ecx
push ebx
mov edi,ebx
shr edi,16
mov bx,di
mcall
int 40h
pop ebx
mov edi,ebx
ror ebx,16
mov bx,di
mcall
int 40h
pop edi
pop edx
pop ecx
524,7 → 524,7
mov al,5
xor ebx,ebx
mov bx,300
mcall
int 40h
call get_pid
xor eax,eax
mov ebx,eax
532,7 → 532,7
mov al,18
mov ebx,3
mov cx,[mypno]
mcall
int 40h
pop ecx
pusha
call draw_window
541,10 → 541,10
mov al,5
xor ebx,ebx
mov bx,300
mcall
int 40h
xor eax,eax
mov al,11
mcall
int 40h
cmp eax,1
jne par_loc_00
pusha
555,7 → 555,7
mov ebx,eax
mov al,23
mov bx,700
mcall
int 40h
cmp eax,0
jnz par_loc_02
; mov [ftr_eax],eax
575,10 → 575,10
; mov ecx,[ftr_eax]
; mov edx,20*65536+180
; mov esi,00FFFFFFh
; mcall
; int 40h
; mov ecx,[ftr_ebx]
; add edx,54*65536
; mcall
; int 40h
retn
print_cur_vm:
587,9 → 587,9
mov ecx,0000FF00h
mov edx,curmode
mov esi,cmlen
mcall
int 40h
mov al,14
mcall
int 40h
mov esi,00FFFFFFh
mov edi,eax
shr eax,16
601,21 → 601,21
shl ebx,16
mov edx,104*65536+40
mov eax,47
mcall
int 40h
add edx,30*65536
mov cx,di
inc ecx
mcall
int 40h
add edx,30*65536
mov ecx,[initrr]
sub ebx,1*65536
mcall
int 40h
mov al,4
mov ebx,200*65536+40
mov ecx,0000FF00h
mov edx,selmode
mov esi,cmlen
mcall
int 40h
mov ax,[vmselect]
cmp ax,0
jz pcv_loc_00
625,7 → 625,7
mov ebx,284*65536+54
mov ecx,40*65536+10
mov edx,000020C0h
mcall
int 40h
pop eax
push eax
xor ecx,ecx
640,7 → 640,7
mov esi,9
mov ebx,284*65536+40
mov ecx,00ff0000h
mcall
int 40h
pop eax
cmp ah,0
jz pcv_loc_00
653,7 → 653,7
mov ebx,344*65536+18
mov ecx,40*65536+10
mov edx,000020C0h
mcall
int 40h
pop eax
push eax
mov bx,ax
682,7 → 682,7
xor eax,eax
mov al,47
mov esi,00ff0000h
mcall
int 40h
pop eax
pop ecx
pop edx
747,7 → 747,7
mov edx,noherz
xor esi,esi
mov si,3
mcall
int 40h
pop esi
pop edx
pop ecx
771,7 → 771,7
mov esi,00FFFFFFh
xor eax,eax
mov al,47
mcall
int 40h
pop esi
pop edx
pop ecx
863,13 → 863,13
mov ebx,182*65536+36
mov ecx,26*65536+5
mov edx,000020C0h
mcall
int 40h
mov ebx,173*65536+54
mov ecx,153*65536+7
mcall
int 40h
mov ebx,337*65536+36
mov ecx,62*65536+10
mcall
int 40h
mov al,4
shr ecx,16
mov bx,cx
877,41 → 877,41
mov ecx,00FF0000h
mov edx,width
mov esi,5
mcall
int 40h
xor ecx,ecx
add edx,5
xor esi,esi
inc esi
mov ebx,335*65536+104
mcall
int 40h
add ebx,36*65536
inc edx
mcall
int 40h
mov edx,tmode
mov ecx,00FF0000h
mov ebx,182*65536+24
mov esi,6
mcall
int 40h
mov edx,actions
mov ebx,173*65536+152
mov esi,9
mcall
int 40h
xor ecx,ecx
mov edx,button1
mov ebx,59*65536+174
mov esi,2
mcall
int 40h
add edx,esi
mov esi,6
add ebx,78*65536
mcall
int 40h
add edx,esi
add ebx,90*65536
mcall
int 40h
add edx,esi
mov esi,7
add ebx,87*65536
mcall
int 40h
call rect_select
; call debug_ftr
call print_cur_vm
926,7 → 926,7
warning_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WARNING WINDOW
xor eax,eax ; function 0 : define and draw window
mov ebx,[oldX]
941,8 → 941,8
shl ecx,16
mov cx,200
mov edx,0x13808080 ; color of work area RRGGBB,8->color glide
mov edi,title
mcall
mov edi,header
int 0x40
 
; WARNING TEXT
mov eax,4 ; function 4 : write text to window
951,31 → 951,31
mov ecx,0xf0ff0000 ; color of text RRGGBB
mov edx,warn00 ; pointer to text beginning
mov esi,len_warn00 ; text length
; mcall
; int 0x40
; inc ebx
mcall
int 40h
add ebx,1*65536
mcall
int 40h
mov ebx,(200-(len_warn01/2)*6)*65536+100
mov edx,warn01
mov esi,len_warn01
mcall
int 40h
mov edx,button1
add ecx,0ffffh
mov ebx,(200-6)*65536+(160-4)
mov esi,2
mcall
int 40h
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
retn
warning_loop:
mov eax,5
mov ebx,13
mcall
int 0x40
mov eax,11
mcall
int 40h
cmp eax,1 ; redraw request ?
je warning_red
cmp eax,2 ; key in buffer ?
995,9 → 995,9
shl ecx,16
mov edx,warn01
mov esi,len_warn01
mcall
int 40h
sub ebx,1*65536
mcall
int 40h
jmp warning_loop
warning_red: ; redraw
call warning_window
1004,21 → 1004,21
jmp warning_loop
warning_key: ; key
mov eax,2 ; read key
mcall
int 0x40
cmp ah,01h
jne warning_loop
xor eax,eax
dec eax ; Terminate application
mcall
int 40h
jmp warning_loop
warning_button: ; button
mov eax,17 ; get id
mcall
int 0x40
cmp ah,1 ; button id=1 ?
jne warning_loop
xor eax,eax
dec eax ; close this program
mcall
int 0x40
jmp warning_loop
retn
1045,7 → 1045,7
;_m3 dw 0,0,0,0,0
;_m4 dw 0,0,0,0,0
title db 'Vertical Refresh Rate v2.0 (C) 2003 TRANS',0
header db 'Vertical Refresh Rate v2.0 (C) 2003 TRANS',0
_m1280x1024 db '1280x1024'
_m1024x768 db '1024x768 '
/programs/system/vrr/trunk/Warning.txt
0,0 → 1,7
 
Warning!
~~~~~~~~~~~~
 
This version requared of MeOS with supports driver model. Also for coorect work your system requared
video driver VMODE.MDR
 
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/system/vrr/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm vrr.asm vrr
@erase lang.inc
@pause
/programs/system/vrr/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm vrr.asm vrr
@erase lang.inc
@pause
/programs/system/vrr/trunk/infoform.txt
0,0 → 1,25
Vertical Refresh Rate v.2.0
Information Card.
 
 
Monitor (Screen size, Vendor, trademark):
 
VideoCard (Vendor, trademark, Memory Size):
 
 
Mode 1280x1024 (Enable/Disable):
Enable refresh rate:
Notes:
 
Mode 1024x768 (Enable/Disable):
Enable refresh rate:
Notes:
 
Mode 800x600 (Enable/Disable):
Enable refresh rate:
Notes:
 
Mode 640x480 (Enable/Disable):
Enable refresh rate:
Notes:
 
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property