diff --git a/kernel/trunk/core/syscall.inc b/kernel/trunk/core/syscall.inc index ef05eddfb9..12ddc73e48 100644 --- a/kernel/trunk/core/syscall.inc +++ b/kernel/trunk/core/syscall.inc @@ -133,7 +133,7 @@ iglobal dd sys_pci ; 62-PCI functions dd sys_msg_board ; 63-System message board dd sys_resize_app_memory ; 64-Resize application memory usage - dd undefined_syscall ; 65-UTF + dd syscall_putimage_palette; 65-PutImagePalette dd sys_process_def ; 66-Process definitions - keyboard dd sys_window_move ; 67-Window move or resize dd new_services ; 68-Some internal services diff --git a/kernel/trunk/docs/apm/apm.txt b/kernel/trunk/docs/apm.txt similarity index 100% rename from kernel/trunk/docs/apm/apm.txt rename to kernel/trunk/docs/apm.txt diff --git a/kernel/trunk/docs/apm/README.TXT b/kernel/trunk/docs/apm/README.TXT deleted file mode 100644 index 9f77c0ae89..0000000000 --- a/kernel/trunk/docs/apm/README.TXT +++ /dev/null @@ -1,273 +0,0 @@ -Advanced Power Management - -SYSTEM CALL - -eax = 49 -dx = эюьхЁ ЇєэъЎшш APM BIOS (рэрыюушўхэ ax т Ёхры№эюь Ёхцшьх) -юёЄры№э√х (bx, cx) ЁхушёЄЁ√ яю ёяхЎшЇшърЎшш (ёь. apm.txt) -Ёхчєы№ЄрЄ : яю ёяхЎшЇшърЎшш (тъы■ўр  CF), ёЄрЁ°р  ўрёЄ№ 32 сшЄэ√ї ЁхушёЄЁют эх юяЁхфхыхэр - - -MEMORY MAP - -Boot: - 0x9040 - dword - entry point of APM BIOS - 0x9044 - word - version (BCD) - 0x9046 - word - flags - - -╚╟╠┼═┼═╚▀ - -bootcode.inc -syscall.inc -kernel.asm -bootcode.inc -shutdown.inc - -##############[boot\bootcode.inc]################## - -╥Ёш эют√ї фхёъЁшяЄюЁр - -............. -............. - -; GDT TABLE - -gdts: - - dw gdte-$-1 - dd gdts - dw 0 - -int_code_l: -os_code_l: - - dw 0xffff - dw 0x0000 - db 0x00 - dw 11011111b *256 +10011010b - db 0x00 - -int_data_l: -os_data_l: - - dw 0xffff - dw 0x0000 - db 0x00 - dw 11011111b *256 +10010010b - db 0x00 -; --------------- APM --------------------- -apm_code_32: - dw 0x0f ; limit 64kb - db 0, 0, 0 - dw 11010000b *256 +10011010b - db 0x00 -apm_code_16: - dw 0x0f - db 0, 0, 0 - dw 10010000b *256 +10011010b - db 0x00 -apm_data_16: - dw 0x0f - db 0, 0, 0 - dw 10010000b *256 +10010010b - db 0x00 -; ----------------------------------------- -app_code_l: - dw ((0x80000000-std_application_base_address) shr 12) and 0xffff - dw 0 - db 0 - dw 11010000b*256+11111010b+256*((0x80000000-std_application_base_address) shr 28) - db std_application_base_address shr 24 - -app_data_l: - dw (0x80000000-std_application_base_address) shr 12 and 0xffff - dw 0 - db 0 - dw 11010000b*256+11110010b+256*((0x80000000-std_application_base_address) shr 28) - db std_application_base_address shr 24 - -graph_data_l: - - dw 0x3ff - dw 0x0000 - db 0x00 - dw 11010000b *256 +11110010b - db 0x00 - -tss0_l: - -............. -............. - -##############[core\syscall.inc]################### - -............. -............. - - - dd display_number ; 47-WriteNum - dd display_settings ; 48-SetRedrawType and SetButtonType - dd sys_apm ; 49-Advanced Power Management (APM) - dd random_shaped_window ; 50-Window shape & scale - dd syscall_threads ; 51-Threads - - -............. -............. - -##############[kernel.asm]######################### - - -╫рёЄ№ 1 (яюёых ьхЄъш "; SAVE REAL MODE VARIABLES"): - -............. -............. - -; SAVE REAL MODE VARIABLES - -; --------------- APM --------------------- - mov eax, [0x2f0000 + 0x9040] ; entry point - mov dword[apm_entry], eax - mov word [apm_entry + 4], apm_code_32 - gdts - - mov eax, [0x2f0000 + 0x9044] ; version & flags - mov [apm_vf], eax -; ----------------------------------------- - -............. -............. - -╫рёЄ№ 2 (ёшёЄхьэ√щ т√чют, Ёрёяюыюцхэшх эх ъЁшЄшўэю, -  Ёрёяюыюцшы яхЁхф ьхЄъющ "undefined_syscall:") - -............. -............. - -; --------------- APM --------------------- -apm_entry dp 0 -apm_vf dd 0 -align 4 -sys_apm: - cmp word [apm_vf], 0 ; Check APM BIOS enable - jne @f - or [esp + 56], byte 1 ; error - mov [esp + 36], dword 8 ; 32-bit protected-mode interface not supported - ret - -@@: xchg eax, ecx - xchg ebx, ecx - - cmp al, 3 - ja @f - and [esp + 56], byte 0xfe ; emulate func 0..3 as func 0 - mov eax, [apm_vf] - mov [esp + 36], eax - shr eax, 16 - mov [esp + 32], eax - ret - -@@: call pword [apm_entry] ; call APM BIOS - mov [esp + 8 ], edi - mov [esp + 12], esi - mov [esp + 24], ebx - mov [esp + 28], edx - mov [esp + 32], ecx - mov [esp + 36], eax - setc al - and [esp + 56], byte 0xfe - or [esp + 56], al - ret -; ----------------------------------------- - -align 4 - -undefined_syscall: ; Undefined system call - -............. -............. - -##############[boot\bootcode.inc]################## - -╧хЁхф ьхЄъющ "; DISPLAY VESA INFORMATION" - -............. -............. - -; --------------- APM --------------------- - push 0 - pop es - mov word [es : 0x9044], 0 ; ver = 0.0 (APM not found) - mov ax, 0x5300 - xor bx, bx - int 0x15 - jc apm_end ; APM not found - test cx, 2 - jz apm_end ; APM 32-bit protected-mode interface not supported - mov [es : 0x9044], ax ; Save APM Version - mov [es : 0x9046], cx ; Save APM flags - - ; Write APM ver ---- - jmp @f -msg_apm:db ' APM x.x ', 0 -@@: and ax, 0xf0f - add ax, '00' - mov si, msg_apm - 0x10000 - mov [si + 5], ah - mov [si + 7], al - _setcursor 0, 3 - call printplain - _setcursor d80x25_top_num,0 - ; ------------------ - - mov ax, 0x5304 ; Disconnect interface - xor bx, bx - int 0x15 - mov ax, 0x5303 ; Connect 32 bit mode interface - xor bx, bx - int 0x15 - ; init selectors - movzx eax, ax ; real-mode segment base address of protected-mode 32-bit code segment - shl eax, 4 - mov [apm_code_32 - 0x10000 + 2], ax - shr eax, 16 - mov [apm_code_32 - 0x10000 + 4], al - movzx ecx, cx ; real-mode segment base address of protected-mode 16-bit code segment - shl ecx, 4 - mov [apm_code_16 - 0x10000 + 2], cx - shr ecx, 16 - mov [apm_code_16 - 0x10000 + 4], cl - movzx edx, dx ; real-mode segment base address of protected-mode 16-bit data segment - shl edx, 4 - mov [apm_data_16 - 0x10000 + 2], dx - shr edx, 16 - mov [apm_data_16 - 0x10000 + 4], dl - mov [es : 0x9040], ebx ; offset of APM entry point -apm_end: -; ----------------------------------------- - - -; DISPLAY VESA INFORMATION - -............. -............. - -##############[boot\shutdown.inc]################## - -╨х°хэшх яЁюсыхь√ APM poweroff - -............. -............. - -APM_PowerOff: - mov ax, 5304h - xor bx, bx - int 15h -;!!!!!!!!!!!!!!!!!!!!!!!! -mov ax,0x5300 -xor bx,bx -int 0x15 -push ax - -............. -............. diff --git a/kernel/trunk/docs/sysfuncr.txt b/kernel/trunk/docs/sysfuncr.txt index fc70177d5b..0d22dbd934 100644 --- a/kernel/trunk/docs/sysfuncr.txt +++ b/kernel/trunk/docs/sysfuncr.txt @@ -3461,6 +3461,26 @@ IPC Вызов функции будет игнорироваться, если приложение создаст локальную кучу вызовом 68.11. +====================================================================== +========= Функция 65 - вывести изображение с палитрой в окно. ======== +====================================================================== +Параметры: + * eax = 65 - номер функции + * ebx = указатель на изображение + * ecx = [размер по оси x]*65536 + [размер по оси y] + * edx = [координата по оси x]*65536 + [координата по оси y] + * esi = число бит на пиксель, должно быть 8 в текущей реализации + * edi = указатель на палитру (256 цветов 0x00RRGGBB) +Возвращаемое значение: + * функция не возвращает значения +Замечания: + * Координаты изображения - это координаты верхнего левого угла + изображения относительно окна. + * Размер изображения в байтах есть xsize*ysize. + * Каждый байт изображения рассматривается как индекс в палитре. + * Если изображение использует не все 256 цветов, а меньше, + размер палитры может быть меньше 256. + ====================================================================== ================= Функция 66 - работа с клавиатурой. ================= ====================================================================== diff --git a/kernel/trunk/docs/sysfuncs.txt b/kernel/trunk/docs/sysfuncs.txt index dd14cdfe36..38d8a6b21d 100644 --- a/kernel/trunk/docs/sysfuncs.txt +++ b/kernel/trunk/docs/sysfuncs.txt @@ -3428,6 +3428,26 @@ Remarks: The function call will be ignored after creation of process heap with function 68.11. +====================================================================== +======== Function 65 - draw image with palette in the window. ======== +====================================================================== +Parameters: + * eax = 65 - function number + * ebx = pointer to the image + * ecx = [size on axis x]*65536 + [size on axis y] + * edx = [coordinate on axis x]*65536 + [coordinate on axis y] + * esi = number of bits per pixel, must be 8 + * edi = pointer to palette (256 colors 0x00RRGGBB) +Returned value: + * function does not return value +Remarks: + * Coordinates of the image are coordinates of the upper left corner + of the image relative to the window. + * Size of the image in bytes is xsize*ysize. + * Each byte of image is index in the palette. + * If the image uses less than 256 colors, palette size may be + less than 256 too. + ====================================================================== ================== Function 66 - work with keyboard. ================= ====================================================================== diff --git a/kernel/trunk/drivers/proc32.inc b/kernel/trunk/drivers/proc32.inc index 23c56b03c1..98a1bd3342 100644 --- a/kernel/trunk/drivers/proc32.inc +++ b/kernel/trunk/drivers/proc32.inc @@ -71,7 +71,7 @@ macro epiloguedef procname,flag,parmbytes,localbytes,reglist if parmbytes | localbytes leave end if - if flag and 10000b + if (flag and 10000b) | (parmbytes=0) retn else retn parmbytes diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 1bd3df02f9..55bf26bc9a 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -1365,7 +1365,9 @@ sys_setup: mov word [midisp],bx ret +iglobal midi_base dw 0 +endg nsyse1: @@ -1501,7 +1503,9 @@ cd_base db 0 nosethd: ret +iglobal hd_base db 0 +endg nsyse7: @@ -1667,12 +1671,13 @@ sys_getsetup: mov [esp+36],dword 1 ret - +iglobal align 4 mousefn dd msscreen, mswin, msbutton, msset dd app_load_cursor dd app_set_cursor dd app_delete_cursor +endg readmousepos: @@ -3972,6 +3977,11 @@ sys_putimage: add dx,word[edi+0x80000+APPDATA.wnd_clientbox.left] rol edx,16 .forced: + push esi ebp + mov ebp, putimage_get24bpp + mov esi, putimage_init24bpp +sys_putimage_bpp: +; call [disable_mouse] ; this will be done in xxx_putimage ; mov eax, vga_putimage cmp [0xfe0c], word 0x12 jz @f ;.doit @@ -3986,12 +3996,55 @@ sys_putimage: inc [mouse_pause] call eax dec [mouse_pause] + pop ebp esi jmp [draw_pointer] +syscall_putimage_palette: + lea edi, [esi+std_application_base_address] + mov esi, edx + mov edx, ecx + mov ecx, ebx + lea ebx, [eax+std_application_base_address] +sys_putimage_palette: +; ebx = pointer to image +; ecx = [xsize]*65536 + [ysize] +; edx = [xstart]*65536 + [ystart] +; esi = number of bits per pixel, must be 8 +; edi = pointer to palette + mov eax, [0x3000] + shl eax, 8 + add dx, word [eax+0x80000+APPDATA.wnd_clientbox.top] + rol edx, 16 + add dx, word [eax+0x80000+APPDATA.wnd_clientbox.left] + rol edx, 16 +.forced: + push esi ebp + mov ebp, putimage_get8bpp + mov esi, putimage_init8bpp + jmp sys_putimage_bpp + +putimage_init24bpp: + lea eax, [eax*3] +putimage_init8bpp: + ret + +putimage_get24bpp: + mov eax, [esi] + add esi, 3 + ret 4 +putimage_get8bpp: + movzx eax, byte [esi] + push edx + mov edx, [esp+8] + mov eax, [edx+eax*4] + pop edx + inc esi + ret 4 + ; eax x beginning ; ebx y beginning ; ecx x end -; edx y end + ; edx y end ; edi color __sys_drawbar: @@ -4003,6 +4056,7 @@ __sys_drawbar: add edx,[esi+0x80000+APPDATA.wnd_clientbox.top] .forced: inc [mouse_pause] +; call [disable_mouse] cmp [0xfe0c],word 0x12 je dbv20 sdbv20: diff --git a/kernel/trunk/video/vesa12.inc b/kernel/trunk/video/vesa12.inc index fd8aeef34a..fb04d2b90a 100644 --- a/kernel/trunk/video/vesa12.inc +++ b/kernel/trunk/video/vesa12.inc @@ -709,6 +709,12 @@ Vesa12_getpixel32: vesa12_putimage: +; ebx = pointer to image +; ecx = size [x|y] +; edx = coordinates [x|y] +; ebp = pointer to 'get' function +; esi = pointer to 'init' function +; edi = parameter for 'get' function ; mov ebx,image ; mov ecx,320*65536+240 @@ -730,8 +736,7 @@ vesa12_putimage: add ebx,[ecx-twdw+WDATA.box.top] push eax mov eax,ebx ; y - mov ebx,[0xfe08] - mul ebx + mul dword [0xfe08] pop ecx add eax,ecx ; x add eax,ecx @@ -747,29 +752,18 @@ vesa12_putimage: ; x size - movzx eax,word [esp+6] - mov ecx,eax - add ecx,eax - add ecx,eax - cmp [0xfbf1],byte 24 ; 24 or 32 bpp ? - x size - jz pi24312 - add ecx,eax - - pi24312: + movzx ecx,word [esp+6] mov esi,[esp+8] movzx ebx,word [esp+4] ; check limits while draw ? - push eax push ecx mov eax,[0x3010] - mov ecx,[eax+draw_data-0x3000+RECT.left] - cmp ecx,0 + cmp dword [eax+draw_data-0x3000+RECT.left], 0 jnz dbcblimitlset212 - mov ecx,[eax+draw_data-0x3000+RECT.top] - cmp ecx,0 + cmp dword [eax+draw_data-0x3000+RECT.top], 0 jnz dbcblimitlset212 mov ecx,[eax+draw_data-0x3000+RECT.right] cmp ecx,[0xfe00] @@ -778,84 +772,67 @@ vesa12_putimage: cmp ecx,[0xfe04] jnz dbcblimitlset212 pop ecx - pop eax - push dword 0 + push 0 jmp dbcblimitlno212 dbcblimitlset212: pop ecx - pop eax - push dword 1 + push 1 dbcblimitlno212: cmp [0xfbf1],byte 24 ; 24 or 32 bpp ? - jz pi24bit12 - jmp pi32bit12 + jnz pi32bit12 pi24bit12: - cld - push eax - push ebx - push edx - xor edx,edx - mov eax,ecx - mov ebx,3 - div ebx - mov ecx,eax - pop edx - pop ebx - pop eax - newpi12: push edi - push esi push ecx push ebx - xor edx,edx - mov eax,edi - sub eax,[0xfe80] + mov edx,edi + sub edx,[0xfe80] mov ebx,3 div ebx - add eax,WinMapAddress + add edx,WinMapAddress mov ebx,[0x3000] - mov bh,[esp+4*4] + mov bh,[esp+4*3] np2412: - cmp bl,[eax] + cmp bl,[edx] jnz imp24no12 - mov edx,[esi] - cmp bh,0 - jz imp24yes12 +; mov eax,[esi] + push dword [esp+4*3+20] + call ebp +; cmp bh,0 +; jz imp24yes12 ; call dbcplimit ; jnz imp24no12 imp24yes12: - push eax push edi + push eax mov eax,edi sub eax,[0xfe80] shr eax,16 call set_bank + pop eax and edi,0xffff add edi,0xa0000 - mov [edi],edx - shr edx,2 - mov [edi+2],dl - sti + mov [edi],ax + shr eax,16 + mov [edi+2],al pop edi - pop eax imp24no12: - inc eax - add esi,3 + inc edx +; add esi,3 add edi,3 dec ecx jnz np2412 @@ -864,73 +841,63 @@ vesa12_putimage: pop ebx pop ecx - pop esi pop edi add edi,[0xfe08] - xor eax,eax - mov ax,[esp+4+2+4] - lea eax,[eax+eax*2] - add esi,eax dec ebx - jz nonewpi12 - jmp newpi12 + jnz newpi12 nonewpi12: - add esp,7*4 - mov eax,0 - ret + pop eax edx ecx ebx eax edi esi + xor eax, eax + ret pi32bit12: - cld - shr ecx,2 - newpi3212: push edi - push esi push ecx push ebx - mov eax,edi - sub eax,[0xfe80] - shr eax,2 - add eax,WinMapAddress + mov edx,edi + sub edx,[0xfe80] + shr edx,2 + add edx,WinMapAddress mov ebx,[0x3000] - mov bh,[esp+4*4] + mov bh,[esp+4*3] np3212: - cmp bl,[eax] + cmp bl,[edx] jnz imp32no12 - mov edx,[esi] - cmp bh,0 - jz imp32yes12 +; mov eax,[esi] + push dword [esp+4*3+20] + call ebp +; cmp bh,0 +; jz imp32yes12 ; call dbcplimit ; jnz imp32no12 imp32yes12: - push eax push edi + push eax mov eax,edi sub eax,[0xfe80] shr eax,16 call set_bank - and edi,0xffff - add edi,0xa0000 - mov [edi],edx - sti - pop edi pop eax + and edi,0xffff + mov [edi+0xa0000],eax + pop edi imp32no12: - inc eax - add esi,3 + inc edx +; add esi,3 add edi,4 dec ecx jnz np3212 @@ -939,22 +906,17 @@ vesa12_putimage: pop ebx pop ecx - pop esi pop edi add edi,[0xfe08] - movzx eax,word [esp+4+2+4] - lea eax,[eax+eax*2] - add esi,eax dec ebx - jz nonewpi3212 - jmp newpi3212 + jnz newpi3212 nonewpi3212: - add esp,7*4 - mov eax,0 - ret + pop eax edx ecx ebx eax edi esi + xor eax, eax + ret vesa12_read_screen_pixel: diff --git a/kernel/trunk/video/vesa20.inc b/kernel/trunk/video/vesa20.inc index 145dc50886..b673c6ff2f 100644 --- a/kernel/trunk/video/vesa20.inc +++ b/kernel/trunk/video/vesa20.inc @@ -76,29 +76,27 @@ virtual at esp .abs_cx dd ? .abs_cy dd ? .line_increment dd ? - .source_bpp dd ? .winmap_newline dd ? .screen_newline dd ? - .stack_data = 4*13 + .stack_data = 4*12 + .edi dd ? + .esi dd ? + .ebp dd ? end virtual -align 4 +align 16 ; ebx = pointer ; ecx = size [x|y] ; edx = coordinates [x|y] +; ebp = pointer to 'get' function +; esi = pointer to 'init' function +; edi = parameter for 'get' function vesa20_putimage: pushad call [disable_mouse] sub esp, putimg.stack_data - mov [putimg.source_bpp], 3 -; test ebx, 0x80000000 -; jz @f -; inc [putimg.source_bpp] -; @@: -; and ebx, 0x7FFFFFFF - ; save pointer to image mov [putimg.pti], ebx @@ -164,7 +162,8 @@ vesa20_putimage: mov eax, [putimg.image_sx] sub eax, [putimg.real_sx] ;; imul eax, [putimg.source_bpp] - lea eax, [eax + eax * 2] +; lea eax, [eax + eax * 2] + call esi mov [putimg.line_increment], eax ; winmap new line increment @@ -183,7 +182,7 @@ vesa20_putimage: mov [putimg.screen_newline], eax ; pointer to image - mov ecx, [putimg.pti] + mov esi, [putimg.pti] ; pointer to screen mov edx, [putimg.abs_cy] @@ -213,29 +212,32 @@ vesa20_putimage: mov edi, [putimg.real_sy] align 4 .new_line: - mov esi, [putimg.real_sx] + mov ecx, [putimg.real_sx] ; push ebp edx align 4 .new_x: + push [putimg.edi] + mov eax, [putimg.ebp+4] + call eax cmp [ebp], bl jne .skip - mov eax, [ecx] ; ecx = RRBBGGRR +; mov eax, [esi] ; eax = RRBBGGRR mov [edx], ax shr eax, 16 mov [edx+2], al .skip: - add ecx, 3 ;[putimg.source_bpp] +; add esi, 3 ;[putimg.source_bpp] add edx, 3 inc ebp - dec esi + dec ecx jnz .new_x ; pop edx ebp - add ecx, [putimg.line_increment] + add esi, [putimg.line_increment] add edx, [putimg.screen_newline] ;[BytesPerScanLine] add ebp, [putimg.winmap_newline] ;[ScreenWidth] ;inc ebp @@ -251,27 +253,30 @@ put_image_end_32: mov edi, [putimg.real_sy] align 4 .new_line: - mov esi, [putimg.real_sx] + mov ecx, [putimg.real_sx] ; push ebp edx align 4 .new_x: + push [putimg.edi] + mov eax, [putimg.ebp+4] + call eax cmp [ebp], bl jne .skip - mov eax, [ecx] ; ecx = RRBBGGRR +; mov eax, [esi] ; ecx = RRBBGGRR mov [edx], eax .skip: - add ecx, [putimg.source_bpp] +; add esi, [putimg.source_bpp] add edx, 4 inc ebp - dec esi + dec ecx jnz .new_x ; pop edx ebp - add ecx, [putimg.line_increment] + add esi, [putimg.line_increment] add edx, [putimg.screen_newline] ;[BytesPerScanLine] add ebp, [putimg.winmap_newline] ;[ScreenWidth] ;inc ebp diff --git a/programs/fs/kfar/trunk/dialogs.inc b/programs/fs/kfar/trunk/dialogs.inc index d331ac7c85..d6e115f709 100644 --- a/programs/fs/kfar/trunk/dialogs.inc +++ b/programs/fs/kfar/trunk/dialogs.inc @@ -215,7 +215,7 @@ GenericBox: mov eax, esi pop esi sub eax, esi - inc eax ; eax = фышэр чруюыютър + 2 + inc eax ; eax = длина заголовка + 2 mov ecx, [ebx+dlgtemplate.width] cmp eax, ecx jbe .fullhea @@ -236,9 +236,9 @@ GenericBox: mov ah, [ebx+dlgtemplate.header_color] mov al, ' ' stosw - dec ecx .2: - jecxz .3 + dec ecx + jz .3 lodsb test al, al jz .4 @@ -404,6 +404,8 @@ GenericBox: call draw_keybar mov eax, ebp call mf_free + or [cursor_x], -1 + or [cursor_y], -1 call draw_image popad ret 8 @@ -955,11 +957,18 @@ virtual at 0 dlgitemtemplate: ; Элементы: ; 1 = статический текст +; 2 = кнопка +; 3 = поле редактирования .type dd ? .x1 dd ? .y1 dd ? .x2 dd ? .y2 dd ? +; Данные: +; для текста: const char* data - ASCIIZ-строка +; для кнопки: const char* data - заголовок +; для редактора: struct {unsigned maxlength; unsigned pos; unsigned start; +; char data[maxlength+1];}* data; .data dd ? .flags dd ? ; Флаги: @@ -967,6 +976,9 @@ dlgitemtemplate: ; 1 = выравнивание по центру ; 2 = выравнивание вправо ; 4 = элемент имеет фокус ввода +; 8 = элемент может иметь фокус ввода +; 10h: для кнопки = кнопка по умолчанию (Enter на не-кнопке) +; для поля ввода = данные были модифицированы .size = $ end virtual ; struct DLGDATA @@ -1017,12 +1029,16 @@ ManagerDlgProc: jz .tab cmp al, 0x48 jz .up + cmp al, 0x50 + jz .down + jecxz @f + cmp [ebx+dlgitemtemplate.type], 3 + jz .key_edit +@@: cmp al, 0x4B jz .left cmp al, 0x4D jz .right - cmp al, 0x50 - jz .down .ret0: xor eax, eax ret 16 @@ -1030,8 +1046,22 @@ ManagerDlgProc: or eax, -1 ret 16 .enter: + cmp [ebx+dlgitemtemplate.type], 2 + jnz @f +.enter_found: mov eax, ebx ret 16 +@@: + mov ebx, [esp+4] + add ebx, dlgtemplate.size+12 +.enter_find: + cmp [ebx+dlgitemtemplate.type], 2 + jnz @f + test [ebx+dlgitemtemplate.flags], 0x10 + jnz .enter_found +@@: + add ebx, dlgitemtemplate.size + jmp .enter_find .tab: test [ctrlstate], 3 jnz .shift_tab @@ -1043,19 +1073,20 @@ ManagerDlgProc: jz .find_first_btn @@: add ebx, dlgitemtemplate.size - cmp [ebx+dlgitemtemplate.type], 2 - jz .btn_found + test [ebx+dlgitemtemplate.flags], 8 + jnz .btn_found loop @b .find_first_btn: mov ebx, [esp+4] add ebx, dlgtemplate.size+12 @@: - cmp [ebx+dlgitemtemplate.type], 2 - jz .btn_found + test [ebx+dlgitemtemplate.flags], 8 + jnz .btn_found add ebx, dlgitemtemplate.size jmp @b .btn_found: or byte [ebx+dlgitemtemplate.flags], 4 +.ret_draw: mov ebx, [esp+4] call .dodraw call draw_image @@ -1072,20 +1103,135 @@ ManagerDlgProc: jz .find_last_btn @@: sub ebx, dlgitemtemplate.size - cmp [ebx+dlgitemtemplate.type], 2 - loopnz @b - jz .btn_found + test [ebx+dlgitemtemplate.flags], 8 + loopz @b + jnz .btn_found .find_last_btn: mov ebx, [eax+dlgtemplate.size+8] imul ebx, dlgitemtemplate.size lea ebx, [ebx+eax+dlgtemplate.size+12] @@: sub ebx, dlgitemtemplate.size - cmp [ebx+dlgitemtemplate.type], 2 - jnz @b + test [ebx+dlgitemtemplate.flags], 8 + jz @b jmp .btn_found +.key_edit: +; обработка клавиш в поле ввода + test al, 0x80 + jnz .ret0 + or [ebx+dlgitemtemplate.flags], 0x10 + mov edx, [ebx+dlgitemtemplate.data] + cmp al, 0x4B + jz .editor_left + cmp al, 0x4D + jz .editor_right + cmp al, 0x47 + jz .editor_home + cmp al, 0x4F + jz .editor_end + cmp al, 0x0E + jz .editor_backspace + cmp al, 0x53 + jz .editor_del + test [ctrlstate], 0x3C + jnz .ret_draw +; query keyboard layout + pushad + push 26 + pop eax + push 2 + pop ebx + xor ecx, ecx + cmp [ctrlstate], 1 + sbb ecx, -2 + mov edx, layout + int 0x40 + popad +; translate scancode to ASCII + movzx eax, al + movzx eax, byte [layout+eax] + push eax +; insert entered symbol + xor eax, eax + lea edi, [edx+12] + or ecx, -1 + repnz scasb + not ecx + pop eax + cmp ecx, [edx] + ja .ret_test ; buffer capacity exceeded + lea edi, [edx+ecx+12-1] + mov esi, [edx+4] + lea esi, [edx+esi+12] +@@: + mov cl, [edi] + mov [edi+1], cl + dec edi + cmp edi, esi + jae @b + mov [esi], al + inc dword [edx+4] +@@: jmp .ret_test +.editor_left: + mov ecx, [edx+4] + jecxz @f + dec dword [edx+4] +@@: jmp .ret_test +.editor_right: + mov ecx, [edx+4] + cmp byte [edx+ecx+12], 0 + jz @b + inc dword [edx+4] + jmp @b +.editor_home: + and dword [edx+4], 0 + jmp @b +.editor_end: + lea edi, [edx+12] + xor eax, eax + or ecx, -1 + repnz scasb + not ecx + dec ecx + mov [edx+4], ecx +.ret_test: + mov eax, [edx+4] + cmp [edx+8], eax + jl .ret_test.l1 + mov [edx+8], eax + jmp .ret_test.l2 +.ret_test.l1: + add eax, [ebx+dlgitemtemplate.x1] + sub eax, [ebx+dlgitemtemplate.x2] + cmp [edx+8], eax + jge .ret_test.l2 + mov [edx+8], eax +.ret_test.l2: + jmp .ret_draw +.editor_backspace: + mov ecx, [edx+4] + jecxz .ret_test + dec dword [edx+4] + lea esi, [edx+ecx+12] + lea edi, [esi-1] +.copy_and_ret_test: +@@: + lodsb + stosb + test al, al + jnz @b + jmp .ret_test +.editor_del: + mov ecx, [edx+4] + lea edi, [ecx+edx+12] + lea esi, [edi+1] + cmp byte [edi], 0 + jz .ret_test + jmp .copy_and_ret_test .dodraw: + or [cursor_x], -1 + or [cursor_y], -1 add ebx, dlgtemplate.size+8 mov ecx, [ebx] add ebx, 4 @@ -1096,7 +1242,12 @@ ManagerDlgProc: dec eax jz .draw_text dec eax + jz .draw_button + dec eax jnz .draw_loop_continue + call draw_editbox + jmp .draw_loop_continue +.draw_button: call draw_button jmp .draw_loop_continue .draw_text: @@ -1114,6 +1265,7 @@ draw_static_text: draw_text: ; определяем длину строки mov esi, [ebx+dlgitemtemplate.data] +draw_text_esi: test esi, esi jz .ret or ecx, -1 @@ -1163,6 +1315,11 @@ draw_text: pop ecx cmp ecx, edx jbe .text_copy + cmp [ebx+dlgitemtemplate.type], 3 + jnz @f + mov ecx, edx + jmp .text_copy +@@: cmp edx, 3 jb .ret mov al, '.' @@ -1203,3 +1360,27 @@ draw_button: mov ah, [dialog_selected_btn_color] @@: jmp draw_text + +draw_editbox: + mov edx, [ebx+dlgitemtemplate.data] + test [ebx+dlgitemtemplate.flags], 4 + jz @f + mov eax, [ebx+dlgitemtemplate.x1] + add eax, [edx+4] + sub eax, [edx+8] + mov ecx, [esp+16] + add eax, [ecx+dlgtemplate.x] + mov [cursor_x], eax + mov eax, [ebx+dlgitemtemplate.y1] + add eax, [ecx+dlgtemplate.y] + mov [cursor_y], eax +@@: + mov ah, [dialog_edit_color] + test [ebx+dlgitemtemplate.flags], 10h + jnz @f + mov ah, [dialog_unmodified_edit_color] +@@: + mov esi, [ebx+dlgitemtemplate.data] + add esi, [edx+8] + add esi, 12 + jmp draw_text_esi diff --git a/programs/fs/kfar/trunk/kfar.asm b/programs/fs/kfar/trunk/kfar.asm index b42bcc7f0f..878bf23720 100644 --- a/programs/fs/kfar/trunk/kfar.asm +++ b/programs/fs/kfar/trunk/kfar.asm @@ -18,6 +18,7 @@ include 'viewer.inc' start: mov eax, mem call mf_init + call init_console call draw_window push 66 pop eax @@ -25,7 +26,6 @@ start: pop ebx mov ecx, ebx int 40h ; set keyboard mode to scancodes - call init_console mov esi, def_left_dir mov edi, panel1_dir @@: @@ -41,11 +41,20 @@ start: stosb test al, al jnz @b - mov eax, 304 + mov eax, 200 mov [panel1_nfa], eax mov [panel2_nfa], eax - mov [panel1_files], buf1 - mov [panel2_files], buf2 + mov eax, 200*4 + 32 + 200*304 + push eax + call mf_alloc + mov [panel1_files], eax + pop eax + call mf_alloc + mov [panel2_files], eax + test eax, eax + jz exit + cmp [panel1_files], eax + jz exit mov [panel1_sortmode], 0 ; sort by name mov [panel2_sortmode], 0 mov [num_screens], 1 @@ -76,6 +85,17 @@ exit: or eax, -1 int 40h redraw: +; query kbd state from OS + mov al, 66 + push 3 + pop ebx + int 0x40 + and eax, 0x3F + cmp al, [ctrlstate] + mov [ctrlstate], al + jz @f + call draw_keybar +@@: mov al, 9 mov ebx, procinfo or ecx, -1 @@ -101,7 +121,7 @@ redraw: @@: xor ecx, ecx mov eax, [ebx+42] - sub eax, 5*2 + sub eax, 5*2-1 jae @f xor eax, eax @@: @@ -124,10 +144,9 @@ redraw: or cl, ch test edx, edx setnz ch - or cl, ch mov eax, [ebx+46] sub eax, [skinh] - sub eax, 5 + sub eax, 5-1 jns @f xor eax, eax @@: @@ -146,29 +165,31 @@ redraw: @@: cmp eax, [cur_height] mov [cur_height], eax - setnz ch - or cl, ch + jnz .resize + test cl, cl + jnz .resize test edx, edx - setnz ch - test cx, cx + setnz cl + or cl, ch jz @f - mov eax, [MemForImage] - call mf_free - and [MemForImage], 0 - call init_console + test byte [ebx+70], 1 + jnz @f +.resize: push 67 pop eax or ebx, -1 or ecx, -1 mov edx, [cur_width] imul edx, font_width - add edx, 5*2 + add edx, 5*2-1 mov esi, [cur_height] imul esi, font_height add esi, [skinh] - add esi, 5 + add esi, 5-1 int 40h - call draw_window +.resize_draw: + call init_console +; call draw_window call draw_keybar mov ebp, [active_screen_data] mov eax, [active_screen_vtable] @@ -177,6 +198,56 @@ redraw: @@: call draw_window jmp event +alt_f9: + cmp [saved_width], -1 + jz @f + mov eax, [saved_width] + mov [cur_width], eax + or [saved_width], -1 + mov eax, [saved_height] + mov [cur_height], eax + or [saved_height], -1 + jmp redraw.resize +@@: + push 48 + pop eax + push 5 + pop ebx + int 0x40 + push eax + sub eax, [esp+2] + inc eax + movzx eax, ax + sub eax, 10 + xor edx, edx + mov ecx, font_width + div ecx + xchg [cur_width], eax + mov [saved_width], eax + mov eax, ebx + shr ebx, 16 + sub eax, ebx + sub eax, 5-1 + sub eax, [skinh] + xor edx, edx + mov ecx, font_height + div ecx + xchg [cur_height], eax + mov [saved_height], eax + mov ecx, ebx + pop ebx + shr ebx, 16 + mov edx, [cur_width] + imul edx, font_width + add edx, 5*2-1 + mov esi, [cur_height] + imul esi, font_height + add esi, [skinh] + add esi, 4 + push 67 + pop eax + int 0x40 + jmp redraw.resize_draw key: mov al, 2 int 40h @@ -581,43 +652,19 @@ panels_OnKey: call get_curfile_folder_entry test byte [ecx], 10h jnz .enter_folder -; find extension - lea esi, [ecx+40] - push esi -@@: - lodsb - test al, al - jnz @b -@@: - dec esi - cmp byte [esi], '.' - jz .found_ext - cmp esi, [esp] - ja @b - jmp .run_app -.found_ext: - inc esi - mov edi, associations -@@: - push esi edi - mov edi, [edi] - call strcmpi - pop edi esi - jz .run_association - add edi, 8 - cmp edi, associations_end - jb @b - jmp .run_app + call find_extension + jc .run_app + jnz .run_app .run_association: - mov [execparams], execdata mov eax, [edi+4] +.run_association2: + mov [execparams], execdata mov [execptr], eax jmp .dorun .run_app: mov [execptr], execdata and [execparams], 0 .dorun: - pop esi lea esi, [ebp + panel1_dir - panel1_data] mov edi, execdata ; TODO: add overflow check @@ -636,10 +683,52 @@ panels_OnKey: stosb test al, al jnz @b +; for fasm call - special handling, because +; 1) fasm command line convention is different : fasm infile,outfile[,path] rather than tinypad infile +; 2) fasm will probably create new file in directory, so we want to reload panel data + xor edx, edx + cmp [execparams], edx + jz .nofasm + cmp [execptr], fasm + jnz .nofasm +; TODO: add buffer/cmdline overflow check + mov esi, execdata +@@: + lodsb + stosb + test al, al + jnz @b + mov byte [esi-1], ',' + inc edx +; output file: no extension if input file has extension, '.bin' otherwise + push edi +@@: + dec edi + cmp byte [edi], '.' + jz .ptfound + cmp byte [edi], '/' + jnz @b + pop edi + mov dword [edi-1], '.bin' + mov byte [edi+3], 0 + jmp .nofasm +.ptfound: + mov byte [edi], 0 + pop edi +.nofasm: push 70 pop eax mov ebx, execinfo int 40h + test edx, edx + jz @f + push 5 + pop eax + push 20 + pop ebx + int 0x40 + jmp .ctrl_r +@@: ret .enter_folder: lea esi, [ecx+40] @@ -880,6 +969,270 @@ panels_OnKey: jnz @b call read_folder jmp .done_redraw +.shift_f5: + call get_curfile_folder_entry + lea esi, [ecx+40] + mov edi, CopyDestEditBuf + mov eax, CopyDestEditBuf.length + stosd + scasd + xor eax, eax + stosd + mov edx, edi +@@: + lodsb + test al, al + jz .f5_common + stosb + jmp @b +.f5: + mov edi, CopyDestEditBuf + mov eax, CopyDestEditBuf.length + stosd + scasd + xor eax, eax + stosd + mov edx, edi + mov esi, ebp + xor esi, panel1_data xor panel2_data + add esi, panel1_dir - panel1_data +@@: + lodsb + test al, al + jz @f + stosb + jmp @b +@@: + mov al, '/' + stosb +.f5_common: + mov byte [edi], 0 + sub edi, edx + mov [edx-8], edi + mov edi, CopySourceTextBuf + mov esi, aCopy1 +@@: + lodsb + test al, al + jz @f + stosb + jmp @b +@@: + call get_curfile_folder_entry + lea esi, [ecx+40] + lea eax, [esi+1] +@@: + inc esi + cmp byte [esi-1], 0 + jnz @b + sub esi, eax + xchg eax, esi + dec esi + mov edx, [cur_width] + sub edx, 50 + sub eax, edx + jbe @f + add esi, eax + mov al, '.' + stosb + stosb + stosb +@@: + lodsb + test al, al + jz @f + stosb + jmp @b +@@: + mov esi, aCopy2 +@@: + lodsb + stosb + test al, al + jnz @b + mov ebx, copy_dlgdata + mov eax, [cur_width] + sub eax, 12 + mov [ebx + dlgtemplate.width], eax + dec eax + dec eax + mov [ebx - copy_dlgdata + copy_dlgdata.width2], eax + mov [ebx - copy_dlgdata + copy_dlgdata.width3], eax + shr eax, 1 + dec eax + dec eax + mov [ebx - copy_dlgdata + copy_dlgdata.copy_x2], eax + sub eax, aCopyLength-1 + mov [ebx - copy_dlgdata + copy_dlgdata.copy_x1], eax + add eax, aCopyLength+3 + mov [ebx - copy_dlgdata + copy_dlgdata.cnl_x1], eax + add eax, aCancelBLength - 1 + mov [ebx - copy_dlgdata + copy_dlgdata.cnl_x2], eax + mov al, [dialog_border_color] + mov [ebx + dlgtemplate.border_color], al + mov al, [dialog_header_color] + mov [ebx + dlgtemplate.header_color], al + mov al, [dialog_main_color] + mov [ebx + dlgtemplate.main_color], al + mov byte [ebx - copy_dlgdata + copy_dlgdata.flags0], 0xC + and byte [ebx - copy_dlgdata + copy_dlgdata.flags1], not 4 + and byte [ebx - copy_dlgdata + copy_dlgdata.flags2], not 4 + push ebx + call DialogBox + cmp eax, copy_dlgdata.copy_btn + jnz .ret2 +; Копируем + mov esi, CopyDestEditBuf+12 + mov edi, esi + xor eax, eax + or ecx, -1 + repnz scasb + dec edi + dec edi + cmp edi, esi + jb .ret2 + cmp byte [edi], '/' + jnz @f +; Наличие/отсутствие заканчивающего слэша важно только для копирования папок + cmp edi, esi + jz @f + mov byte [edi], 0 + dec edi +@@: +; Если путь не начинается со слэша, считаем его относительно текущей папки + cmp byte [esi], '/' + jz .copy_absolute_path + push esi + push edi + lea edi, [ebp + panel1_dir - panel1_data] + or ecx, -1 + xor eax, eax + repnz scasb + not ecx + pop edi + lea edx, [edi+2] + sub edx, esi + lea edi, [edi+ecx+1] + xchg ecx, edx + std + lea esi, [esi+ecx-1] + rep movsb + cld + pop edi + lea esi, [ebp + panel1_dir - panel1_data] + push edi + mov ecx, edx + rep movsb + mov byte [edi-1], '/' + pop esi +.copy_absolute_path: +; Получаем атрибуты назначения + mov cl, 0x10 + xor eax, eax + mov edi, esi +.countslashloop: + cmp byte [edi], '/' + jnz @f + inc eax +@@: + inc edi + cmp byte [edi], 0 + jnz .countslashloop + cmp eax, 2 + jbe @f + mov ebx, attrinfo + mov [attrinfo.attr], 0 + mov [ebx + attrinfo.name - attrinfo], esi + push 70 + pop eax + int 0x40 + mov cl, byte [attrinfo.attr] +@@: + test cl, 0x10 + jz .copyfile +; Нам подсунули каталог назначения, дописываем имя файла + mov al, '/' + stosb + push esi + call get_curfile_folder_entry + lea esi, [ecx+40] +@@: + lodsb + stosb + test al, al + jnz @b + pop esi +.copyfile: +; Имя исходного файла + push esi + lea esi, [ebp+panel1_dir-panel1_data] + mov edi, saved_file_name + push edi +@@: + lodsb + test al, al + jz @f + stosb + jmp @b +@@: + mov al, '/' + stosb + call get_curfile_folder_entry + lea esi, [ecx+40] +@@: + lodsb + stosb + test al, al + jnz @b + pop esi + pop edi +; Нельзя скопировать файл поверх самого себя! + push esi edi + call strcmpi + pop edi esi + jz .ret2 +; Собственно, копируем +; esi->source name, edi->destination name + mov [writeinfo.code], 2 + mov [writeinfo.name], edi + and dword [writeinfo.first], 0 + and dword [writeinfo.first+4], 0 + mov [writeinfo.data], copy_buffer + mov ebx, readinfo + and dword [ebx+readinfo.first-readinfo], 0 + and dword [ebx+readinfo.first+4-readinfo], 0 + mov [ebx+readinfo.size-readinfo], copy_buffer_size + mov [ebx+readinfo.data-readinfo], copy_buffer + mov [ebx+readinfo.name-readinfo], esi +.copyloop: + mov ebx, readinfo + push 70 + pop eax + int 0x40 + cmp ebx, -1 + jz .copydone + test ebx, ebx + jz .copydone + add dword [readinfo.first], ebx + adc dword [readinfo.first+4], 0 + mov [writeinfo.size], ebx + mov ebx, writeinfo + push 70 + pop eax + int 0x40 + mov ecx, [writeinfo.size] + add dword [writeinfo.first], ecx + adc dword [writeinfo.first+4], 0 + mov [writeinfo.code], 3 + cmp ecx, copy_buffer_size + jz .copyloop +.copydone: + push ebp + call .ctrl_r + pop ebp + xor ebp, panel1_data xor panel2_data + jmp .ctrl_r + .f3: call view_file .ret2: @@ -980,7 +1333,7 @@ panels_OnKey: mov eax, [ebp + panel1_index - panel1_data] push eax call get_curfile_name - mov esi, eax + mov esi, ecx mov edi, saved_file_name @@: lodsb @@ -1034,6 +1387,108 @@ panels_OnKey: mov [ebp + panel1_start - panel1_data], eax @@: jmp .done_redraw +.menu: +; display context menu +; ignore folders + call get_curfile_folder_entry + test byte [ecx], 10h + jz @f +.menuret: + ret +@@: + call find_extension + jc .menuret + jnz .menuret +; known extension + mov ebx, [edi+8] + test ebx, ebx + jz .menuret + mov ecx, esi +@@: + inc ecx + cmp byte [ecx-1], 0 + jnz @b + sub ecx, esi ; ecx = длина имени файла+1 = длина заголовка+1 + cmp ecx, 15 + jb @f + mov cl, 15 +@@: + xor edx, edx +.menucreateloop: + mov eax, [ebx] + test eax, eax + jz .menucreated +@@: + inc eax + cmp byte [eax-1], 0 + jnz @b + sub eax, [ebx] + cmp eax, ecx + ja @f + mov eax, ecx +@@: + add eax, 12 + call mf_alloc + test eax, eax + jz .menucreated + add eax, 4 + test edx, edx + jz @f + mov [edx], eax +@@: + mov [eax+4], edx + mov edx, eax + push esi + mov esi, [ebx+4] + mov [eax-4], esi + mov esi, [ebx] + lea edi, [eax+8] +@@: + lodsb + stosb + test al, al + jnz @b + sub esi, [ebx] + sub esi, ecx + jae .menunoadd + neg esi +@@: + mov byte [edi-1], ' ' + stosb + dec esi + jnz @b +.menunoadd: + pop esi + add ebx, 8 + jmp .menucreateloop +.menucreated: + test edx, edx + jz .menuret + and dword [edx], 0 +@@: + cmp dword [edx+4], 0 + jz @f + mov edx, [edx+4] + jmp @b +@@: + push 1 + push esi + push edx + call menu + cmp eax, -1 + jz .menuret + push dword [eax-4] +@@: + test edx, edx + jz @f + lea eax, [edx-4] + mov edx, [edx] + call mf_free + jmp @b +@@: + pop eax + call get_curfile_folder_entry + jmp .run_association2 panels_OnRedraw: call draw_cmdbar @@ -1044,14 +1499,23 @@ panels_OnRedraw: ret init_console: + mov eax, [console_data_ptr] + call mf_free + mov eax, [cur_width] + mul [cur_height] + mov ecx, eax + add eax, eax + add eax, eax + call mf_alloc + test eax, eax + jz exit + mov [console_data_ptr], eax + mov edi, eax mov ax, 0720h - mov ecx, [cur_width] - imul ecx, [cur_height] - mov edi, console_data rep stosw - and [panel1_left], 0 - and [panel1_top], 0 - and [panel2_top], 0 + mov [panel1_left], ecx + mov [panel1_top], ecx + mov [panel2_top], ecx mov eax, [cur_width] inc eax shr eax, 1 @@ -1192,10 +1656,10 @@ draw_window: mov [skinh], eax mov ebx, [cur_width] imul ebx, font_width - add ebx, 100*65536 + 5*2 + add ebx, 100*65536 + 5*2-1 mov ecx, [cur_height] imul ecx, font_height - lea ecx, [eax+ecx+5+100*65536] + lea ecx, [eax+ecx+5-1+100*65536] xor eax, eax mov edx, 0x13000000 mov edi, header @@ -1219,10 +1683,18 @@ draw_window: ; push 4 ; pop eax ; int 40h - xor ecx, ecx - call draw_image - push 12 - pop eax +; xor ecx, ecx +; call draw_image + and [min_x], 0 + and [min_y], 0 + mov eax, [cur_width] + dec eax + mov [max_x], eax + mov eax, [cur_height] + dec eax + mov [max_y], eax + call draw_image.force + mov al, 12 push 2 pop ebx int 40h @@ -1248,34 +1720,129 @@ draw_image.nomem: ret draw_image: - cmp [MemForImage], 0 - jnz .allocated +; determine draw rectangle + and [max_x], 0 + or [min_x], -1 + or [min_y], -1 + mov esi, [console_data_ptr] + xor eax, eax + xor edx, edx + mov ecx, [cur_width] + imul ecx, [cur_height] +.m1: + mov bx, [esi] + cmp bx, [esi+ecx*2] + jz .m2 + cmp eax, [min_x] + ja @f + mov [min_x], eax +@@: + cmp eax, [max_x] + jb @f + mov [max_x], eax +@@: + cmp edx, [min_y] + jae @f + mov [min_y], edx +@@: + mov [max_y], edx +.m2: + add esi, 2 + inc eax + cmp eax, [cur_width] + jb .m1 + xor eax, eax + inc edx + cmp edx, [cur_height] + jb .m1 + mov eax, [cursor_x] + cmp eax, -1 + jz .m3 + cmp eax, [min_x] + ja @f + mov [min_x], eax +@@: + cmp eax, [max_x] + jb @f + mov [max_x], eax +@@: + mov edx, [cursor_y] + cmp edx, [min_y] + ja @f + mov [min_y], edx +@@: + cmp edx, [max_y] + jb @f + mov [max_y], edx +@@: +.m3: + xchg eax, [old_cursor_x] + xchg edx, [old_cursor_y] + cmp eax, -1 + jz .m4 + cmp eax, [min_x] + ja @f + mov [min_x], eax +@@: + cmp eax, [max_x] + jb @f + mov [max_x], eax +@@: + cmp edx, [min_y] + ja @f + mov [min_y], edx +@@: + cmp edx, [max_y] + jb @f + mov [max_y], edx +@@: +.m4: + cmp [min_y], -1 + jz .nodraw +.force: ; allocate memory for image + mov ecx, [max_x] + sub ecx, [min_x] + inc ecx + mov [used_width], ecx + mov edx, [max_y] + sub edx, [min_y] + inc edx + mov [used_height], edx + imul ecx, edx + imul ecx, font_width*font_height + add ecx, [heapend] + push 64 + pop eax + push 1 + pop ebx + int 0x40 + test eax, eax + jnz draw_image.nomem + mov edi, [heapend] + mov esi, [console_data_ptr] + mov eax, [min_y] + imul eax, [cur_width] + add eax, [min_x] + lea esi, [esi+eax*2] + mov ecx, [used_height] +.lh: + push ecx esi + mov ecx, [used_width] +.lw: + push ecx + mov ebx, [esi] mov eax, [cur_width] imul eax, [cur_height] - imul eax, font_width*font_height*3 - call mf_alloc - test eax, eax - jz draw_image.nomem - mov [MemForImage], eax -.allocated: - mov edi, [MemForImage] - mov esi, console_data - mov ecx, [cur_height] -.lh: - push ecx - mov ecx, [cur_width] -.lw: - push ecx edi - xor eax, eax - mov al, [esi+1] - and al, 0xF - mov ebx, [console_colors + eax*4] ; цвет текста - mov al, [esi+1] - shr al, 4 - mov ebp, [console_colors + eax*4] ; цвет фона - lodsb - inc esi + mov [eax*2+esi], bx + movzx eax, bl + push edi + movzx ebx, bh + mov ebp, ebx + shr ebp, 4 + and ebx, 0xF + sub ebx, ebp + add esi, 2 if font_width > 8 lea edx, [eax+eax+font] else @@ -1283,23 +1850,22 @@ else end if mov ecx, font_height .sh: - push ecx edi + push ecx edx edi xor ecx, ecx + mov edx, [edx] .sw: - mov eax, ebx - bt [edx], ecx - jc @f - mov eax, ebp -@@: - stosw - shr eax, 16 - stosb - inc ecx + shr edx, 1 + sbb eax, eax + and eax, ebx + add eax, ebp + mov [edi], al + add ecx, 1 + add edi, 1 cmp ecx, font_width jb .sw - pop edi ecx - mov eax, [cur_width] - imul eax, font_width*3 + pop edi edx ecx + mov eax, [used_width] + imul eax, font_width add edi, eax if font_width > 8 add edx, 256*2 @@ -1307,24 +1873,76 @@ else add edx, 256 end if loop .sh - pop edi ecx - add edi, font_width*3 - loop .lw - mov eax, [cur_width] - imul eax, (font_height-1)*font_width*3 - add edi, eax + pop edi +.skip_symbol: pop ecx - loop .lh - push 7 + add edi, font_width + dec ecx + jnz .lw + mov eax, [used_width] + imul eax, (font_height-1)*font_width + add edi, eax + pop esi ecx + add esi, [cur_width] + add esi, [cur_width] + dec ecx + jnz .lh +; cursor + mov eax, [cursor_y] + inc eax + jz .nocursor + sub eax, [min_y] + mul [used_width] + imul eax, font_height*font_width + mov edx, [cursor_x] + sub edx, [min_x] + inc edx + imul edx, font_width + add eax, edx + add eax, [heapend] + mov edx, [used_width] + imul edx, font_width + neg edx + mov ecx, (font_height*15+50)/100 +.cursor_loop: + push ecx + mov ecx, font_width + add eax, edx + push eax +@@: +; add byte [eax-1], 0x10 + xor byte [eax-1], 7 + sub eax, 1 + loop @b pop eax - mov ebx, [MemForImage] - mov ecx, [cur_width] - imul ecx, font_width*10000h - mov cx, word [cur_height] + pop ecx + loop .cursor_loop +.nocursor: + mov ecx, [used_width] + imul ecx, font_width*65536 + mov cx, word [used_height] imul cx, font_height - mov edx, [skinh] - add edx, 5*10000h - int 40h + mov edx, [min_x] + imul edx, font_width + add edx, 5 + shl edx, 16 + mov dx, word [min_y] + imul dx, font_height + add edx, [skinh] + push 65 + pop eax + mov ebx, [heapend] + push 8 + pop esi + mov edi, console_colors + int 0x40 + push 64 + pop eax + push 1 + pop ebx + mov ecx, [heapend] + int 0x40 +.nodraw: ret get_console_ptr: @@ -1333,7 +1951,8 @@ get_console_ptr: push edx imul edx, [cur_width] add edx, eax - lea edi, [console_data + edx*2] + mov edi, [console_data_ptr] + lea edi, [edi + edx*2] pop edx ret @@ -1431,7 +2050,7 @@ draw_keybar: dec edi @@: push edi - mov eax, [cur_width] + xor eax, eax mov edx, [cur_height] call get_console_ptr mov ecx, edi @@ -1755,6 +2374,7 @@ draw_panel: jae .size_tera ; в гигабайтах mov al, 'G' + shl edx, 2 jmp .size_letter .size_tera: ; в терабайтах @@ -1884,47 +2504,14 @@ end if mov ecx, [ebp + panel1_nfa - panel1_data] lea esi, [esi + ecx*4 + 32 + 40] add esi, [ebp + panel1_files - panel1_data] -; подсветка -; call insert_last_dot - xor ecx, ecx -.highlight_test_loop: - mov ebx, [highlight_groups+ecx*4] - mov al, [ebx + highlight.IncludeAttributes] - mov ah, [esi - 40] - and ah, al - cmp ah, al - jnz .highlight_test_failed - push edi - lea edi, [ebx + highlight.Mask] - call match_mask - pop edi - jc .highlight_test_failed - mov ah, [ebx + highlight.NormalColor] + mov ah, [esi - 40 + 5] cmp ebp, [active_panel] jnz @f mov ecx, [column_index] cmp ecx, [ebp + panel1_index - panel1_data] jnz @f - mov ah, [ebx + highlight.CursorColor] + mov ah, [esi - 40 + 6] @@: - test ah, ah - jz .nohighlight - jmp .doname -.highlight_test_failed: - inc ecx - cmp ecx, [highlight_num_groups] - jb .highlight_test_loop -.nohighlight: - mov ah, [panel_normal_color] - cmp ebp, [active_panel] - jnz @f - mov ecx, [column_index] - cmp ecx, [ebp + panel1_index - panel1_data] - jnz @f - mov ah, [panel_cursor_color] -@@: -.doname: -; call delete_last_dot mov ecx, [column_width] push edi @@: @@ -2056,12 +2643,7 @@ read_folder: jz .readdone push eax mov eax, [ebp + panel1_files - panel1_data] - cmp eax, buf1 - jz @f - cmp eax, buf2 - jz @f call mf_free -@@: pop eax mov eax, [eax+8] add eax, 0xF @@ -2088,7 +2670,8 @@ read_folder: lea esi, [edi + eax*4 + 32] xor eax, eax mov ecx, [esi-32+4] - jecxz .loopdone + test ecx, ecx + jz .loopdone ; Игнорируем специальные входы, соответствующие папке '.' и метке тома .ptrinit: cmp word [esi+eax+40], '.' @@ -2096,9 +2679,61 @@ read_folder: test byte [esi+eax], 8 jnz .loopcont stosd +; подсветка +; call insert_last_dot + pushad + lea ebp, [esi+eax] + lea esi, [ebp+40] + mov edi, lower_file_name + mov edx, edi +@@: + lodsb + call tolower + stosb + test al, al + jnz @b + mov esi, edx + lea edx, [edi-1] + xor ecx, ecx +.highlight_test_loop: + mov ebx, [highlight_groups+ecx*4] + mov al, [ebx + highlight.IncludeAttributes] + mov ah, [ebp] + and ah, al + cmp ah, al + jnz .highlight_test_failed + lea edi, [ebx + highlight.Mask] + call match_mask_rev_lowercase + jc .highlight_test_failed + mov ah, [ebx + highlight.NormalColor] + test ah, ah + jnz @f + mov ah, [panel_normal_color] +@@: + mov [ebp+5], ah + mov ah, [ebx + highlight.CursorColor] + test ah, ah + jnz @f + mov ah, [panel_cursor_color] +@@: + mov [ebp+6], ah + jmp .doname +.highlight_test_failed: + inc ecx + cmp ecx, [highlight_num_groups] + jb .highlight_test_loop +.nohighlight: + mov ah, [panel_normal_color] + mov [ebp+5], ah + mov ah, [panel_cursor_color] + mov [ebp+6], ah +.doname: +; call delete_last_dot + popad .loopcont: add eax, 304 - loop .ptrinit + dec ecx + jnz .ptrinit .loopdone: sub edi, [ebp + panel1_files - panel1_data] shr edi, 2 @@ -2730,6 +3365,7 @@ compare_accessed_rev: stc ret +if 0 match_mask: ; in: esi->name, edi->mask ; out: CF clear <=> match @@ -2847,6 +3483,36 @@ match_single_mask: inc esi jmp .list .asterisk: + cmp byte [esi], 0 + jz .done_succ + cmp byte [esi], '?' + jnz @f + mov al, 0 + scasb + jz .done_fail + inc esi + jmp .asterisk +@@: + cmp byte [esi], '[' + jz .asterisk_common +; the mask is ...*... +.asterisk_normal: + mov al, [esi] +@@: + cmp byte [edi], 0 + jz .done_fail + call match_symbol + jz @f + inc edi + jmp @b +@@: + inc edi + inc esi + call match_single_mask + jnc .done_succ + dec esi + jmp .asterisk_normal +.asterisk_common: push edi @@: call match_single_mask @@ -2860,6 +3526,188 @@ match_single_mask: pop edi jmp .done_succ +match_mask_rev: +; in: esi->name, edx->end of name, edi->mask +; out: CF clear <=> match + pusha + xchg esi, edx + xchg esi, edi +.main_cycle: + mov ecx, esi +@@: + lodsb + test al, al + jz @f + cmp al, ',' + jz @f + cmp al, '|' + jnz @b +@@: + dec esi + mov [esi], byte 0 + call match_single_mask_rev2 + mov [esi], al + inc esi + jnc .found + cmp al, ',' + jz .main_cycle +.done_fail: + stc + popa + ret +.found: + test al, al + jz .done_succ + cmp al, '|' + jz .test_exclude + lodsb + jmp .found +.done_succ: + clc + popa + ret +.test_exclude: + mov ecx, esi +@@: + lodsb + test al, al + jz @f + cmp al, ',' + jnz @b +@@: + dec esi + mov byte [esi], 0 + call match_single_mask_rev2 + mov [esi], al + inc esi + jnc .done_fail + test al, al + jz .done_succ + jmp .test_exclude + +match_single_mask_rev2: + pusha + jmp match_single_mask_rev.mask_symbol +match_single_mask_rev: +; in: esi->mask, edi->end of name, edx->start of name +; out: CF clear <=> match + pusha + mov ecx, esi +@@: + lodsb + test al, al + jnz @b + dec esi +; esi->end of mask, ecx->start of mask +.mask_symbol: + dec esi + cmp esi, ecx + jb .mask_done + mov al, [esi] + cmp al, '*' + jz .asterisk + cmp al, '?' + jz .quest + cmp al, ']' + jz .list + dec edi + cmp edi, edx + jb .done_fail + call match_symbol + jz .mask_symbol +.done_fail: + stc + popa + ret +.mask_done: + cmp edi, edx + jnz .done_fail +.done_succ: + clc + popa + ret +.quest: + dec edi + cmp edi, edx + jb .done_fail + jmp .mask_symbol +.list: + dec edi + cmp edi, edx + jb .done_fail +.list_check: + dec esi + cmp esi, ecx + jbe .done_fail + mov al, [esi] + cmp al, '[' + jz .done_fail + cmp byte [esi-1], '-' + jz .range + call match_symbol + jnz .list_check +.listok: +@@: + dec esi + cmp esi, ecx + jb .done_fail + cmp byte [esi], '[' + jnz @b + jmp .mask_symbol +.range: + call match_symbol + jb @f + mov al, [esi-2] + call match_symbol + jbe .listok +@@: + dec esi + dec esi + jmp .list_check +.asterisk: + cmp esi, ecx + jz .done_succ + cmp byte [esi-1], '?' + jnz @f + cmp edi, edx + jz .done_fail + dec esi + jmp .asterisk +@@: + cmp byte [esi-1], ']' + jz .asterisk_common +; the mask is ...*... +.asterisk_normal: + mov al, [esi-1] +@@: + cmp edi, edx + jz .done_fail + call match_symbol + jz @f + dec edi + jmp @b +@@: + dec edi + dec esi + call match_single_mask_rev2 + jnc .done_succ + inc esi + jmp .asterisk_normal +.asterisk_common: + push edi +@@: + call match_single_mask_rev2 + jnc @f + dec edi + cmp edi, edx + jae @b + pop edi + jmp .done_fail +@@: + pop edi + jmp .done_succ +end if + tolower: cmp al, 'A' jb @f @@ -2880,10 +3728,213 @@ match_symbol: pop eax ret +match_mask_rev_lowercase: +; in: esi->name, edx->end of name, edi->mask +; out: CF clear <=> match + pusha + xchg esi, edx + xchg esi, edi +.main_cycle: + mov ecx, esi +@@: + lodsb + test al, al + jz @f + cmp al, ',' + jz @f + cmp al, '|' + jnz @b +@@: + dec esi + mov [esi], byte 0 + call match_single_mask_rev_lowercase + mov [esi], al + inc esi + jnc .found + cmp al, ',' + jz .main_cycle +.done_fail: + stc + popa + ret +.found: + test al, al + jz .done_succ + cmp al, '|' + jz .test_exclude + lodsb + jmp .found +.done_succ: + clc + popa + ret +.test_exclude: + mov ecx, esi +@@: + lodsb + test al, al + jz @f + cmp al, ',' + jnz @b +@@: + dec esi + mov byte [esi], 0 + call match_single_mask_rev_lowercase + mov [esi], al + inc esi + jnc .done_fail + test al, al + jz .done_succ + jmp .test_exclude -header db 'Kolibri Far 0.14' -;.length = $ - header - db 0 +match_single_mask_rev_lowercase: +; in: esi->end of mask, ecx->start of mask, edi->end of name, edx->start of name +; out: CF clear <=> match + push esi edi eax +.mask_symbol: + dec esi + cmp esi, ecx + jb .mask_done + mov al, [esi] + cmp al, '*' + jz .asterisk + cmp al, '?' + jz .quest + cmp al, ']' + jz .list + dec edi + cmp edi, edx + jb .done_fail + cmp al, [edi] + jz .mask_symbol +.done_fail: + stc + pop eax edi esi + ret +.mask_done: + cmp edi, edx + jnz .done_fail +.done_succ: + clc + pop eax edi esi + ret +.quest: + dec edi + cmp edi, edx + jb .done_fail + jmp .mask_symbol +.list: + dec edi + cmp edi, edx + jb .done_fail +.list_check: + dec esi + cmp esi, ecx + jbe .done_fail + mov al, [esi] + cmp al, '[' + jz .done_fail + cmp byte [esi-1], '-' + jz .range + cmp al, [edi] + jnz .list_check +.listok: +@@: + dec esi + cmp esi, ecx + jb .done_fail + cmp byte [esi], '[' + jnz @b + jmp .mask_symbol +.range: + cmp al, [edi] + jb @f + mov al, [esi-2] + cmp al, [edi] + jbe .listok +@@: + dec esi + dec esi + jmp .list_check +.asterisk: + cmp esi, ecx + jz .done_succ + cmp byte [esi-1], '?' + jnz @f + cmp edi, edx + jz .done_fail + dec esi + jmp .asterisk +@@: + cmp byte [esi-1], ']' + jz .asterisk_common +; the mask is ...*... +.asterisk_normal: + mov al, [esi-1] +@@: + cmp edi, edx + jz .done_fail + cmp al, [edi] + jz @f + dec edi + jmp @b +@@: + dec edi + dec esi + call match_single_mask_rev_lowercase + jnc .done_succ + inc esi + jmp .asterisk_normal +.asterisk_common: + push edi +@@: + call match_single_mask_rev_lowercase + jnc @f + dec edi + cmp edi, edx + jae @b + pop edi + jmp .done_fail +@@: + pop edi + jmp .done_succ + +find_extension: + lea esi, [ecx+40] + push esi +@@: + lodsb + test al, al + jnz @b +@@: + dec esi + cmp byte [esi], '.' + jz .found_ext + cmp esi, [esp] + ja @b +; empty extension + pop esi + stc + ret +.found_ext: + inc esi + mov edi, associations +@@: + push esi edi + mov edi, [edi] + call strcmpi + pop edi esi + jz @f + add edi, 12 + cmp edi, associations_end + jb @b +; unknown extension + inc edi +@@: + pop esi + ret + +header db 'Kolibri Far 0.19',0 nomem_draw db 'No memory for redraw.',0 .size = $ - nomem_draw @@ -3257,8 +4308,16 @@ end if align 4 cur_width dd 80 cur_height dd 25 +saved_width dd -1 +saved_height dd -1 max_width = 256 max_height = 256 +console_data_ptr dd 0 + +cursor_x dd -1 +cursor_y dd -1 +old_cursor_x dd -1 +old_cursor_y dd -1 active_panel dd panel1_data @@ -3375,10 +4434,18 @@ panels_ctrlkeys: dd panels_OnKey.enter dw 0x3D, 0 dd panels_OnKey.f3 + dw 0x3F, 0 + dd panels_OnKey.f5 + dw 0x3F, 1 + dd panels_OnKey.shift_f5 dw 0x42, 0 dd panels_OnKey.f8 + dw 0x43, 0x100 + dd alt_f9 dw 0x44, 0 dd exit + dw 0x5D, 0 + dd panels_OnKey.menu repeat 9-3+1 dw 0x3D+%-1, 0x10 dd panels_OnKey.ctrl_f39 @@ -3434,6 +4501,8 @@ viewer_ctrlkeys: dd viewer_OnKey.end dw 0x58, 0 dd F12 + dw 0x43, 0x100 + dd alt_f9 db 0 dirinfo: @@ -3453,6 +4522,14 @@ readinfo: db 0 .name dd 0 +writeinfo: +.code dd 2 +.first dq 0 +.size dd 0 +.data dd 0 + db 0 +.name dd 0 + attrinfo: dd 5 dd 0 @@ -3493,6 +4570,8 @@ dialog_border_color db 70h dialog_header_color db 70h dialog_normal_btn_color db 70h dialog_selected_btn_color db 30h +dialog_edit_color db 30h +dialog_unmodified_edit_color db 38h ; Меню menu_normal_color db 3Fh menu_selected_color db 0Fh @@ -3535,6 +4614,7 @@ highlight: .Mask: ; ASCIIZ-string end virtual +; all highlight masks must be in lowercase! highlight_group0: db 13h db 38h @@ -3590,20 +4670,20 @@ highlight_group9: db '*',0 associations: - dd aAsm, tinypad - dd aInc, tinypad - dd aTxt, tinypad - dd aJpg, jpegview - dd aJpeg, jpegview - dd aGif, gifview - dd aWav, ac97 - dd aMp3, ac97 - dd aMid, midamp - dd aBmp, mv - dd aPng, archer - dd aRtf, rtfread - dd a3ds, view3ds - dd aLif, life2 + dd aAsm, tinypad, AsmMenu + dd aInc, tinypad, 0 + dd aTxt, tinypad, 0 + dd aJpg, jpegview, 0 + dd aJpeg, jpegview, 0 + dd aGif, gifview, GifMenu + dd aWav, ac97, 0 + dd aMp3, ac97, 0 + dd aMid, midamp, 0 + dd aBmp, mv, BmpMenu + dd aPng, archer, 0 + dd aRtf, rtfread, 0 + dd a3ds, view3ds, 0 + dd aLif, life2, 0 associations_end: aAsm db 'asm',0 @@ -3640,13 +4720,38 @@ view3ds db '/rd/1/3d/view3ds',0 aLif db 'lif',0 life2 db '/rd/1/demos/life2',0 +AsmMenu: + dd aEdit, tinypad + dd aCompile, fasm + dd 0 +BmpMenu: + dd aView, mv + dd aEdit, animage + dd 0 +GifMenu: + dd aView, gifview + dd aEdit, animage + dd 0 + +if lang eq en +aView db '&View',0 +aCompile db '&Compile',0 +aEdit db '&Edit',0 +else +aView db '&Просмотр',0 +aCompile db '&Компилировать',0 +aEdit db '&Редактор',0 +end if + +fasm db '/rd/1/develop/fasm',0 +animage db '/rd/1/animage',0 + bConfirmDelete db 1 ; Здесь заканчиваются конфигурационные данные bWasE0 db 0 ctrlstate db 0 -MemForImage dd 0 align 4 f8_confirm_dlgdata: @@ -3697,6 +4802,56 @@ f8_confirm_dlgdata: dd aCancel .flags2 dd 0 +; диалог копирования +copy_dlgdata: + dd 0 +.x dd -1 +.y dd -1 +.width dd ? +.height dd 4 + dd 4 + dd 2 + dd aCopyCaption +.main_color db ? +.border_color db ? +.header_color db ? + db 0 + dd 0 + dd 0 + dd 4 +; строка 'Копировать "%s" в:' + dd 1 + dd 1,0 +.width2 dd ? + dd 0 + dd CopySourceTextBuf + dd 0 +; поле редактирования с именем файла/папки назначения + dd 3 + dd 1,1 +.width3 dd ? + dd 1 + dd CopyDestEditBuf +.flags0 dd 0 +; кнопка "копировать" +.copy_btn: + dd 2 +.copy_x1 dd ? + dd 3 +.copy_x2 dd ? + dd 3 + dd aCopy +.flags1 dd 18h +; кнопка "отменить" + dd 2 +.cnl_x1 dd ? + dd 3 +.cnl_x2 dd ? + dd 3 + dd aCancelB +.flags2 dd 8 + + if lang eq ru aDeleteCaption db 'Удаление',0 aConfirmDeleteText db 'Вы хотите удалить ',0 @@ -3707,6 +4862,13 @@ aDelete db ' aDeleteLength = $ - aDelete - 1 aCancel db ' Отменить ',0 aCancelLength = $ - aCancel - 1 +aCancelB db '[ Отменить ]',0 +aCancelBLength = $ - aCancelB - 1 +aCopyCaption db 'Копирование',0 +aCopy db '[ Копировать ]',0 +aCopyLength = $ - aCopy - 1 +aCopy1 db 'Копировать "',0 +aCopy2 db '" в:',0 else aDeleteCaption db 'Delete',0 aConfirmDeleteText db 'Do you wish to delete ',0 @@ -3717,6 +4879,13 @@ aDelete db ' Delete ',0 aDeleteLength = $ - aDelete - 1 aCancel db ' Cancel ',0 aCancelLength = $ - aCancel - 1 +aCancelB db '[ Cancel ]',0 +aCancelBLength = $ - aCancelB - 1 +aCopyCaption db 'Copy',0 +aCopy db '[ Copy ]',0 +aCopyLength = $ - aCopy - 1 +aCopy1 db 'Copy "',0 +aCopy2 db '" to:',0 end if execinfo: @@ -3770,7 +4939,7 @@ panel2_numfiles dd ? panel2_files dd ? panel2_dir rb 1024 -console_data rb max_width*max_height*2 +;console_data rb max_width*max_height*2 cur_header rb max_width tmp dd ? @@ -3778,6 +4947,13 @@ tmp dd ? skinh dd ? std_colors rd 10 +min_y dd ? +max_y dd ? +min_x dd ? +max_x dd ? +used_width dd ? +used_height dd ? + column_left dd ? column_top dd ? column_width dd ? @@ -3789,6 +4965,7 @@ viewer_right_side dq ? saved_file_name: procinfo rb 1024 +lower_file_name = procinfo + 512 driveinfo rb 32+304 tmpname rb 32 @@ -3799,13 +4976,19 @@ active_screen_vtable dd ? active_screen_data dd ? aConfirmDeleteTextBuf rb aConfirmDeleteTextMax + 1 +CopySourceTextBuf rb 512 +CopyDestEditBuf rb 12+512+1 +.length = $ - CopyDestEditBuf - 9 + +align 4 +layout rb 128 + +copy_buffer_size = 32768 +copy_buffer rb copy_buffer_size ; stack align 4 rb 512 stacktop: -; buffers for directory - may be resized dynamically -buf1 rb 4*304 + 32 + 304*304 -buf2 rb 4*304 + 32 + 304*304 mem: