Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9065 → Rev 9066

/programs/fs/kfar/trunk/kfar.asm
814,8 → 814,6
 
align 16
mouse:
cmp dword[active_screen],0
jg event
mov eax,SF_MOUSE_GET
mov ebx,SSF_BUTTON_EXT
int 0x40
837,17 → 835,19
mov bx, font_height
div bx
movzx edx,ax
dec edx ;¢¥àå­ïï à ¬ª 
dec edx ;§ £®«®¢ª¨
shr eax,16
 
cmp edx, 0
jl .no_ch_pos
mov ebx, [cur_height]
sub ebx, 3
dec ebx
cmp edx, ebx
je .on_panel
sub ebx, 7-3
cmp dword[active_screen],0
jg event ;.on_edit
cmp edx, 2
jl .no_ch_pos
dec edx ;¢¥àå­ïï à ¬ª 
dec edx ;§ £®«®¢ª¨
sub ebx, 7-1
cmp edx, ebx
jge .no_ch_pos
 
912,13 → 912,57
align 4
.on_panel:
call get_keybar_ind
lea eax, [panels_mouse+4*eax]
lea eax, [mouse_panels+4*eax]
cmp [active_screen_keybar], keybar_viewer
jne @f
add eax, mouse_viewer-mouse_panels
@@:
cmp [active_screen_keybar], keybar_editor
jne @f
add eax, mouse_editor-mouse_panels
@@:
cmp dword[eax], 0
je event
 
mov ebx, [active_screen]
mov ebp, [screens]
mov ebp, [ebp+ebx*8+4]
 
cmp dword[active_screen],0
jne @f
mov ebp, [active_panel]
mov ecx, [ebp + PanelData.index]
call dword[eax]
@@:
push dword[eax]
sub eax, mouse_panels
shr eax, 2
xor edx, edx
mov ebx, 12
div ebx
lea eax, [edx+0x3B] ;eax - ª®¤ ª« ¢¨è¨ F1...F12
pop ebx
call ebx
jmp event
if 0 ;not work insert text
align 4
.on_edit:
cmp [active_screen_keybar], keybar_editor
jne event
cmp edx, 1
jl event
push edx
xor edx, edx
mov ebx, font_width
div ebx
pop edx
mov ebx, [active_screen]
mov ebp, [screens]
mov ebp, [ebp+ebx*8+4]
mov [ebp + editor_data.cursor_x], eax
mov [ebp + editor_data.cursor_y], edx
call editor_OnRedraw
jmp event
end if
 
;input:
; eax - coord x
983,22 → 1027,6
pop edi esi edx ecx ebx
ret
 
align 4
OnMouse_ctrl_f3_9:
sub eax, panels_mouse.ctrl+8
shr eax, 2
add eax, 0x3D
call panels_OnKey.ctrl_f3_9
ret
 
align 4
OnMouse_alt_f1_2:
sub eax, panels_mouse.alt
shr eax, 2
add eax, 0x3B
call panels_OnKey.alt_f1_2
ret
 
align 16
process_ctrl_keys:
cmp byte [esi], 0
5744,6 → 5772,7
mov [bSilentFolderMode], 0 ; leave silent mode
ret
 
align 4
highlight_init:
pushad
mov ebp, eax
5812,6 → 5841,7
popad
ret
 
align 4
compare_name:
test byte [esi], 10h
jnz .1dir
5853,6 → 5883,7
stc
ret
 
align 4
strcmpi:
push eax
@@:
5866,6 → 5897,7
pop eax
ret
 
align 4
compare_ext:
test byte [esi], 10h
jnz .1dir
5897,6 → 5929,7
stc
ret
 
align 4
compare_ext_rev:
test byte [esi], 10h
jnz .1dir
5928,6 → 5961,7
stc
ret
 
align 4
seek_ext:
push eax
xor eax, eax
5947,6 → 5981,7
pop eax
ret
 
align 4
compare_modified:
test byte [esi], 10h
jnz .1dir
5979,6 → 6014,7
stc
ret
 
align 4
compare_modified_rev:
test byte [esi], 10h
jnz .1dir
6012,6 → 6048,7
stc
ret
 
align 4
compare_size:
test byte [esi], 10h
jnz .1dir
6044,6 → 6081,7
stc
ret
 
align 4
compare_size_rev:
test byte [esi], 10h
jnz .1dir
6077,6 → 6115,7
stc
ret
 
align 4
compare_unordered:
cmp esi, edi
ret
6084,6 → 6123,7
cmp edi, esi
ret
 
align 4
compare_created:
test byte [esi], 10h
jnz .1dir
6116,6 → 6156,7
stc
ret
 
align 4
compare_created_rev:
test byte [esi], 10h
jnz .1dir
6149,6 → 6190,7
stc
ret
 
align 4
compare_accessed:
test byte [esi], 10h
jnz .1dir
6181,6 → 6223,7
stc
ret
 
align 4
compare_accessed_rev:
test byte [esi], 10h
jnz .1dir
6214,6 → 6257,7
stc
ret
 
align 4
ReadFolder_default:
mov eax, 2
ret 10h
7555,8 → 7599,9
db 'dfghjkl;',27h,'`',0,'\zxcv'
db 'bnm,./',0,0,0,' ',0,0,0,0,0,0
 
;â ¡«¨æë ä㭪権: mouse_panels, mouse_viewer ¨ mouse_editor ¤®«¦­ë ¡ëâì à冷¬ ¤àã£ á ¤à㣮¬
align 4
panels_mouse:
mouse_panels:
dd 0 ;f1
dd 0 ;f2
dd panels_OnKey.f3
7565,7 → 7610,9
dd 0 ;f6
dd panels_OnKey.f7
dd panels_OnKey.f8
dd 0,0,0 ;f9-f11
dd 0
dd exit ;f10
dd 0
dd F12
; Shift
rd 4
7574,14 → 7621,14
.ctrl:
rd 2
repeat 9-3+1
dd OnMouse_ctrl_f3_9
dd panels_OnKey.ctrl_f3_9
end repeat
rd 3
; Ctrl+Shift
rd 12
.alt:
dd OnMouse_alt_f1_2
dd OnMouse_alt_f1_2
dd panels_OnKey.alt_f1_2
dd panels_OnKey.alt_f1_2
rd 4
dd panels_OnKey.alt_f7
rd 5
7592,6 → 7639,61
; Alt+Ctrl+Shift
rd 12
 
mouse_viewer:
rd 1
dd viewer_OnKey.f2
dd viewer_OnKey.exit ;f3
dd viewer_OnKey.f4
rd 2
dd viewer_OnKey.f7
dd viewer_OnKey.f8
rd 1
dd viewer_OnKey.exit ;f10
rd 1
dd F12
; Shift
rd 6
dd viewer_OnKey.shift_f7
rd 5
; Ctrl
rd 12
; Ctrl+Shift
rd 12
; Alt
rd 12
; Alt+Shift
rd 12
; Alt+Ctrl
rd 12
; Alt+Ctrl+Shift
rd 12
 
mouse_editor:
rd 1
dd editor_OnKey.f2
rd 4
dd editor_OnKey.f7
rd 2
dd editor_OnKey.exit_confirm ;f10
rd 1
dd F12
; Shift
rd 6
dd editor_OnKey.shift_f7
rd 5
; Ctrl
rd 12
; Ctrl+Shift
rd 12
; Alt
rd 12
; Alt+Shift
rd 12
; Alt+Ctrl
rd 12
; Alt+Ctrl+Shift
rd 12
 
; Š« ¢¨è­ë¥ á®ç¥â ­¨ï
; db scancode, reserved
; dw ctrlstate
/programs/testing/pcidev/trunk/PCIDEV.ASM
26,18 → 26,19
dd IM_END ; size of image
dd I_END ; memory for app
dd stacktop ; esp
dd 0 ; I_Param
dd file_name ; I_Param
dd path ; APPLICATION PATH
;-----------------------------------------------------------------------------
include 'lang.inc' ;language support
include '../../../KOSfuncs.inc'
include '../../../macros.inc'
include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../load_lib.mac'
;-----------------------------------------------------------------------------
@use_library ; load_lib macro
;-----------------------------------------------------------------------------
START:
mcall 68,11
mcall 66,1,1
mcall SF_SYS_MISC,SSF_HEAP_INIT
mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1
;-----------------------------------------------------------------------------
load_libraries l_libs_start,end_l_libs
;-----------------------------------------------------------------------------
49,12 → 50,13
mov esi,start_temp_file_name
call copy_file_name_path
;-----------------------------------------------------------------------------
mcall 68,12,4096*4 ; 16 Kb - I hope this will be enough for store of data
mcall SF_SYS_MISC,SSF_MEM_ALLOC,4096*4 ; 16 Kb - I hope this will be enough for store of data
mov [store_text_area_start],eax
;-----------------------------------------------------------------------------
call draw_window
align 4
still:
mcall 10 ; wait here for event
mcall SF_WAIT_EVENT
dec eax ; redraw request ?
jz red
dec eax ; key in buffer ?
63,6 → 65,7
jz button
jmp still
;-----------------------------------------------------------------------------
align 4
red: ; redraw
call get_window_param
mov eax, [Proc_Info.box.left]; store the window coordinates into the Form Structure
76,8 → 79,9
call draw_window ; go redraw window now
jmp still
;-----------------------------------------------------------------------------
align 4
key: ; key
mcall 2 ; just read it and ignore
mcall SF_GET_KEY
cmp [extended_key],1
je .extended_key
test al, al
100,14 → 104,15
je call_OpenDialog
jmp still
;-----------------------------------------------------------------------------
align 4
button: ; button
mcall 17 ; get id
mcall SF_GET_BUTTON
cmp ah,2
je call_OpenDialog
cmp ah, 1 ; button id = 1 ?
jne still
.exit:
mcall -1 ; close this program
mcall SF_TERMINATE_PROCESS
;-----------------------------------------------------------------------------
call_OpenDialog:
mov [OpenDialog_data.type],1 ; Save
168,17 → 173,18
ret
;-----------------------------------------------------------------------------
get_window_param:
mcall 9, Proc_Info, -1 ; window redraw requested so get
mcall SF_THREAD_INFO, Proc_Info, -1 ; window redraw requested so get
; new window coordinates and size
ret
;-----------------------------------------------------------------------------
align 4
draw_window:
call prepare_text_area
 
mov byte [total], 0
mcall 12, 1 ; start of draw
mcall SF_REDRAW, SSF_BEGIN_DRAW
; DRAW WINDOW
mcall 0,dword [Form],dword [Form + 4],0x13ffffff,0x805080d0,title
mcall SF_CREATE_WINDOW,dword [Form],dword [Form + 4],0x13ffffff,0x805080d0,title
 
call get_window_param
 
186,11 → 192,11
test eax,100b
jne .end
 
mcall 8,<450,100>,<25,25>,2,0xC0C0C0
mcall SF_DEFINE_BUTTON,<450,100>,<25,25>,2,0xC0C0C0
shr ecx,16
mov bx,cx
add ebx,13 shl 16+4
mcall 4,,0x80000000,text_save_button
mcall SF_DRAW_TEXT,,0x80000000,text_save_button
add bx,11
mcall ,,,text_save_button.1
; Insert horizontal bars in list area
243,7 → 249,7
jne @b
; Quantity of devices...
movzx ecx, byte [total] ; number to draw
mcall 47, 0x00020000,,150 * 65536 + 65, 0x224466
mcall SF_DRAW_NUMBER, 0x00020000,,150 * 65536 + 65, 0x224466
 
mov ebx,ecx
mov ecx,2
264,7 → 270,7
call Try_MMIO
@@:
.end:
mcall 12, 2 ; end of draw
mcall SF_REDRAW, SSF_END_DRAW
ret
;-----------------------------------------------------------------------------
store_data:
274,14 → 280,14
sub ebx,eax
inc ebx
mov [fileinfo.size],ebx
mcall 70,fileinfo
mcall SF_FILE,fileinfo
ret
;-----------------------------------------------------------------------------
;* Gets the PCI Version and Last Bus
Get_PCI_Info:
mcall 62, 0
mcall SF_PCI, 0
mov word [PCI_Version], ax
mcall 62, 1
mcall SF_PCI, 1
mov byte [PCI_LastBus], al
;----------------------------------------------------------
;* Get all devices on PCI Bus
298,7 → 304,7
mov bh, byte [V_Bus] ; bus of pci device
mov ch, byte [V_Dev] ; device number/function
mov cl, 0 ; offset to device/vendor id
mcall 62 ; get ID's
mcall SF_PCI ; get ID's
 
cmp ax, 0 ; Vendor ID should not be 0 or 0xFFFF
je nextDev ; check next device if nothing exists here
313,19 → 319,19
mov bh, byte [V_Bus] ; Bus #
mov ch, byte [V_Dev] ; Device # on bus
mov cl, 0x08 ; Register to read (Get Revision)
mcall 62 ; Read it
mcall SF_PCI ; Read it
 
mov byte [PCI_Rev], al ; Save it
mov cl, 0x0b ; Register to read (Get class)
mcall 62 ; Read it
mcall SF_PCI ; Read it
 
mov byte [PCI_Class], al ; Save it
mov cl, 0x0a ; Register to read (Get Subclass)
mcall 62 ; Read it
mcall SF_PCI ; Read it
mov byte [PCI_SubClass], al; Save it
; by Mario79 august 2006
mov cl, 0x09 ; Register to read (Get Interface)
mcall 62 ; Read it
mcall SF_PCI ; Read it
 
mov [PCI_Interface], al ; Save it
;
332,12 → 338,12
; by Ghost april 2007
mov cl, 0x3c ; Register to read (Get IRQ)
@@:
mcall 62 ; Read it
mcall SF_PCI ; Read it
 
mov [PCI_IRQ], al ; Save it
; by CleverMouse juny 2011
mov cl, 0x0e
mcall 62
mcall SF_PCI
 
push eax
inc byte [total] ; one more device found
375,7 → 381,7
jz no_ummio_here
mov ch, byte [V_Bus]
mov cl, byte [V_Dev]
mcall 62, 11 ; detect uMMIO
mcall SF_PCI, 11 ; detect uMMIO
 
and ax,0x7fff
inc ax ; -1 returned?
406,7 → 412,7
 
no_ummio_here:
movzx ecx,word [PCI_Vendor] ; Pointer to number to be written
mcall 47, 0x00040100 ; Write Vendor ID
mcall SF_DRAW_NUMBER, 0x00040100 ; Write Vendor ID
 
call store_4_digits
 
507,7 → 513,7
 
.find:
mov edx, [edx - 4]
mcall 4,, 0x80000000 ; lets print the vendor Name
mcall SF_DRAW_TEXT,, 0x80000000 ; lets print the vendor Name
 
mov [store_text_size],42
call store_text
547,7 → 553,7
@@:
and ebx, 0x0000FFFF ; clear X position
or ebx, 0x24E0000 ; set X position to 590 pixels
mcall 4,, 0x80000000,, 32 ; draw the text
mcall SF_DRAW_TEXT,, 0x80000000,, 32 ; draw the text
 
mov [store_text_size],0
call store_text
568,7 → 574,7
mov bh, [MMIO_BAR]
or bx, 12 ; function 12
mov ecx, 4096 ; =1 page to map
mcall 62
mcall SF_PCI
 
mov [MMIO_Map], eax ; store MMIO lin.addr.
mov ecx, 0x80990022 ; print color : red
579,7 → 585,7
mov [bar_um+3], bh
mov ebx, [gr_pos]
mov edx, bar_um
mcall 4
mcall SF_DRAW_TEXT
 
jmp mmio_next_bar
@@:
588,7 → 594,7
mov [bar_io+3], bh
mov ebx, [gr_pos]
mov edx, bar_io
mcall 4
mcall SF_DRAW_TEXT
 
jmp mmio_next_bar
@@:
597,7 → 603,7
mov [bar_ram+3], bh
mov ebx, [gr_pos]
mov edx, bar_ram
mcall 4
mcall SF_DRAW_TEXT
 
jmp mmio_dump
;-----------------------------------------------------------------------------
604,7 → 610,7
@@:
mov ebx, [gr_pos]
mov edx, bar_rom
mcall 4
mcall SF_DRAW_TEXT
 
mmio_dump:
mov edx, [MMIO_Map]
612,10 → 618,10
mov ecx, 0x099 ; dump color : blue
add ebx, 10
mov [gr_pos], ebx
mcall 4
mcall SF_DRAW_TEXT
 
mov ecx, [MMIO_Map] ; release the tried page
mcall 62,13
mcall SF_PCI,13
 
mmio_next_bar:
mov bh, [MMIO_BAR]
670,7 → 676,7
store_NA:
pusha
mov ebx,edx
mcall 4,,0x80000000,text_NA
mcall SF_DRAW_TEXT,,0x80000000,text_NA
mov edi,[store_text_area_end]
mov ax,[edx]
mov [edi+1],ax
781,17 → 787,10
;---------------------------------------------------------------------
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
 
err_message_found_lib2 db 'proc_lib.obj - Not found!',0
 
err_message_import2 db 'proc_lib.obj - Wrong import!',0
 
head_f_i:
head_f_l db 'error',0
;---------------------------------------------------------------------
l_libs_start:
 
library02 l_libs system_dir_ProcLib+9, path, library_path, system_dir_ProcLib, \
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
library02 l_libs system_dir_ProcLib+9, library_path, system_dir_ProcLib, ProcLib_import
 
end_l_libs:
;---------------------------------------------------------------------