diff --git a/kernel/branches/gfx_kernel/core/newproce.inc b/kernel/branches/gfx_kernel/core/newproce.inc index 0aed83203a..70ed4b0e19 100644 --- a/kernel/branches/gfx_kernel/core/newproce.inc +++ b/kernel/branches/gfx_kernel/core/newproce.inc @@ -468,6 +468,7 @@ new_start_application_fl: ;calculate parameter length mov esi,eax xor ecx,ecx + inc ecx ; include terminating null .command_line_len: cmp byte [esi],0 jz .command_line_len_end diff --git a/kernel/branches/gfx_kernel/gui/font.inc b/kernel/branches/gfx_kernel/gui/font.inc index 28570c0dbe..cd62e2dac6 100644 --- a/kernel/branches/gfx_kernel/gui/font.inc +++ b/kernel/branches/gfx_kernel/gui/font.inc @@ -1,119 +1,107 @@ align 4 dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org]) ; eax x & y - ; ebx font ( 0xX0000000 ) & color ( 0x00RRGGBB ) + ; ebx style ( 0xX0000000 ) & color ( 0x00RRGGBB ) + ; X = ABnnb: + ; nn = font + ; A = 0 <=> output edx characters; otherwise output ASCIIZ string + ; B = 1 <=> fill background with color esi ; ecx start of text - ; edx length ; edi 1 force pushad + call [disable_mouse] - mov esi,edx ;esi=length - mov ebp,ecx ;ebp=ptr to text - mov ecx,ebx ;ecx=color - movsx ebx,ax ;ebx=y - sar eax,16 ;eax=x - and esi, 0xFF ;limit of text = 255 symbols - -dtext.lnew: - test esi, esi ; zero length ? - jnz @f - jmp dtext.output_end - @@: - - movzx edx,byte [ebp] ;edx=ascii code - test edx,edx - jz dtext.output_end - test ecx,0x10000000 - jnz dtext.letnew2 - - align 4 - .letnew: - -drawletter: ;output char of type 1(monotype) -;eax - x -;ebx - y -;ecx - color -;edx - ascii code - pushad - call [disable_mouse] - mov esi,9 - lea ebp,[0x3F600+8*edx+edx] -.symloop: - push esi - mov dl,byte [ebp] - mov esi,8 -.pixloop: - test dl,1 - jz .nopix - call [putpixel] + mov ebp, ecx ; ebp=pointer to text + mov ecx, ebx ; ecx=color + movsx ebx, ax ; ebx=y + sar eax, 16 ; eax=x + cmp edx, 255 + jb .loop + mov edx, 255 +.loop: + test ecx, ecx + js .test_asciiz + dec edx + js .end + jmp @f +.test_asciiz: + cmp byte [ebp], 0 + jz .end +@@: + push edx + movzx edx, byte [ebp] + inc ebp + test ecx, 0x10000000 + jnz .font2 + pushad + mov esi, 9 + lea ebp, [0x3F600+8*edx+edx] +.symloop1: + mov dl, byte [ebp] + or dl, 1 shl 6 +.pixloop1: + shr dl, 1 + jz .pixloop1end + jnc .nopix + call [putpixel] + jmp .pixloop1cont .nopix: - shr dl,1 - inc eax - dec esi - jnz .pixloop - sub eax,8 - inc ebx - inc ebp - pop esi - dec esi - jnz .symloop - popad - - add eax,6 - - inc ebp ;ptr to text - dec esi ;length - jnz dtext.lnew - - jmp dtext.output_end - - - dtext.letnew2: - -align 4 -drawletter2: ;output char of type 2(proportional) -;eax - x -;ebx - y -;ecx - color -;edx - symbol -;edi - force? -;result - eax=eax+sym_size - pushad - call [disable_mouse] - shl edx,1 - mov esi,9 - lea ebp,[0x3EC00+4*edx+edx+1] -.symloop: - push esi - mov dl,byte [ebp] - xor esi,esi -.pixloop: - test dl,1 - jz .nopix - call [putpixel] -.nopix: - shr dl,1 - inc esi - inc eax - cmp esi,8 - jl .pixloop - sub eax,8 - inc ebx - pop esi - inc ebp - dec esi - jnz .symloop - movzx edx,byte [ebp-10] - add [esp+32-4],edx - popad - - - inc ebp ;ptr to text - dec esi ;length - jnz dtext.lnew - - -dtext.output_end: + test ecx, 0x40000000 + jz .pixloop1cont + push ecx + mov ecx, [esp+4+4] + call [putpixel] + pop ecx +.pixloop1cont: + inc eax + jmp .pixloop1 +.pixloop1end: + sub eax, 6 + inc ebx + inc ebp + dec esi + jnz .symloop1 popad - ret \ No newline at end of file + add eax, 6 + pop edx + jmp .loop +.font2: + pushad + add edx, edx + lea ebp, [0x3EC00+4*edx+edx+1] + push 9 + movzx esi, byte [ebp-1] +.symloop2: + mov dl, byte [ebp] + push esi +.pixloop2: + shr dl, 1 + jnc .nopix2 + call [putpixel] + jmp .pixloop2cont +.nopix2: + test ecx, 0x40000000 + jz .pixloop2cont + push ecx + mov ecx, [esp+12+4] + call [putpixel] + pop ecx +.pixloop2cont: + inc eax + dec esi + jnz .pixloop2 + pop esi + sub eax, esi + inc ebx + inc ebp + dec dword [esp] + jnz .symloop2 + pop eax + add dword [esp+28], esi + popad + pop edx + jmp .loop +.end: + popad + ret diff --git a/kernel/branches/gfx_kernel/kernel.asm b/kernel/branches/gfx_kernel/kernel.asm index 30d57e11ee..61cd9285c0 100644 --- a/kernel/branches/gfx_kernel/kernel.asm +++ b/kernel/branches/gfx_kernel/kernel.asm @@ -196,15 +196,10 @@ endg boot_log: pushad - mov edx,esi -.bll3: inc edx - cmp [edx],byte 0 - jne .bll3 - sub edx,esi mov eax,10*65536 mov ax,word [boot_y] add [boot_y],dword 10 - mov ebx,0xffffff + mov ebx,0x80ffffff ; ASCIIZ string with white color mov ecx,esi mov edi,1 call dtext @@ -1358,9 +1353,7 @@ display_number: cmp al,1 ; ecx is a pointer ? jne displnl1 - mov edi,[0x3010] - mov edi,[edi+TASKDATA.mem_start] - mov ebx,[edi+ebx] + mov ebx,[ebx+std_application_base_address] displnl1: sub esp,64 @@ -1458,21 +1451,18 @@ draw_num_text: add ecx,esp add ecx,4 mov eax,[esp+64+32-8+4] - mov ebx,[esp+64+32-12+4] push edx ; add window start x & y - push ebx mov edx,[0x3010] mov ebx,[edx-twdw+WDATA.box.left] shl ebx,16 add ebx,[edx-twdw+WDATA.box.top] add eax,ebx - pop ebx pop edx - mov edi,0 - call dtext - - ret - + mov ebx,[esp+64+32-12+4] + and ebx, not 0x80000000 ; force counted string + mov esi, [esp+64+4+4] + xor edi,edi + jmp dtext read_string: @@ -2914,10 +2904,7 @@ draw_window_caption: add ax,[_skinmargins.top] add ax,-3 add eax,ebp - mov ebx,[common_colours+16];0x00FFFFFF - xor edi,edi - call dtext - jmp @f + jmp .dodraw .not_skinned: cmp al,1 @@ -2936,10 +2923,11 @@ draw_window_caption: mov edx,eax mov eax,0x00080007 add eax,ebp +.dodraw: mov ebx,[common_colours+16];0x00FFFFFF + or ebx, 0x80000000 xor edi,edi call dtext - jmp @f @@: ;-------------------------------------------------------------- @@ -4825,12 +4813,14 @@ syscall_writetext: ; WriteText mov edi,[0x3010] mov ebp,[edi-twdw+WDATA.box.left] + push esi mov esi,[0x3000] shl esi,8 add ebp,[esi+0x80000+APPDATA.wnd_clientbox.left] shl ebp,16 add ebp,[edi-twdw+WDATA.box.top] add bp,word[esi+0x80000+APPDATA.wnd_clientbox.top] + pop esi add ecx,[edi+TASKDATA.mem_start] add eax,ebp xor edi,edi diff --git a/kernel/trunk/boot/shutdown.inc b/kernel/trunk/boot/shutdown.inc index 03cab4b630..e4188c3f29 100644 --- a/kernel/trunk/boot/shutdown.inc +++ b/kernel/trunk/boot/shutdown.inc @@ -507,7 +507,7 @@ shutdowntext: db '2) APM - POWEROFF ' db '3) REBOOT ' db '4) RESTART KERNEL ' -else +else if lang eq ru shutdowntext: db "Безопасное выключение компьютера или " db ' ' @@ -515,6 +515,14 @@ shutdowntext: db '2) APM - выключение питания ' db '3) Перезагрузка системы ' db '4) Рестарт ядра из ОЗУ ' +else +shutdowntext: + db "SIE KOENNEN DEN COMPUTER NUN AUSSCHALTEN" + db ' ' + db '1) RAMDISK AUF DISK SPEICHERN ' + db '2) APM - AUSSCHALTEN ' + db '3) NEUSTARTEN ' + db '4) KERNEL NEU STARTEN ' end if rosef: db 'ROSE TXT' diff --git a/kernel/trunk/core/newproce.inc b/kernel/trunk/core/newproce.inc index 0aed83203a..70ed4b0e19 100644 --- a/kernel/trunk/core/newproce.inc +++ b/kernel/trunk/core/newproce.inc @@ -468,6 +468,7 @@ new_start_application_fl: ;calculate parameter length mov esi,eax xor ecx,ecx + inc ecx ; include terminating null .command_line_len: cmp byte [esi],0 jz .command_line_len_end diff --git a/kernel/trunk/docs/sysfuncs.txt b/kernel/trunk/docs/sysfuncs.txt index c065e6a1c7..c15de5c096 100644 --- a/kernel/trunk/docs/sysfuncs.txt +++ b/kernel/trunk/docs/sysfuncs.txt @@ -188,16 +188,17 @@ Parameters: * ebx = [coordinate on axis x]*65536 + [coordinate on axis y] * ecx = 0xX0RRGGBB, where * RR, GG, BB specify text color - * X specifies the used font: 0=system monospaced, + * X=ABnn (bits): + * nn specifies the used font: 0=system monospaced, 1=system font of variable width + * A=0 - output esi characters, A=1 - output ASCIIZ-string + * B=1 - fill background with the color edi * edx = pointer to the beginning of the string - * esi = length of the string, must not exceed 255 + * esi = for A=0 length of the string, must not exceed 255; + for A=1 is ignored Returned value: * function does not return value Remarks: - * Function outputs either first (esi and 0xFF) characters or - all characters before (but not including) terminating zero - (for ASCIIZ-strings) depending on what occurs first. * First system font is read out at loading from the file char.mt, second - from char2.mt. * Both fonts have height 9 pixels, width of the monospaced font @@ -424,14 +425,14 @@ Remarks: =============== Function 12 - begin/end window redraw. =============== ====================================================================== ------------- Subfunction 1 - begin redraw of the window. ------------- +---------------- Subfunction 1 - begin window redraw. ---------------- Parameters: * eax = 12 - function number * ebx = 1 - subfunction number Returned value: * function does not return value -------------- Subfunction 2 - end redraw of the window. -------------- +----------------- Subfunction 2 - end window redraw. ----------------- Parameters: * eax = 12 - function number * ebx = 2 - subfunction number @@ -2054,7 +2055,12 @@ Parameters: * сшЄ√ 22-31 reserved and must be set to 0 * ecx = number (if bl=0) or pointer (if bl=1) * edx = [coordinate on axis x]*65536 + [coordinate on axis y] - * esi = 0xN0RRGGBB, RRGGBB=color, N=font (0/1) + * esi = 0xX0RRGGBB: + * RR, GG, BB specify the color + * X = ABnn (bits) + * nn = font (0/1) + * A is ignored + * B=1 - fill background with the color edi Returned value: * function does not return value Remarks: diff --git a/kernel/trunk/fs/fat32.inc b/kernel/trunk/fs/fat32.inc index 4b583493a8..824e4109b6 100644 --- a/kernel/trunk/fs/fat32.inc +++ b/kernel/trunk/fs/fat32.inc @@ -7,6 +7,7 @@ ;; Copyright 2002 Paolo Minazzi, paolo.minazzi@inwind.it ;; ;; ;; ;; See file COPYING for details ;; +;; 20.08.2006 LFN set file size (truncate/extend) - diamond ;; ;; 17.08.2006 LFN write/append to file - diamond ;; ;; 23.06.2006 LFN start application - diamond ;; ;; 15.06.2006 LFN get/set file/folder info - diamond ;; diff --git a/kernel/trunk/gui/font.inc b/kernel/trunk/gui/font.inc index 51418ce382..cd62e2dac6 100644 --- a/kernel/trunk/gui/font.inc +++ b/kernel/trunk/gui/font.inc @@ -1,119 +1,107 @@ align 4 dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org]) ; eax x & y - ; ebx font ( 0xX0000000 ) & color ( 0x00RRGGBB ) + ; ebx style ( 0xX0000000 ) & color ( 0x00RRGGBB ) + ; X = ABnnb: + ; nn = font + ; A = 0 <=> output edx characters; otherwise output ASCIIZ string + ; B = 1 <=> fill background with color esi ; ecx start of text - ; edx length ; edi 1 force pushad + call [disable_mouse] - mov esi,edx ;esi=length - mov ebp,ecx ;ebp=ptr to text - mov ecx,ebx ;ecx=color - movzx ebx,ax ;ebx=y - shr eax,16 ;eax=x - and esi, 0xFF ;limit of text = 255 symbols - -dtext.lnew: - test esi, esi ; zero length ? - jnz @f - jmp dtext.output_end - @@: - - movzx edx,byte [ebp] ;edx=ascii code - test edx,edx - jz dtext.output_end - test ecx,0x10000000 - jnz dtext.letnew2 - - align 4 - .letnew: - -drawletter: ;output char of type 1(monotype) -;eax - x -;ebx - y -;ecx - color -;edx - ascii code - pushad - call [disable_mouse] - mov esi,9 - lea ebp,[0x3F600+8*edx+edx] -.symloop: - push esi - mov dl,byte [ebp] - mov esi,8 -.pixloop: - test dl,1 - jz .nopix - call [putpixel] + mov ebp, ecx ; ebp=pointer to text + mov ecx, ebx ; ecx=color + movsx ebx, ax ; ebx=y + sar eax, 16 ; eax=x + cmp edx, 255 + jb .loop + mov edx, 255 +.loop: + test ecx, ecx + js .test_asciiz + dec edx + js .end + jmp @f +.test_asciiz: + cmp byte [ebp], 0 + jz .end +@@: + push edx + movzx edx, byte [ebp] + inc ebp + test ecx, 0x10000000 + jnz .font2 + pushad + mov esi, 9 + lea ebp, [0x3F600+8*edx+edx] +.symloop1: + mov dl, byte [ebp] + or dl, 1 shl 6 +.pixloop1: + shr dl, 1 + jz .pixloop1end + jnc .nopix + call [putpixel] + jmp .pixloop1cont .nopix: - shr dl,1 - inc eax - dec esi - jnz .pixloop - sub eax,8 - inc ebx - inc ebp - pop esi - dec esi - jnz .symloop - popad - - add eax,6 - - inc ebp ;ptr to text - dec esi ;length - jnz dtext.lnew - - jmp dtext.output_end - - - dtext.letnew2: - -align 4 -drawletter2: ;output char of type 2(proportional) -;eax - x -;ebx - y -;ecx - color -;edx - symbol -;edi - force? -;result - eax=eax+sym_size - pushad - call [disable_mouse] - shl edx,1 - mov esi,9 - lea ebp,[0x3EC00+4*edx+edx+1] -.symloop: - push esi - mov dl,byte [ebp] - xor esi,esi -.pixloop: - test dl,1 - jz .nopix - call [putpixel] -.nopix: - shr dl,1 - inc esi - inc eax - cmp esi,8 - jl .pixloop - sub eax,8 - inc ebx - pop esi - inc ebp - dec esi - jnz .symloop - movzx edx,byte [ebp-10] - add [esp+32-4],edx - popad - - - inc ebp ;ptr to text - dec esi ;length - jnz dtext.lnew - - -dtext.output_end: + test ecx, 0x40000000 + jz .pixloop1cont + push ecx + mov ecx, [esp+4+4] + call [putpixel] + pop ecx +.pixloop1cont: + inc eax + jmp .pixloop1 +.pixloop1end: + sub eax, 6 + inc ebx + inc ebp + dec esi + jnz .symloop1 popad - ret \ No newline at end of file + add eax, 6 + pop edx + jmp .loop +.font2: + pushad + add edx, edx + lea ebp, [0x3EC00+4*edx+edx+1] + push 9 + movzx esi, byte [ebp-1] +.symloop2: + mov dl, byte [ebp] + push esi +.pixloop2: + shr dl, 1 + jnc .nopix2 + call [putpixel] + jmp .pixloop2cont +.nopix2: + test ecx, 0x40000000 + jz .pixloop2cont + push ecx + mov ecx, [esp+12+4] + call [putpixel] + pop ecx +.pixloop2cont: + inc eax + dec esi + jnz .pixloop2 + pop esi + sub eax, esi + inc ebx + inc ebp + dec dword [esp] + jnz .symloop2 + pop eax + add dword [esp+28], esi + popad + pop edx + jmp .loop +.end: + popad + ret diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index cdaef97dbc..1f212435f1 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -194,15 +194,10 @@ endg boot_log: pushad - mov edx,esi -.bll3: inc edx - cmp [edx],byte 0 - jne .bll3 - sub edx,esi mov eax,10*65536 mov ax,word [boot_y] add [boot_y],dword 10 - mov ebx,0xffffff + mov ebx,0x80ffffff ; ASCIIZ string with white color mov ecx,esi mov edi,1 call dtext @@ -1313,9 +1308,7 @@ display_number: cmp al,1 ; ecx is a pointer ? jne displnl1 - mov edi,[0x3010] - mov edi,[edi+TASKDATA.mem_start] - mov ebx,[edi+ebx] + mov ebx,[ebx+std_application_base_address] displnl1: sub esp,64 @@ -1420,21 +1413,18 @@ draw_num_text: add ecx,esp add ecx,4 mov eax,[esp+64+32-8+4] - mov ebx,[esp+64+32-12+4] push edx ; add window start x & y - push ebx mov edx,[0x3010] mov ebx,[edx-twdw+WDATA.box.left] shl ebx,16 add ebx,[edx-twdw+WDATA.box.top] add eax,ebx - pop ebx pop edx - mov edi,0 - call dtext - - ret - + mov ebx,[esp+64+32-12+4] + and ebx, not 0x80000000 ; force counted string + mov esi, [esp+64+4+4] + xor edi,edi + jmp dtext read_string: @@ -2900,10 +2890,7 @@ draw_window_caption: add ax,[_skinmargins.top] add ax,-3 add eax,ebp - mov ebx,[common_colours+16];0x00FFFFFF - xor edi,edi - call dtext - jmp @f + jmp .dodraw .not_skinned: cmp al,1 @@ -2922,10 +2909,11 @@ draw_window_caption: mov edx,eax mov eax,0x00080007 add eax,ebp +.dodraw: mov ebx,[common_colours+16];0x00FFFFFF + or ebx, 0x80000000 xor edi,edi call dtext - jmp @f @@: ;-------------------------------------------------------------- @@ -4809,12 +4797,14 @@ syscall_writetext: ; WriteText mov edi,[0x3010] mov ebp,[edi-twdw+WDATA.box.left] + push esi mov esi,[0x3000] shl esi,8 add ebp,[esi+0x80000+APPDATA.wnd_clientbox.left] shl ebp,16 add ebp,[edi-twdw+WDATA.box.top] add bp,word[esi+0x80000+APPDATA.wnd_clientbox.top] + pop esi add ecx,[edi+TASKDATA.mem_start] add eax,ebp xor edi,edi diff --git a/programs/media/ac97wav/trunk/ac97wav.asm b/programs/media/ac97wav/trunk/ac97wav.asm index 258446d593..f346f0426c 100644 --- a/programs/media/ac97wav/trunk/ac97wav.asm +++ b/programs/media/ac97wav/trunk/ac97wav.asm @@ -11,8 +11,9 @@ ; stops playing before closing a window ; 0.08 Nov 24, 2004 added support for 8bit and mono modes ; +variable rate for some chipsets +; 0.09 August 26, 2006 modified to use function 70 ; -; Use [flat assembler 1.56] to compile. +; Use [flat assembler 1.64] to compile. ; ;--------------------------------------------------------------------- @@ -31,7 +32,6 @@ ;--------------------------------------------------------------------- -include "lang.inc" include "macros.inc" ; standart macros & constants include "meosfunc.inc" ; MenuetOS API functions names include "debug.inc" ; printing to debug board @@ -449,19 +449,24 @@ ret ;; in: nothing ;; out: nothing (but sound :) !corrupts registers! play: - ; at first, reset file - mov [fileinfo.first_block], 0 + ; at first, reset file and get file size + mcall MF_SYSTREE, attrinfo + test eax, eax + jnz .notfound + mov eax, [fileattr+32] + mov [file_size], eax + mov [fileinfo.first_byte], 0 mcall MF_SYSTREE, fileinfo ; load a block, returns error code in eax ; and size of the file in ebx test eax, eax ; 0 - successful jz @f + cmp eax, 6 ; 6 = eof - successful too + jz @f +.notfound: print "AC97: File not found!" mov [status], ST_STOP jmp .exit @@: - shr ebx, 9 ; size_of_file / 512 = number_of_blocks - mov [file_size], ebx - mov al, [LOAD_BUFFER+32] ; bytes per sample dec al @@ -608,7 +613,7 @@ update_next_buffer: movzx edx, byte [wav_mode] mov ecx, [blocks + edx * 4] - mov [fileinfo.blocks], ecx + mov [fileinfo.bytes], ecx mov esi, LOAD_BUFFER mov edi, [buffers+eax*4] @@ -617,14 +622,16 @@ update_next_buffer: mcall MF_SYSTREE, fileinfo test eax, eax jz @f + cmp eax, 6 + jz @f cmp [attempts],100 je @f inc [attempts] jmp start_attempts - dpd eax - newline - dpd [fileinfo.first_block] - newline +; dpd eax +; newline +; dpd [fileinfo.first_block] +; newline @@: ; print " loaded!" @@ -652,7 +659,7 @@ update_next_buffer: pop edx ebx mov eax,[esp+4] ;restore buffer index - add [fileinfo.first_block], ecx ; +60Kb + add [fileinfo.first_byte], ecx ; +60Kb call [convert + edx * 4] ;start fix for MM (4) mov eax,[esp+4] ;restore buffer index @@ -881,7 +888,7 @@ znak db 0 type_of_conversion db 0 convert dd c8mono, c8stereo, c16mono, c16stereo -blocks dd 30, 60, 60, 120 +blocks dd 30*512, 60*512, 60*512, 120*512 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -993,20 +1000,29 @@ ret ;--------------------------------------------------------------------- volume dd 15 +attrinfo: + dd 5 + dd 0 + dd 0 + dd 0 + dd fileattr + db 0 + dd textbox_string + fileinfo: - .mode dd 0 ; READ - .first_block dd 0 - .blocks dd 120 ; 120 Kb + .mode dd 0 ; READ + .first_byte dd 0 + dd 0 + .bytes dd 60*1024 ; 60 Kb .dest dd LOAD_BUFFER ;file_data - .work dd work_area ; db "/HD/1/WINDOWS/MEDIA/WICEB7~1.WAV",0 ;sz textbox_string, "/hd/1/testmuz/menuet11.wav",0 -sz textbox_string, " ",0 -; rb 256 +textbox_string: ;--------------------------------------------------------------------- IMAGE_END: ; end of program's image - rb 100-textbox_string.size + rb 257 +; rb 257-textbox_string.size ; textbox_string.size ;--------------------------------------------------------------------- @@ -1035,6 +1051,8 @@ ST_STOP = 0x4 status db ? +fileattr: rb 40 + ;--------------------------------------------------------------------- phys_bdl_buffer rd 1 phys_wav_buffer1 rd 1 diff --git a/programs/media/ac97wav/trunk/frontend.inc b/programs/media/ac97wav/trunk/frontend.inc index a9a7348502..a09033ea24 100644 --- a/programs/media/ac97wav/trunk/frontend.inc +++ b/programs/media/ac97wav/trunk/frontend.inc @@ -1,4 +1,11 @@ thread: + mov edi, textbox_string + or ecx, -1 + xor eax, eax + repnz scasb + not ecx + dec ecx + mov [textbox_position], cl call draw_window call main_loop mov [status], ST_EXIT @@ -36,7 +43,7 @@ main_loop: cmp ah, 8 je .backspace movzx ecx, [textbox_position] - cmp ecx, 47 + cmp ecx, 255 jae .enter mov [textbox_string + ecx], ah inc [textbox_position] @@ -50,8 +57,8 @@ main_loop: movzx ecx, [textbox_position] test ecx, ecx jz main_loop - mov [textbox_string + ecx], byte 0 dec [textbox_position] + mov [textbox_string + ecx - 1], byte 0 call textbox_draw jmp main_loop @@ -173,17 +180,15 @@ main_loop: mcall MF_GETMOUSE, MS_COORDS_WINDOW shr eax, 16 ; get mouse.x sub eax, 7 - test eax, eax jz @f - imul eax, [file_size] + imul [file_size] mov ebx, 286 - cdq div ebx @@: ;dps "block: " ;dpd eax ;newline - mov [fileinfo.first_block], eax + mov [fileinfo.first_byte], eax call draw_progress_bar jmp main_loop ret @@ -244,8 +249,8 @@ ret draw_progress_bar: pushad - imul eax, [fileinfo.first_block], PBAR_WIDTH - cdq + mov eax, PBAR_WIDTH + mul [fileinfo.first_byte] div [file_size] push eax @@ -266,5 +271,5 @@ sz header, "AC'97 WAV player - all PCM audio" sz buttons_text, " Play Stop << >> Vol- Vol+" textbox_active db 0 -textbox_position db textbox_string.size-1 +textbox_position db 0;textbox_string.size-1 file_size dd 100 diff --git a/programs/media/ac97wav/trunk/macros.inc b/programs/media/ac97wav/trunk/macros.inc index 1d153e8723..d290e9e09b 100644 --- a/programs/media/ac97wav/trunk/macros.inc +++ b/programs/media/ac97wav/trunk/macros.inc @@ -143,6 +143,8 @@ macro mcall a,b,c,d,e,f { ; mike.dld +; language for programs +lang fix ru ; ru en fr ge fi diff --git a/programs/media/ac97wav/trunk/meosfunc.inc b/programs/media/ac97wav/trunk/meosfunc.inc index d503176d0f..c479bfb8ee 100644 --- a/programs/media/ac97wav/trunk/meosfunc.inc +++ b/programs/media/ac97wav/trunk/meosfunc.inc @@ -19,11 +19,11 @@ MF_PORTS = 46 PRT_FREE = 1 MF_THREAD = 51 THR_CREATE = 1 -MF_SYSTREE = 58 MF_PCI = 62 MF_EXIT = -1 MF_INTERNAL_SERVICES = 68 ALLOC_PHYS_MEM =5 FREE_PHYS_MEM =6 SET_PHYS_BUFFER =7 - GET_PHYS_BUFFER =8 \ No newline at end of file + GET_PHYS_BUFFER =8 +MF_SYSTREE = 70 \ No newline at end of file diff --git a/programs/media/midamp/trunk/draw.inc b/programs/media/midamp/trunk/draw.inc index 98d98995ea..42f2e8f6a9 100644 --- a/programs/media/midamp/trunk/draw.inc +++ b/programs/media/midamp/trunk/draw.inc @@ -8,8 +8,7 @@ draw_bar: test eax,eax jz .ex mov ebp,[coo] - mov ebx,[ebp-20] - mul ebx + mul dword [ebp-20] mov ebx,[tick_count] test ebx,ebx jz .ex @@ -353,4 +352,4 @@ bot_btn: dw 10,40,70,100,240 about1: - db 13,10,'* MIDAMP for MenuetOS v1.0 by Willow, July 2005 *',13,10,0 \ No newline at end of file + db 13,10,'* MIDAMP for KolibriOS v1.1 by Willow, July 2005 *',13,10,0 \ No newline at end of file diff --git a/programs/media/midamp/trunk/event.inc b/programs/media/midamp/trunk/event.inc index 9686114bcc..9949e9b257 100644 --- a/programs/media/midamp/trunk/event.inc +++ b/programs/media/midamp/trunk/event.inc @@ -341,51 +341,37 @@ OCT_CH equ 3 and byte[edi],0 mov esi,filename mov edi,fnbuf - mov ecx,64 - rep movsb - mov dword[file_info+12],dir_table - mov dword[file_info+8],DIR_SIZE/512 + mov ecx,1024/4 + rep movsd + and dword [dir_info+4], 0 .nxt2: - mcall 58,file_info - mov ecx,DIR_SIZE/32 - mov esi,dir_table - .nxt: - mov al,[esi] - cmp al,0xe5 - je .no - test al,al - jz .end - test byte[esi+12],11000b - jnz .no - mov eax,[esi+7] - mov al,'.' - cmp eax,'.MID' - je .ok - cmp eax,'.KAR' - jne .no - .ok: - mov [esi+8],eax - pusha - mov edi,edx - mov ecx,12 - rep movsb - and byte[edi],0 - mov ecx,edi - sub ecx,fnbuf - mov esi,fnbuf - call PL_add - popa - .no: - add esi,32 - loop .nxt - add dword[file_info+4],DIR_SIZE/512 - jmp .nxt2 - .end: - mov ebx,file_info - and dword[ebx+4],0 - mov [fsize],1 - mov dword[ebx+12],workarea - jmp red;still + mcall 70, dir_info + cmp ebx, 1 + jnz red ;still + test byte [dir_table+32], 11000b ; exclude directories & vol label + jnz .no + mov edi, dir_table+32+40 + mov esi, edi + xor eax, eax + or ecx, -1 + repnz scasb + mov eax, [edi-5] + or eax, 0x20202000 + cmp eax, '.mid' + jz .ok + cmp eax, '.kar' + jnz .no +.ok: + lea ecx, [edi-dir_table-32-40-1] + mov edi, edx + rep movsb + mov ecx, edi + mov esi, fnbuf + sub ecx, esi + call PL_add +.no: + inc dword [dir_info+4] + jmp .nxt2 bSelZero: call PL_clearsel jmp red diff --git a/programs/media/midamp/trunk/gif_lite.inc b/programs/media/midamp/trunk/gif_lite.inc index 4086245a33..0307e49148 100644 --- a/programs/media/midamp/trunk/gif_lite.inc +++ b/programs/media/midamp/trunk/gif_lite.inc @@ -88,7 +88,7 @@ ReadGIF: mov [.img_count],eax inc eax cmp dword[esi],'GIF8' - jne .er ; signature + jne .ex ; signature mov ecx,[esi+0xa] inc eax add esi,0xd @@ -123,7 +123,7 @@ ReadGIF: jmp .block_skip .noextblock: cmp byte[edi],0x2c ; image beginning - jne .er + jne .ex inc [.img_count] inc edi mov esi,[.cur_info] @@ -211,9 +211,6 @@ ReadGIF: call .Gif_output pop ebx eax jmp .add - .er: - pop edi - jmp .ex .end: mov eax,[.cur_info] mov [eax],edi @@ -229,7 +226,6 @@ ReadGIF: cmp byte[edi],0x3b jne .nextblock xor eax,eax - stosd mov ecx,[.img_count] .ex: pop edi esi diff --git a/programs/media/midamp/trunk/playlist.inc b/programs/media/midamp/trunk/playlist.inc index 427e6206c7..6263f56319 100644 --- a/programs/media/midamp/trunk/playlist.inc +++ b/programs/media/midamp/trunk/playlist.inc @@ -236,8 +236,10 @@ PL_load: and [list_count],0 mov [pl_ptr],playlist mov ebx,PL_info - mov dword[ebx+12],playlist - mov eax,58 + mov dword[ebx+16],playlist + and dword[ebx],0 + mov dword[ebx+12],20*512 + mov eax,70 int 0x40 test eax,eax jz .ok1 ; ebx- filesize @@ -295,7 +297,7 @@ PL_save: mov eax,0x0a0d mov edi,[pl_ptr] lea edx,[edi+2] - mov [PL_info+12],edx + mov [PL_info+16],edx .savl: movzx ebx,word[edi] and bx,not FL_MULSEL @@ -305,9 +307,9 @@ PL_save: stosw sub edi,[pl_ptr] mov ebx,PL_info - mov [ebx+8],edi - mov dword[ebx],1 - mov eax,58 + mov [ebx+12],edi + mov byte[ebx],2 + mov eax,70 int 0x40 .ex: ret @@ -343,7 +345,7 @@ PL_swap: ; swap [ebx] with [ebx+1] PL_info: .mode dd 0 dd 0 - .bytes dd 20 dd 0 - dd hash_table + .bytes dd 20*512 + dd 0 db PLAYLIST_PATH,0 diff --git a/programs/other/archer/trunk/@RCHER.ASM b/programs/other/archer/trunk/@RCHER.ASM index 0840fdd07d..1af15e0f7a 100644 --- a/programs/other/archer/trunk/@RCHER.ASM +++ b/programs/other/archer/trunk/@RCHER.ASM @@ -4,7 +4,7 @@ ; ; Created: May 6, 2005 ; -; Last changed: July 14, 2005 +; Last changed: August 26, 2006 ; ; Compile with FASM @@ -13,7 +13,7 @@ OUTBUF equ 4*1024*1024 png_imag = output+OUTBUF PARAM_PTR = os_work;png_image MEMINIT=next_code;output -DUMPFILE equ '/hd/1/out.txt' +DUMPFILE equ '/hd0/1/out.txt' SHOW_RBLOCK equ 0;1 SHOW_PNG_SEC equ 0;1 @@ -62,7 +62,7 @@ use32 dd start dd I_END dd MEMINIT - dd main_stack;MEMORY-2048 + dd main_stack_top;MEMORY-2048 if PARAM_PTR eq param dd 0 else @@ -337,7 +337,7 @@ else Msg 37 .nomsg: mov [outfile.out],ebx - mcall 58,outfile + mcall 70,outfile ; dps 'Before Quit1' ; ud2 test [Flags],TAR_MODE @@ -385,7 +385,7 @@ else Msg 37 test [Flags],LIST_MODE jne quit - mcall 58,outfile + mcall 70,outfile .pad: call StartPad .notar: diff --git a/programs/other/archer/trunk/data.inc b/programs/other/archer/trunk/data.inc index 5f3bcf8c72..3526e00429 100644 --- a/programs/other/archer/trunk/data.inc +++ b/programs/other/archer/trunk/data.inc @@ -10,22 +10,30 @@ outfile: if SYS eq win db 'D:\Ivushkin\projects\zip\output.raw',0 end if - dd 1 + dd 2 + dd 0 dd 0 .size dd 0 .out dd output - dd os_work if ~SYS eq win dumpfile: db DUMPFILE,0 dumpf_len=$-dumpfile end if +attrinfo: + dd 5 + dd 0 + dd 0 + dd 0 + dd fileattr + db 0 + dd filename Finfo: dd 0 .block dd 0 - .count dd BUFSIZE*2 + dd 0 + .count dd BUFSIZE*1024 .ptr dd BUFPTR - dd os_work filename: if SYS eq win @@ -84,6 +92,10 @@ DKeys rd 3 Dheader rb 12 Dpassword rb PASSW_LEN +if ~SYS eq win +fileattr rd 40/4 +end if + png_ dd ? fat_ dd ? fat_fnum dd ? @@ -125,11 +137,15 @@ tblLen dw ? hclen db ? max_len dw ? +align 4 fat: rb 4096;512 child_stack: rb 1024 +child_stack_top: main_stack: + rb 1024 +main_stack_top: area: rb INBUF os_work rb 4*1024 diff --git a/programs/other/archer/trunk/dump.inc b/programs/other/archer/trunk/dump.inc index 6261f43b74..f9a6e21615 100644 --- a/programs/other/archer/trunk/dump.inc +++ b/programs/other/archer/trunk/dump.inc @@ -18,7 +18,7 @@ macro Dump ptr, len, workarea,run_new if ~ run_new eq test edx,edx jne .exist - mcall 19,Board_seek.board_fn,0 + mcall 70,Board_seek.board_fn,0 mov edx,eax mcall 5,20 end if @@ -51,5 +51,11 @@ Board_seek: .ok: mov edx,[ebx+30] ret -.board_fn db 'BOARD ' +.board_fn: + dd 7 + dd 0 + dd 0 + dd 0 + dd 0 + db '/RD/1/BOARD',0 end if diff --git a/programs/other/archer/trunk/macros.inc b/programs/other/archer/trunk/macros.inc index d290e9e09b..ab45d183d4 100644 --- a/programs/other/archer/trunk/macros.inc +++ b/programs/other/archer/trunk/macros.inc @@ -143,11 +143,6 @@ macro mcall a,b,c,d,e,f { ; mike.dld -; language for programs -lang fix ru ; ru en fr ge fi - - - ; optimize the code for size __regs fix @@ -179,7 +174,7 @@ macro sub arg1,arg2 macro mov arg1,arg2 { - if (arg1 in __regs) & (arg2 eqtype 0) + if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0')) if (arg2) = 0 xor arg1,arg1 else if (arg2) = 1 diff --git a/programs/other/archer/trunk/sys.inc b/programs/other/archer/trunk/sys.inc index c7d783365d..3543a060f7 100644 --- a/programs/other/archer/trunk/sys.inc +++ b/programs/other/archer/trunk/sys.inc @@ -18,8 +18,11 @@ if SYS eq win mov ebx,eax mov [filesize],eax else - mcall 58,Finfo + and dword [attrinfo+32], 0 + mcall 70,attrinfo + mov eax,[attrinfo+32] mov [filesize],ebx + mcall 70,Finfo end if ret @@ -37,10 +40,8 @@ FileSeek: ; esi - current pointer (in memory!) ; ebx - translation method: 0 - beginning, 1 - current, 2 - end push eax ecx edx - mov edx,[Finfo.block] - imul edx,BSIZE sub esi,BUFPTR - add esi,edx + add esi,[Finfo.block] cmp ebx,1 je .cur jb .begin @@ -49,21 +50,17 @@ FileSeek: .cur: add eax,esi .begin: - mov ecx,BSIZE - xor edx,edx - div ecx - lea esi,[BUFPTR+edx] + mov esi,BUFPTR mov [Finfo.block],eax if SYS eq win - mul ecx invoke SetFilePointer,[hnd],eax,NULL,FILE_BEGIN invoke ReadFile,[hnd],area,INBUF, os_work, NULL ; add [byte_count],area else ; pregs ; wait - mov [Finfo.count],BUFSIZE*2 - mcall 58,Finfo + mov [Finfo.count],BUFSIZE*1024 + mcall 70,Finfo ; mov [byte_count],area+INBUF end if pop edx ecx eax @@ -105,7 +102,7 @@ RunViewer: else test [Flags],THREAD_YES jnz .ex - mcall 51,1,thread,child_stack;MEMORY + mcall 51,1,thread,child_stack_top;MEMORY mov [child],eax end if .ex: @@ -249,75 +246,10 @@ macro CmdLine je .stay cmp al,'/' jne .yespar - mov ecx,255 dec esi - mov edi,filename - xor al,al - rep stosb mov ecx,255 mov edi,filename rep movsb -; test [Flags],LIST_MODE -; jz again - xor eax,eax - mov edi,filename - mov ecx,255 - repne scasb - cmp byte[edi-2],'/' - je .slash - mov byte[edi-1],'/' - inc edi - .slash: -; Dump filename,255,os_work -; ud2 - mov ecx,edi -; dec ecx - mov edx,ecx - mov dword[Finfo],13 -; mov dword[Finfo.count],1 - mov edi,filename+5 - sub ecx,edi - .lp: - mov al,'/' - repne scasb -; jne .ex -; dpd ecx - and byte[edi-1],0 - mcall 58,Finfo - mov byte[edi-1],'/' - test ebx,32 - jz .lp - test [Flags],LIST_MODE - jne .listm - and byte[edi-1],0 -; Dump filename,255,os_work - jmp .agg -; ud2 - .listm: - lea esi,[edi-1+ecx] - lea edi,[esi+1] - std - rep movsb - and byte[edi],0 - cld -; dpd filename - - inc edi - dpd edi - cmp edx,edi - jne .slash2 -; cmp byte[edi],'/' -; je .slash2 - mov byte[edi],'/' - inc edx - .slash2: - sub edx,edi - mov [lpath],edi - mov [lpath_len],edx - dpd edx - .agg: - mov dword[Finfo],0 -; ud2 jmp again;cmdl .yespar: cmp al,'N' diff --git a/programs/other/rtfread/trunk/bgifont.inc b/programs/other/rtfread/trunk/bgifont.inc index 7172d95349..c32527e35b 100644 --- a/programs/other/rtfread/trunk/bgifont.inc +++ b/programs/other/rtfread/trunk/bgifont.inc @@ -4,7 +4,7 @@ ; ; Created: December 16, 2004 ; -; Last changed: February 2, 2005 +; Last changed: August 27, 2006 ; ; Compile with FASM @@ -237,18 +237,16 @@ _BGIfont_Prepare: mov esi,edi ; esi->FontName mov [.dest],edi ; ptr to load font if ~ BGI_LEVEL eq KERNEL - mov [.fsize],1 - mov eax,58 + mov eax, 70 + mov ebx, .fontattr + int 0x40 + test eax, eax + jnz .fail + dps2 '1' + mov eax, [.fileattr+32] + mov [.fsize], eax mov ebx,.fontinfo - int 0x40 - test eax,eax - jnz .fail - dps2 '1' - shr ebx,9 - inc ebx - mov [.fsize],ebx - mov ebx,.fontinfo - mov eax,58 + mov eax,70 int 0x40 ; ebx - file size else push edi esi edx @@ -340,11 +338,22 @@ if ~ BGI_LEVEL eq KERNEL .fontinfo: dd 0 dd 0 + dd 0 .fsize dd 0 .dest dd 0 - dd 0x10000 +.fontfullname: db BGIFONT_PATH .font db 'FONT.CHR',0 + +.fontattr: + dd 5 + dd 0 + dd 0 + dd 0 + dd .fileattr + db 0 + dd .fontfullname +.fileattr rd 40/4 else .dest dd 0 .font db 'FONT CHR' diff --git a/programs/other/rtfread/trunk/rtf_lite.inc b/programs/other/rtfread/trunk/rtf_lite.inc index cdaf38db48..a0c5602785 100644 --- a/programs/other/rtfread/trunk/rtf_lite.inc +++ b/programs/other/rtfread/trunk/rtf_lite.inc @@ -14,10 +14,10 @@ read_block: mov ecx,[cur_block] mov ebx,fileinfo mov eax,ecx - shl eax,7 + shl eax,16 mov [ebx+4],eax ; mov [ebx+12],esi - mcall 58 + mcall 70 if DEBUG_BLOCK eq 1 ; dps 'B=' ; dpd ecx @@ -72,7 +72,7 @@ RtfParse: pop [RetroGroup] and [mode],not RTF_BLIND mov [listptr],save_stack - mov [fileinfo.size],128 + mov [fileinfo.size],128*512 ; test ebp,RTF_HELP test [mode],RTF_HELP jne .noread diff --git a/programs/other/rtfread/trunk/rtfread.asm b/programs/other/rtfread/trunk/rtfread.asm index f304977c35..6edde912b4 100644 --- a/programs/other/rtfread/trunk/rtfread.asm +++ b/programs/other/rtfread/trunk/rtfread.asm @@ -91,23 +91,17 @@ START: mov esi,fname_buf rep movsd load_file: - xor eax,eax - mov ebx,fileinfo - mov [ebx+4],eax - inc eax - mov [fileinfo.size],eax - mcall 58 - dpd ebx + mov eax, 70 + and [fileattr+32], 0 + mov ebx, attrinfo + int 0x40 + mov ebx, [fileattr+32] + test eax, eax + jz .sizok + mov dword [fileinfo.name], N_A +.sizok: and [wSave],0 mov [HClick],-100 - load_help: - test eax,eax - jz .sizok - cmp eax,5 - je .sizok - .nosizok: - mov dword[fileinfo.name],N_A - .sizok: mov eax,ebx and eax,RTFSIZE-1 add eax,I_END @@ -500,13 +494,22 @@ btn_text: db '< > L A C H' btn_end: +attrinfo: + dd 5 + dd 0 + dd 0 + dd 0 + dd fileattr + db 0 + dd fileinfo.name + fileinfo: dd 0 .block: dd 0 + dd 0 .size dd 1 dd I_END - dd sys_mem .name: ; db '//' ; db ' /HD/1/RTF/texts/FASM.TXT',0 @@ -549,6 +552,7 @@ end if I_END0: fname_buf: rb 1024+16 +fileattr rd 40/4 if BENCH eq 1 bench dd ? end if