From fc5e7644b9df30270c68f3648a44a28b482c434a Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Mon, 1 Oct 2018 18:19:57 +0000 Subject: [PATCH] Knight game: update by lev Palitra: save noisy state Game_center: use tricky binnary to save 4.5 Kb Mp3Info: upload version 0.7 git-svn-id: svn://kolibrios.org@7423 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/Tupfile.lua | 2 +- data/common/game_center | Bin 0 -> 430 bytes data/common/games/knight | Bin 3462 -> 3494 bytes data/common/wallpapers/deink.png | Bin 507 -> 495 bytes .../TinyGL/asm_fork/examples/gears.asm | 6 +- programs/media/mp3info/build.bat | 2 + programs/media/mp3info/mos_uzit.inc | 494 ++++++++++++ programs/media/mp3info/mp3info.asm | 701 ++++++++++++++++++ programs/media/mp3info/readme.txt | 97 +++ programs/media/palitra/trunk/palitra.asm | 110 +-- 10 files changed, 1357 insertions(+), 55 deletions(-) create mode 100644 data/common/game_center create mode 100644 programs/media/mp3info/build.bat create mode 100644 programs/media/mp3info/mos_uzit.inc create mode 100644 programs/media/mp3info/mp3info.asm create mode 100644 programs/media/mp3info/readme.txt diff --git a/data/Tupfile.lua b/data/Tupfile.lua index 1723933be8..371ca66955 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -16,6 +16,7 @@ img_files = { {"CONFIG.INC", PROGS .. "/config.inc"}, {"STRUCT.INC", PROGS .. "/struct.inc"}, {"FB2READ", "common/fb2read"}, + {"game_center", "common/game_center"}, {"ICONS32.PNG", "common/icons32.png"}, {"ICONS16.PNG", "common/icons16.png"}, {"INDEX.HTM", "common/index_htm"}, @@ -576,7 +577,6 @@ if tup.getconfig('NO_CMM') ~= 'full' then tup.append_table(img_files, { {"APP_PLUS", PROGS .. "/cmm/app_plus/app_plus.com"}, {"EASYSHOT", PROGS .. "/cmm/easyshot/easyshot.com"}, - {"GAME_CENTER", PROGS .. "/cmm/software_widget/software_widget.com"}, {"MOUSECFG", PROGS .. "/cmm/mousecfg/mousecfg.com"}, {"PANELS_CFG", PROGS .. "/cmm/panels_cfg/panels_cfg.com"}, {"SYSPANEL", PROGS .. "/cmm/software_widget/software_widget.com"}, diff --git a/data/common/game_center b/data/common/game_center new file mode 100644 index 0000000000000000000000000000000000000000..7cc223e147973ed6f9fe665900c2e7cc017484de GIT binary patch literal 430 zcmeZu^$T?kF)(CgU|>)I;w3=L5CFmJfP(7;85oYUZZZV26d4$rRks0I3=0*2#Nu5* zW(G(!;6)dZ|3Vq4e9=Cj;0seA%VF^W1oH@pDFhT}uxB&$ra+E2)51D|#GNAGRO3DYILy_Yt2bZ%wX;?BAVJf@WH%ICEZ0?{8)ef# zioOAqo*q~Q+~tQd9A_;buTKA`qlzGD$CiinXLwmIZ7Gp(8%CWyZan#mKHIZ7RSD*H z?dPlCa%TKRU^w(wYNLC)9NuLusD~6f$QZ2x+9=eAKWs2y7*E;=pB#Z}JvX1iAX_bI zS=V+LKqAId68on$iltXL-T+(_FW$P zH;*Sj=ZUE?yj8m$rh>2}kV6?&#)TX1l>ZKp?R&@&gy3-#!GH#%s;08;vO~vrb!3)s zQ9a((Idry!V=G(MR^>mdKKvnmCTTY2(+{g0htCw5od>>zSBz?Rb4)8&HHV8 zSG-pqq$T%mtPG0STZU5WxfFfF&qm8%%904*2?DD$UvkXC|Q!k!M{!MDIt@S`A`H88ux%k>h}< zO`1(Fzm0Av+Lt~+!iq+oec^@XFtS^mSwi;;Yso3j0W&PP8vy3ne%a*i#bzC=v4>}_ z`w9Z>W@rK^YNGfdTA)<&muLjx+O$?aQnVcTZhE)=0u$DGZ&;QRo{k_`8zu3e95L87 zc%GZk4+HWaR!+1U!e5(VA2+J-f&Iwl*dKMiPk9n?p&k_$NqWusN=l%dQ|svet7Hf> ze6xA)(E6mkv;fS@zyJK{jEr+nC4|#Q1zbp8n!~(+bi-xPr%-^#QM0U>T0N=3Aga^4 z$skjVDieoC(OgCXbKsS2@GY5uQUh4ku)Y4D`I@Ult(pSk>nTV%ckDEw$CK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z+{Pk&bYuEKTjPFO4~NypS}3yJqa;YVb){3Ixz1%mjcN4B$MdMH-T}PrjopfTDaU?O zmy~GOeyhHAa#({$A`W`I1`y;QBUJ1=@iRW~I`qs(f?|H2Y^+m4bcWARyMlHW0FG-_ zPP6%;u+6^=_Znf$!r8?LU|-<&i<8?z4xmr~c}^w2y)lN7K8BifhMQ{JEHo8>XDuAq zhp}UfGw$fqhp(Vc`tD>;kSS@2T}Cw$BjW?h?7Tn4u`W$fvc~elO6%Rd=Z5bzDy`(| o!=-GLz@2U9j086m!ZnC_Mt4WXmrP~X|CEul|2vZaEdT%j0ANe4P5=M^ diff --git a/data/common/wallpapers/deink.png b/data/common/wallpapers/deink.png index 1619aa37479a3cc98950734961c88ee7c24583b0..162dd5718ad6fe9daa9a89a443f422b299e0af0c 100644 GIT binary patch delta 482 zcmV<80UiGP1MdTn7k?cH0ssI27g#lY8$!;{*8oRh>Hg^!ZDqY*Oe# zjb4_TPs0kylt~iN05r&;!>}14iQNrU6(i_KMKXdCx(TYPBY$b9!jvhox=nP)>UN}* zh!jZy#fmCVvW!T{l86S0>h>zf6q*!4iQRw@)s=0hXxbtHU`Qxbwv}>HmdFOk>OxF< z+f`T+x=}(kYL%UOKPJ%_Le+nWWQHi9!J&7E)Rc@6NdVO7))?V1B9!q~0vT1SO=l>L zDIl`C7ox1y<$pA$;3g!p0F67=-bPAcXwss{BnMMnD3uge|>mfY_usOWPz0kl^X#Tq{bN+036zG*H${}$yaAB3PF_j}72O||O+|$zvN3pRE zLUj`8Y0u(Sya*>Ty8{Qy;%45go75eVj2hf-;$3{Wsn3}>bOAhwmo?F|hR6%TH^fVL z4GwWxx7@fOK7S+pShrVH7bB}!^EZ}=zY2*e(UA}aG*h?xUv2lR?g}&zdkh-)tOm0x zi;>KOc3|4@pe*vK3J^<61?Hi1&YYRh6ze1tLEGH}Z?%bolyOlIIyx z@K&Gsb1An6!~gx~onTdPv7SJ1_{MmwhZn=Y?2gVC_jJ&{mRWPw~t^NG}trE|{2n3dIll)Q6n5~OFSnri<9 kbE4KHgq2vRy`pR;e``n7k8wd-S^xk507*qoM6N<$f(#4ovj6}9 diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/gears.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/gears.asm index 18b7b19f4b..035e1c772e 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/gears.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/gears.asm @@ -70,7 +70,7 @@ align 16 still: call draw_3d - stdcall Fps, 330,4 + stdcall Fps, 365,4 mov dword[esp-4],eax fild dword[esp-4] fmul dword[a2] @@ -130,11 +130,11 @@ draw_window: pushad mcall SF_REDRAW,SSF_BEGIN_DRAW - mcall SF_CREATE_WINDOW,(50 shl 16)+410,(30 shl 16)+425,0x33404040,,title1 + mcall SF_CREATE_WINDOW,(50 shl 16)+409,(30 shl 16)+425,0x33404040,,title1 stdcall [kosglSwapBuffers] ;Title - mcall SF_DRAW_TEXT,(300 shl 16)+4,0xc0c0c0,fps, fps.end-fps + mcall SF_DRAW_TEXT,(338 shl 16)+4,0xc0c0c0,fps, fps.end-fps mcall SF_DRAW_TEXT,(8 shl 16)+4,0xc0c0c0,title3,title3.end-title3 ;mcall SF_DRAW_TEXT,(180 shl 16)+4,0xc0c0c0,title2,title2.end-title2 diff --git a/programs/media/mp3info/build.bat b/programs/media/mp3info/build.bat new file mode 100644 index 0000000000..bead59fd2f --- /dev/null +++ b/programs/media/mp3info/build.bat @@ -0,0 +1,2 @@ +@fasm -m 16384 mp3info.asm mp3info +@pause \ No newline at end of file diff --git a/programs/media/mp3info/mos_uzit.inc b/programs/media/mp3info/mos_uzit.inc new file mode 100644 index 0000000000..d39976865b --- /dev/null +++ b/programs/media/mp3info/mos_uzit.inc @@ -0,0 +1,494 @@ +;--------------------; +; MACROS.INC ; +;--------------------; + +macro __mov reg,a { ; mike.dld + if ~a eq + mov reg,a + end if +} + +macro mcall a,b,c,d,e,f { ; mike.dld + __mov eax,a + __mov ebx,b + __mov ecx,c + __mov edx,d + __mov esi,e + __mov edi,f + int 0x40 +} + +;--------------------; +; ASCL.INC ; +;--------------------; + +macro words2reg reg,hiword,lowword +{ +if hiword eq + if lowword eq + ; not changes + else + if lowword eqtype 12 + and reg,dword 0xffff0000 + add reg,dword lowword + else + and reg,dword 0xffff0000 + add reg,dword lowword + end if + end if +else + if lowword eq + if hiword eqtype 12 + and reg,dword 0x0000ffff + add reg,dword hiword*65536 + else + shl reg,16 + add reg,dword hiword + ror reg,16 + end if + else + if lowword eqtype 12 & hiword eqtype 12 + if lowword eq 0 & hiword eq 0 + xor reg,reg + else + mov reg,dword hiword*65536+lowword + end if + else + mov reg,dword hiword + shl reg,16 + add reg,dword lowword + end if + end if +end if +} + +;--------------------; +; MOSUZIT.INC ; +;--------------------; + +;WriteTextToWindow +macro Text xStart,yStart,rgbColor,pText,nTextLen +{ + words2reg ebx, xStart, yStart + mov ecx, rgbColor + mov edx, pText + mov esi, nTextLen + mov eax, 4 + int 0x40 +} + +;DisplayNumber +macro Number xStart,yStart,nPrintType,noOfDigits,Data,rgbColor +{ + words2reg edx,xStart,yStart + words2reg ebx,noOfDigits,nPrintType + mov ecx,Data + mov esi,rgbColor + mov eax,47 + int 0x40 +} + +macro DrawLine xStart,xEnd,yStart,yEnd,rgbColor +{ + words2reg ebx,xStart,xEnd + words2reg ecx,yStart,yEnd + mov edx,rgbColor + mov eax,38 + int 0x40 +} +;******************************************************** +macro Extracteax temp,fromBit,bitCount,dest +{ + mov temp, eax + shr temp, fromBit + and temp, (1 shl bitCount - 1) + mov dest, temp +} +;******************************************************** +;********* AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM ********* +;******************************************************** +extract_bits: ;11xA is sync +;Defined as the following: +; b1s ; standard +; b1l ; layer +; crc ; CRC protection + +; Bita ; Bitrate +; sam ; Sampling rate +; pad ; Padding +; priv ; Private bit + +; shan ; Channel mode +; modx ; Mode extention +; copy ; Copyright +; orig ; Original +; emph ; Emphasis + +;--------------------- Standard (BB) +Extracteax ebx, 11, 2, [b1s] +;--------------------- Layer (CC) +Extracteax ebx, 9, 2, [b1l] +;--------------------- CRC (D) +Extracteax ebx, 8, 1, [crc] +;--------------------- Bitrate (EEEE) +Extracteax ebx, 20, 4, [Bita] +;--------------------- Sample Rate (FF) +Extracteax ebx, 18, 2, [sam] +;--------------------- padding (G) +Extracteax ebx, 17, 1, [pad] +;--------------------- Private bit (H) +Extracteax ebx, 16, 1, [priv] +;--------------------- Channels (II) +Extracteax ebx, 30, 2, [shan] +;--------------------- Mode ext (JJ) +Extracteax ebx, 28, 2, [modx] +;--------------------- Copyright (K) +Extracteax ebx, 27, 1, [copy] +;--------------------- Original (L) +Extracteax ebx, 26, 1, [orig] +;--------------------- Emphasis (MM) +Extracteax ebx, 24, 2, [emph] + +ret +;******************************************************** +decode_standard: + +comp0: +cmp [b1s], 00b +je S25 + +comp1: +cmp [b1s], 01b ; unknown +je S25 + +comp2: +cmp [b1s], 10b +je S20 + +comp3: +cmp [b1s], 11b +je S10 + +jmp S000 + +;----- + +S25: +mov [S1], 2 +mov [S2], 5 +mov [id], 3 ;lowest freq +jmp S000 + +S20: +mov [S1], 2 +mov [S2], 0 +mov [id], 2 ;low freq +jmp S000 + +S10: +mov [S1], 1 +mov [S2], 0 +mov [id], 1 ;hi freq +jmp S000 + +S000: + +ret + +;******************************************************** + +decode_layer: + +com0: +cmp [b1l], 00b +je L3 ; unknown + +com1: +cmp [b1l], 01b +je L3 + +com2: +cmp [b1l], 10b +je L2 + +com3: +cmp [b1l], 11b +je L1 + +jmp L000 + +;----- + +L3: +mov [La], 3 +jmp L000 + +L2: +mov [La], 2 +jmp L000 + +L1: +mov [La], 1 +jmp L000 + +L000: + +ret + +;******************************************************** + +decode_channels: + +co0: +cmp [shan], 00b +je C4 + +co1: +cmp [shan], 01b +je C3 + +co2: +cmp [shan], 10b +je C2 + +co3: +cmp [shan], 11b +je C1 + +jmp C000 + +;----- +C4: +mov [K], 4 ;00=Stereo +jmp C000 + +C3: +mov [K], 3 ;01=Joint stereo +jmp C000 + +C2: +mov [K], 2 ;10=Dual Channel +jmp C000 + +C1: +mov [K], 1 ;11=Single Channel (Mono) +jmp C000 + +C000: + +ret +;******************************************************** +;-------------------------- +; decode_samplerate +;-------------------------- +decode_samplerate: + push eax + push ecx + + mov eax, [sam] + mov eax, [freq + eax*4] + mov ecx, [b1s] + cmp cl, 01 ; bad frequency + jnz ok + +ok: + cmp cl, 0 + jz @f + dec cl +@@: + shl eax, cl + mov [SR], eax + + pop ecx + pop eax +ret + +;******************************************************** +;-------------------------- +; decode_bitrate +;-------------------------- +decode_bitrate: + push eax + push ebx + mov eax,[b1s] + and eax,1 + shl eax,4 + lea eax,[eax*3] + mov ebx,[b1l] + dec ebx + shl ebx, 4 + add eax, ebx + add eax,[Bita] + movzx eax,byte[Bitrate+eax] + shl eax,3 + mov [BR],eax + pop ebx + pop eax +ret + +;******************************************************** + +calculate_time_frame_count: + +;----------------------------duration +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx + +mov ebx, dword[BR] +imul ebx, 125 +; result in ebx + + +mov eax, dword[size] + +div ebx + + +mov dword[time], eax +;---------------------------frame size + +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx + +cmp [S1], 1 +je MP1 +cmp [S1], 2 +je MP2 + +MP1: + +mov eax, dword [BR] +imul eax, 144000 +; result in eax + + +mov ebx, dword[SR] + +div ebx + +add eax, dword [pad] + +mov dword[frames], eax + +jmp exx + +MP2: + +mov eax, dword [BR] +imul eax, 72000 +; result in eax + + +mov ebx, dword[SR] + +div ebx + +add eax, dword [pad] + +mov dword[frames], eax + +exx: +;--------------------------quantity of frames +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx + +mov eax, dword[size] +mov ebx, dword[frames] +div ebx +mov dword[framecount], eax + +ret + +;-------------------------- +; header_check +; eax = проверяемый заголовок +;-------------------------- +Header_Check: + + push ebx + mov ebx, eax + + ; Проверяем 11 бит в начале фрейма + and eax, 0E0FFh + cmp eax, 0E0FFh + jnz bad + + ; Проверяем версию MPEG + mov eax, ebx + and eax, 1800h + cmp eax, 0800h + jz bad + + ; Проверяем layer + mov eax, ebx + test eax, 0600h + jz bad + + ; Проверяем битрейт + mov eax, ebx + and eax, 0F00000h + cmp eax, 0F00000h + jz bad + test eax, eax + jz bad + + ; Проверяем частоту + mov eax, ebx + and eax, 0C0000h + cmp eax, 0C0000h + jz bad +.end_test: + xor eax, eax + pop ebx + ret + +bad: + mov eax, 1 + pop ebx + ret + + +;=========================== +Win2Dos: +;=========================== + jcxz .no_chars + push esi + push edi + push ecx + mov edi, esi + cld +.next_char: + lodsb + cmp al, 0xC0 + jae .rus + cmp al, 0xA8 + jnz @f + mov al, 0xF0 +@@: + cmp al, 0xB8 + jnz @f + mov al, 0xF1 +@@: + jmp .char_ready +.rus: + cmp al, 0xF0 + jae @f + sub al, 48 +@@: + sub al, 16 +.char_ready: + stosb + dec ecx + jnz .next_char + + pop ecx + pop edi + pop esi +.no_chars: + ret \ No newline at end of file diff --git a/programs/media/mp3info/mp3info.asm b/programs/media/mp3info/mp3info.asm new file mode 100644 index 0000000000..d5dd2739e0 --- /dev/null +++ b/programs/media/mp3info/mp3info.asm @@ -0,0 +1,701 @@ +; AUTHORS: +; S. Kuzmin, A. Ershov, Madis Kalme 2005 +; Sergey Efremenkov, Leency 2018 + +; CHECK OUT README.TXT! + +format binary as "" + + use32 + org 0x0 + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; start of code + dd I_END ; size of image + dd 0x9000 ; memory for app + dd 0x9000 ; esp + dd fileinfo2.path ; I_Param , I_Icon + dd 0x0 + +include "mos_uzit.inc" + +TAG1_X = 250 ; coordinates of ID3v1 block +TAG1_Y = 40 + +BLOCKS_TO_READ equ 2 ; must be greater than 1 +BLOCK_SIZE equ 512 ;сколько байт в блоке + +START: + + xor eax, eax + mov [last_err], eax + mov [fileinfo2+4], eax ; start block = 0 + mov dword [fileinfo2+12], BLOCKS_TO_READ*BLOCK_SIZE + mcall 70, fileinfo2 + +result: + push eax ebx ;получаем размер файла в байтах + mcall 70, fileSizeInfo + + cmp eax, 0 + je @f + mov dword[size], 16384; ebx + jmp result.sizeEnd +@@: + mov eax, dword[fileBuf+32] ; на самом деле там размер 8 байт, а не 4 + mov dword[size], eax +.sizeEnd: + pop ebx eax + ;mov dword [size], 16384; ebx + + ; checking ID3v2 tag + xor eax, eax + mov [tagv2], eax + mov eax, [mp3_file] + and eax, 0x00ffffff + cmp eax, 'ID3' + jnz .no_id3v2 + mov eax, [mp3_file+3] + mov [tagv2], eax + + mov ecx, 4 + mov esi, mp3_file+6 + xor eax, eax + xor ebx, ebx + cld +.size_read: + lodsb + shl ebx, 7 + or ebx, eax + loop .size_read + add ebx, 10 + mov eax, ebx + shr eax, 9 + + push eax edx + mov edx, BLOCK_SIZE + mul edx + mov dword[fileinfo2+4], eax ; start block + pop edx eax + + shl eax, 9 + + mov ecx, ebx + add ecx, 3 + + sub ebx, eax + mov edi, ebx + add edi, mp3_file + dec edi + + mcall 70, fileinfo2 + + jmp .loop +.no_id3v2: + + mov ecx, 3 + mov edi, mp3_file-1 +.loop: + inc edi + inc ecx + cmp ecx, dword[size] + ja .no_frames + mov eax, [edi] + call Header_Check + test eax, eax + jz .header_found + cmp edi, mp3_file+BLOCKS_TO_READ*512-4 + jb .loop + + add dword [fileinfo2+4], (BLOCKS_TO_READ-1)*BLOCK_SIZE + + mcall 70, fileinfo2 + + sub edi, (BLOCKS_TO_READ-1)*512 + jmp .loop + +.no_frames: + mov [last_err], err_bad_file + mov [last_err_l], err_bad_file_e - err_bad_file + jmp reading_end + +.header_found: +mov eax, dword [edi] +sub ecx, 4 +mov [header_at], ecx + + +call extract_bits + +call decode_standard + +call decode_layer + +call decode_channels + +call decode_samplerate + +call decode_bitrate + +call calculate_time_frame_count + +;-------------------------------------------- + + mov eax, [b1s] + and eax, 1 + shl eax, 1 ; eax = eax * 2 + cmp byte [shan], 11b ; if mono + jz @f + inc eax +@@: + mov ebx, xing_offset + xlatb + + add edi, eax + mov eax, [edi] + + xor ebx, ebx + mov [xing_tag], ebx + cmp eax, 'Xing' + jnz .no_xing_tag + mov esi, edi + add esi, 15 + std + mov edi, xing_bytes + mov ecx, 3*4 + xor eax, eax + +.xing_read: + lodsb + mov [edi], al + inc edi + loop .xing_read + cld + mov ebx, [xing_tag] + test ebx, 1 + jz .frames_end + mov eax, [xing_frames] + mov [framecount], eax + test [b1s], 1 ; if MPEG 1 eax = eax*2 + jz @f + shl eax, 1 +@@: + mov ebx, 575 + mul ebx ; edx:eax = eax*575 + mov ebx, [SR] + div ebx ; eax = edx:eax / sample rate + + mov [time], eax + + ; calculating bitrate + xor edx, edx + mov ebx, 1000 / 8 + mul ebx ; edx:eax = time * 1000 + mov ebx, eax + mov eax, [xing_bytes] + div ebx ; eax = size / time*1000 + mov [BR], eax + + +.frames_end: + + +.no_xing_tag: + +xor eax, eax +xor ebx, ebx +xor ecx, ecx +xor edx, edx +; ID3v1 tag reading + mov eax, [size] ; reading 2 last 512-byte blocks where our + mov ebx, eax ; tag may be + shr eax, 9 ; eax = size of file in full 512-byte blocks + test eax, eax ; if file's length is less then 512 we'll + jz @f ; read the whole file + dec eax +@@: + push eax edx + mov edx, BLOCK_SIZE + mul edx + mov dword [fileinfo2+4], eax ; start block + pop edx eax + mov dword [fileinfo2+12], 2*BLOCK_SIZE ; blocks to read + + shl eax, 9 + sub ebx, eax + add ebx, mp3_file - 128 ; if tag is present, ebx points to it + mov esi, ebx + + xor eax, eax + mov [tag], eax + + + mcall 70, fileinfo2 + + mov eax, [esi] ; checking if tag is present + and eax, 0x00ffffff + cmp eax, 'TAG' + jnz @f + inc [tag] + cld + mov ecx, 128 / 4 + mov edi, tag.data + rep movsd + mov esi, tag.data + mov ecx, 126 + call Win2Dos +@@: +reading_end: + call draw_window ; 14.08.05 [ + + + ; Цикл получения и обработки сообщений + get_event: + mov eax,10 + int 0x40 + dec eax + jnz @f + call draw_window + jmp get_event +@@: + dec eax + jz key_on_keyboard + dec eax + jz click_on_button + jmp get_event + + key_on_keyboard: + mcall 2 + jmp get_event + + click_on_button: + exit: + mcall 17 + ;cmp ah, 10 + ;jz other_file + + mov eax,-1 + int 0x40 + + jmp get_event ; ] 14.08.05 + + ; Рисование окна +draw_window: + mcall 12,1 + mov eax,0 ; function 0 : define and draw window + mov ebx,250 shl 16 + 500 + mov ecx,250 shl 16 + 300 + mov edx,0x34aabbcc ; color of work area RRGGBB,8->color gl + mov edi, header + int 0x40 + + Text 20,12,0x00000000,choice, choicelen-choice + Text 110,12,0x00000000,fileinfo2.path, 60 + + mov edx, dword [last_err] + test edx, edx + jz .no_err + mov eax, 4 + mov ebx, 50*65536+50 + xor ecx, ecx + mov esi, [last_err_l] + int 0x40 + jmp draw_end +.no_err: + + Text 20,40,0x00000000,S, Slen-S + Number 110,40,1*256,1,dword [S1],0x000000; + Number 122,40,1*256,1,dword [S2],0x000000; + + Text 20,60,0x00000000,L, Llen-L + Number 110,60,1*256,1,dword [La],0x000000 + + Text 20,100,0x00000000,SamR, SamRlen-SamR + Number 110,100,0*256,5,dword [SR],0x000000 + + Text 20,120,0x00000000,BitR, BitRlen-BitR + Number 110,120,0*256,3,dword [BR],0x000000 + + mov eax, [xing_tag] + test eax, eax + jz @f + Text 170,120,0x00000000,vbr, vbr_e - vbr +@@: + + Text 20,140,0x00000000,Sizebyte, Sizebytelen-Sizebyte + Number 110,140,0*256,8,dword [size],0x000000 + + Text 20,160,0x00000000,Timese, Timeselen-Timese + Number 110,160,0*256,4,dword [time],0x000000 + + Text 20,180,0x00000000,frame, framelen-frame + Number 110,180,0*256,4,dword [frames],0x000000 + + Text 20,200,0x00000000,framcount, framcountlen-framcount + + Text 20,220,0x00000000,padding, paddinglen-padding + + cmp [pad], 1 + je res1 + jne res2 + + res1: + Text 75,220,0x00000000,da, dalen-da + jmp nex + res2: + Text 75,220,0x00000000,net, netlen-net + jmp nex + + nex: + + ; ------------------ + + + Text 110,220,0x00000000,crci, crcilen-crci + + cmp [crc], 0 + je res3 + jne res4 + + res3: + Text 160,220,0x00000000,da, dalen-da + jmp ne + res4: + Text 160,220,0x00000000,net, netlen-net + jmp ne + + ne: + + ;-------------------------- + + Number 110,200,0*256,6,dword [framecount],0x000000 + + + Text 20,80,0x00000000,Ka, Kalen-Ka + + cmp [K], 1 + je rez1 + cmp [K], 2 + je rez2 + cmp [K], 3 + je rez3 + cmp [K], 4 + je rez4 + + rez1: + Text 110,80,0x00000000,SC, SClen-SC + jmp next + rez2: + Text 110,80,0x00000000,DC, DClen-DC + jmp next + rez3: + Text 110,80,0x00000000,JOS, JOSlen-JOS + jmp next + rez4: + Text 110,80,0x00000000,Su, Sulen-Su + +next: + Text 20,240,0,header_found, header_found_e - header_found + Number 160,240,0*256,6,dword [header_at],0x000000 ;;;;;;; HEADER AT + + + + ; ID3v2 + + mcall 4, 250*65536+220, 0,id3v2, id3v2_e - id3v2 + mov edi, tagv2 + mov eax, [edi] + test eax, eax + jz .no_v2 + mcall 4, 281*65536+220, ,dots, dots_e - dots + xor ecx, ecx + mov cl, byte [edi] + mcall 47, 65536*2, , 286*65536+220, 0 + mov cl, byte [edi+1] + mcall , , , 304*65536+220, + + jmp .v2_end +.no_v2: + Text 300,220,0,net, netlen- net +.v2_end: + + + + ; ID3v1 info + ; Writing all field names + mov eax, 4 ; function 4 + words2reg ebx, TAG1_X, TAG1_Y + xor ecx, ecx ; color + mov edx, id3v1 + mov esi, id3v1_e - id3v1 + int 0x40 + + add ebx, 40 + mov edx, title ; length is the same, so we don't write it in esi + int 0x40 + + add ebx, 20 + mov edx, artist + inc esi + int 0x40 + + add ebx, 20 + mov edx, album + dec esi + int 0x40 + + add ebx, 20 + mov edx, year + dec esi + int 0x40 + + add ebx, 20 + mov edx, genre + inc esi + int 0x40 + + add ebx, 20 + mov edx, comment + inc esi + inc esi + int 0x40 + + sub ebx, 120 + mov edx, track + int 0x40 + + ; checking if tag is + mov eax, dword [tag] + test eax, eax + jz .no_tag1 + + mov edi, tag.data + + ; writing walues + words2reg edx, (TAG1_X+50), (TAG1_Y+20) + + ; track number uses the 30-th byte of comment field + ; it may be the last char in comment field + ; so we check if this byte presents a track number + mov eax, [edi+125] + test al, al + jnz .no_track + test ah, ah + jz .no_track + + mov ebx, 3*65536 + xor ecx, ecx + mov cl, ah + xor esi, esi + mov eax, 47 + int 0x40 + +.no_track: + mov ebx, edx + mov edx, edi + mov eax, 4 ; function 4 + xor ecx, ecx ; color + + add ebx, 20 + add edx, 3 + mov esi, 30 + int 0x40 ; title + + add ebx, 20 + add edx, esi + int 0x40 ; artist + + add ebx, 20 + add edx, esi + int 0x40 ; album + + add ebx, 60 + add edx, 34 + dec esi + int 0x40 ; comment + + sub ebx, 40 + mov esi, 4 + sub edx, esi + int 0x40 ; year + +.no_tag1: +draw_end: + mcall 12, 2 +ret ; (!) 14.08.05 + + freq dd 11025, 12000, 8000 + Bitrate db 0,1,2, 3, 4, 5, 6, 7, 8,10,12,14,16,18,20,0,\ ; v2 l2 l3 + 0,1,2, 3, 4, 5, 6, 7, 8,10,12,14,16,18,20,0,\ ; v2 l2 l3 + 0,4,6, 7, 8,10,12,14,16,18,20,22,24,28,32,0,\ ; v2 l1 + 0,4,5, 6, 7, 8,10,12,14,16,20,24,28,32,40,0,\ ; v1 l3 + 0,4,6, 7, 8,10,12,14,16,20,24,28,32,40,48,0,\ ; v1 l2 + 0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,0 ; v1 l1 + xing_offset db 13, 21, 21, 36 +header: + db 'MP3 Info 0.7',0 + +S: + db 'MPEG Version: . ' +Slen: + +L: + db 'Layer: ' +Llen: + +Ka: + db 'Channels Mode: ' +Kalen: + +Su: + db 'Stereo' +Sulen: + +JOS: + db 'Joint stereo ' +JOSlen: + +DC: + db 'Dual channel' +DClen: + +SC: + db 'Single Channel (Mono)' +SClen: + +SamR: + db 'Sample Rate: Hz' +SamRlen: + +BitR: + db 'BitRate: Kbps' +BitRlen: + +Sizebyte: + db 'Size: bytes' +Sizebytelen: + +Timese: + db 'Time: seconds' +Timeselen: + +frame: + db 'Frame size: bytes' +framelen: + +framcount: + db 'Quantity: frames' +framcountlen: + +padding: + db 'Padding:' +paddinglen: + +crci: + db 'CRC:' +crcilen: + +da: + db 'yes' +dalen: + +net: + db 'no' +netlen: +dots db '. .' +dots_e: + +header_found db 'Header found at:' +header_found_e: + +choice: + db 'File path: ' +choicelen: +id3v2 db 'ID3v2' +id3v2_e: +vbr db '(VBR)' +vbr_e: +id3v1 db 'ID3v1' +id3v1_e: +track db 'Track #' +track_e: +title db 'Title' +title_e: +artist db 'Artist' +artist_e: +album db 'Album' +album_e: +year db 'Year' +year_e: +genre db 'Genre' +genre_e: +comment db 'Comment' +comment_e: + +err_bad_file db 'Bad file' +err_bad_file_e: + +fileinfo2: + .func dd 0 ;номер подфункции + .start dd 0*BLOCK_SIZE ;позиция в файле (в байтах) *512 + dd 0 ;(зарезервировано под старший dword позиции) + .size dd 1*BLOCK_SIZE ;сколько байт читать + .buf dd mp3_file ;указатель на буфер, куда будут записаны данные + .path: + db "TEST.MP3",0 ;"/RD/1/TEST.MP3",0 + rb 256-($-.path) + + +;для получения корректного размера файла +fileSizeInfo: +dd 5 ; номер подфункции +dd 0,0,0 ;(зарезервировано) +dd fileBuf ;указатель на буфер, куда будут записаны данные(40 байт) +db 0 +dd fileinfo2.path + +fileBuf: db 40 dup(0) + + +;================================================= + b1s dd ? ; standard + b1l dd ? ; layer + S1 dd ? + S2 dd ? + La dd ? + shan dd ? + K dd ? + sam dd ? + id dd ? + SR dd ? + Bita dd ? + BR dd ? + size dd ? + time dd ? + frames dd ? + + xing_bytes dd ? + xing_frames dd ? + xing_tag dd ? + + tagv2 dd ? + tag dd ? + .data rb 128 + framecount dd ? + pad dd ? + priv dd ? + modx dd ? + copy dd ? + orig dd ? + emph dd ? + crc dd ? + header_at dd ? + last_err dd ? + last_err_l dd ? + + +I_END: + +;label pre_file dword at 0x3000-4 +label mp3_file dword at 0x3000 + diff --git a/programs/media/mp3info/readme.txt b/programs/media/mp3info/readme.txt new file mode 100644 index 0000000000..3cd2b797a3 --- /dev/null +++ b/programs/media/mp3info/readme.txt @@ -0,0 +1,97 @@ +;****************************************************************************** +; project name: SuperMP3 +; target platform: MenuetOS, x86 (IA-32), x86-64 achitectures +; compiler: flat assembler 1.64 +; version: 0.65 +; last update: 5th September 2005 +; maintained by: Sergey Kuzmin aka Wildwest +; e-mail: kuzmin_serg@list.ru +;****************************************************************************** +; Summary: +; initial reader for mp3's headers +; can read mostly needed parts from headers of almost all mp3 files +; can be used in tag editor, mp3 player or converter later +; License: GPL & LGPL +;****************************************************************************** + +;-------------------------------------------------------------------------------------- +;HISTORY: + +;0.7: MP3INFO 23/09/2018 + Sergey Efremenkov aka theonlymirage + adopted app to use system f70 instead of old f58 + Kiril Lipatov aka Leency make app to open with param, small UI update + +;0.65: SuperMP3 + Madis Kalme rewrited extract_bits (he used his Extracteax macro) + and decode_bitrate functions + +;0.64: Xing header reading: correct time, bitrate and number of + frames for VBR files +;0.62: ID3v2 detecting and writing its version +;0.61: Header search +; Added 'Header found at' field +; If file has no frames, error message is shown +; Russian tag support (in windows-1251 encoding) +; +;0.6: SuperMP3 (not finished and its future in the dark) 19/08/2005 +;Author: Sergey Kuzmin aka Wildwest +;Additions: Alexei Ershov aka ealex +;Features: added checking of CRC bit; +; improved frame_size calculation (thanks to Alexei Ershov for the formula) +; added ID3v1 tag reading (except Genre field) by Alexei Ershov +;-------------------------------------------------------------------------------------- +;0.5: SuperMP3 17/08/2005 +;Author: Sergey Kuzmin aka Wildwest +;Additions: Alexei Ershov aka ealex +;Features: added checking of Padding bit; +; Added open dialog and optimized macroses Text, Number, DrawLine by Alexei Ershov +;-------------------------------------------------------------------------------------- +;0.4: SuperMP3 05/08/2005 +;Author: Sergey Kuzmin aka Wildwest +;Additions: Alexei Ershov aka ealex +;Features: added Frame_size and Quantity_of_Frames; +; optimized decode_samplerate and decode_bitrate routines by Alexei Ershov +;-------------------------------------------------------------------------------------- +;0.3: SuperMP3 25/04/2005 +;Author: Sergey Kuzmin aka Wildwest +;Features: added File_size and Duration (rough estimation), improved SampleRate, fixed BitRate +;-------------------------------------------------------------------------------------- +;0.2: SuperMP3 21/04/2005 +;Author: Sergey Kuzmin aka Wildwest +;Features: added SampleRate and BitRate +;-------------------------------------------------------------------------------------- +;0.1: SuperMP3 20/04/2005 +;Author: Sergey Kuzmin aka Wildwest +;Features: able to detect MPEG Version, Layer, Channels +;---------------------------------------------------------------------------------------- +;Issues: +; MP3 player needs work of several men during several months(approx. 10 men and 2-4 months, because it is ASM OS). +; If you want to listen a lot of mp3 in MenuetOS - make a bit of asm! +;----------------------------------------------------------------------------- +;CLEAN mp3 - is mp3 file without any info before header. Open mp3 in HEX EDITOR and check it out. + +;Usually normal header's start looks like FFF3 or FFFB. + +;If you see TAG (4944 3303 = ID3.) or RIFF (5249 4646 = RIFF) +;or (0000 0000 - encoded by Lame codec or another shitty program) - it is bad, +;you must delete this piece until FFFx before testing. Happy testing! + +;Note - I test it only on several files (test.mp3 +;included in this package) in Bochs and Qemu. +;For testing change name if the end of "supermp3.asm" - section + fileinfo: + dd 0, 0, 1, mp3_file, 0x1000 + db "/RD/1/TEST.MP3",0 + +Package content: +readme.txt - this file +supermp3 - compiled exacutable file +supermp3.asm - main file - build program's GUI +MACROS.INC - standard file with macroses +MOS_UZIT.INC - macroses for interface, routines for extracting bits and decoding extracted bits +ASCL.INC - macroses for interface and useful stuff +test.mp3 - test file + +Any comments by e-mail or on forums (http://meos.sysbin.com, http://forum.meos.ru, http://menuetos.fastbb.ru, +http://menuet.2.forumer.com, http://board.flatassembler.net/forum.php?f=12) are appreciated. \ No newline at end of file diff --git a/programs/media/palitra/trunk/palitra.asm b/programs/media/palitra/trunk/palitra.asm index dcd8dd650d..ca227ce213 100644 --- a/programs/media/palitra/trunk/palitra.asm +++ b/programs/media/palitra/trunk/palitra.asm @@ -452,57 +452,7 @@ set_background: ; Џ®¤дг­ЄжЁп 3 - ЇҐаҐаЁб®ў вм д®­. mcall SF_BACKGROUND_SET,SSF_REDRAW_BG - ;save to file eskin.ini - xor al,al - mov ecx,1024 - mov edi,sys_path+2 - repne scasb - sub edi,sys_path+3 - invoke ini_set_str, inifileeskin, amain, aprogram, sys_path+2, edi - ;add param 'H ' - mov word[params],'H ' - mov eax,[color] - or eax,0xf ;¤«п Ё§ЎҐ¦ ­Ёп ўҐз­®Ј® жЁЄ«  Ґб«Ё eax=0 - mov edi,params+2 - @@: - rol eax,8 - or al,al - jnz @f - mov word[edi],'00' ;­г«Ё ЇҐаҐ¤ зЁб«®¬ - add edi,2 - jmp @b - @@: - and al,0xf0 - jnz @f - mov byte[edi],'0' - inc edi - @@: - mov eax,[color] - mov ebx,16 - call int2ascii - mov byte[params+10],' ' - ;add color2 - mov eax,[color2] - or eax,0xf ;¤«п Ё§ЎҐ¦ ­Ёп ўҐз­®Ј® жЁЄ«  Ґб«Ё eax=0 - mov edi,params+11 - @@: - rol eax,8 - or al,al - jnz @f - mov word[edi],'00' ;­г«Ё ЇҐаҐ¤ зЁб«®¬ - add edi,2 - jmp @b - @@: - and al,0xf0 - jnz @f - mov byte[edi],'0' - inc edi - @@: - mov eax,[color2] - mov ebx,16 - call int2ascii - - invoke ini_set_str, inifileeskin, amain, aparam, params, 19 + stdcall save_eskin_ini, 'H ' ret ;end_set_background @@ -1225,8 +1175,66 @@ set_background2: mcall SF_BACKGROUND_SET, SSF_REDRAW_BG mcall SF_SYS_MISC, SSF_MEM_FREE, [image] + stdcall save_eskin_ini, 'B ' ret +align 4 +proc save_eskin_ini, opt_HB:dword + ;save to file eskin.ini + xor al,al + mov ecx,1024 + mov edi,sys_path+2 + repne scasb + sub edi,sys_path+3 + invoke ini_set_str, inifileeskin, amain, aprogram, sys_path+2, edi + ;add param 'H ' + mov eax,[opt_HB] + mov word[params],ax + mov eax,[color] + or eax,0xf ;¤«п Ё§ЎҐ¦ ­Ёп ўҐз­®Ј® жЁЄ«  Ґб«Ё eax=0 + mov edi,params+2 + @@: + rol eax,8 + or al,al + jnz @f + mov word[edi],'00' ;­г«Ё ЇҐаҐ¤ зЁб«®¬ + add edi,2 + jmp @b + @@: + and al,0xf0 + jnz @f + mov byte[edi],'0' + inc edi + @@: + mov eax,[color] + mov ebx,16 + call int2ascii + mov byte[params+10],' ' + ;add color2 + mov eax,[color2] + or eax,0xf ;¤«п Ё§ЎҐ¦ ­Ёп ўҐз­®Ј® жЁЄ«  Ґб«Ё eax=0 + mov edi,params+11 + @@: + rol eax,8 + or al,al + jnz @f + mov word[edi],'00' ;­г«Ё ЇҐаҐ¤ зЁб«®¬ + add edi,2 + jmp @b + @@: + and al,0xf0 + jnz @f + mov byte[edi],'0' + inc edi + @@: + mov eax,[color2] + mov ebx,16 + call int2ascii + + invoke ini_set_str, inifileeskin, amain, aparam, params, 19 + ret +endp + ;#___________________________________________________________________________________________________ ;****************************************************************************************************| ; Ѓ‹ЋЉ Џ…ђ…Њ…ЌЌ›• € ЉЋЌ‘’ЂЌ’ |