Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 9066 → Rev 9065

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