Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

FUuuuuuuuuuu-

Name: John Bonston 2011-02-12 14:32

Can anyone help me figure out why these two assignment statements don't return the same values for C# and c, respectively.

                        buffer[0][vd.pcm_current + i] = ((readbuffer[i*4+1]<<8) | (0x00ff&(int)readbuffer[i*4]) ) / 32768f;
                        buffer[1][vd.pcm_current + i] = ((readbuffer[i*4+3]<<8) | (0x00ff&(int)readbuffer[i*4+2]) ) / 32768f;
Assembly(second line):
00000669 8B 45 90             mov         eax,dword ptr [ebp-70h]
0000066c 83 78 04 00          cmp         dword ptr [eax+4],0
00000670 77 05                ja          00000677
00000672 E8 09 62 B8 67       call        67B86880
00000677 8B 40 0C             mov         eax,dword ptr [eax+0Ch]
0000067a 89 85 2C FF FF FF    mov         dword ptr [ebp+FFFFFF2Ch],eax
00000680 A1 00 7B DD 02       mov         eax,dword ptr ds:[02DD7B00h]
00000685 8B 40 18             mov         eax,dword ptr [eax+18h]
00000688 03 45 B8             add         eax,dword ptr [ebp-48h]
0000068b 89 85 28 FF FF FF    mov         dword ptr [ebp+FFFFFF28h],eax
00000691 8B 45 B8             mov         eax,dword ptr [ebp-48h]
00000694 8D 04 85 01 00 00 00 lea         eax,[eax*4+00000001h]
0000069b 8B 15 08 7B DD 02    mov         edx,dword ptr ds:[02DD7B08h]
000006a1 3B 42 04             cmp         eax,dword ptr [edx+4]
000006a4 72 05                jb          000006AB
000006a6 E8 D5 61 B8 67       call        67B86880
000006ab 0F B6 44 02 08       movzx       eax,byte ptr [edx+eax+8]
000006b0 C1 E0 08             shl         eax,8
000006b3 8B 55 B8             mov         edx,dword ptr [ebp-48h]
000006b6 C1 E2 02             shl         edx,2
000006b9 8B 0D 08 7B DD 02    mov         ecx,dword ptr ds:[02DD7B08h]
000006bf 3B 51 04             cmp         edx,dword ptr [ecx+4]
000006c2 72 05                jb          000006C9
000006c4 E8 B7 61 B8 67       call        67B86880
000006c9 0F B6 5C 11 08       movzx       ebx,byte ptr [ecx+edx+8]
000006ce 0B C3                or          eax,ebx
000006d0 89 85 DC FE FF FF    mov         dword ptr [ebp+FFFFFEDCh],eax
000006d6 DB 85 DC FE FF FF    fild        dword ptr [ebp+FFFFFEDCh]
000006dc D9 9D DC FE FF FF    fstp        dword ptr [ebp+FFFFFEDCh]
000006e2 D9 85 DC FE FF FF    fld         dword ptr [ebp+FFFFFEDCh]
000006e8 D8 35 20 2F 32 00    fdiv        dword ptr ds:[00322F20h]
000006ee DD 9D 20 FF FF FF    fstp        qword ptr [ebp+FFFFFF20h]
000006f4 8B 85 28 FF FF FF    mov         eax,dword ptr [ebp+FFFFFF28h]
000006fa 8B 95 2C FF FF FF    mov         edx,dword ptr [ebp+FFFFFF2Ch]
00000700 3B 42 04             cmp         eax,dword ptr [edx+4]
00000703 72 05                jb          0000070A
00000705 E8 76 61 B8 67       call        67B86880
0000070a DD 85 20 FF FF FF    fld         qword ptr [ebp+FFFFFF20h]
00000710 D9 5C 82 08          fstp        dword ptr [edx+eax*4+8]




        buffer[0][i]=((readbuffer[i*4+1]<<8) | (0x00ff&(int)readbuffer[i*4]))/32768.f;
        buffer[1][i]=((readbuffer[i*4+3]<<8) | (0x00ff&(int)readbuffer[i*4+2]))/32768.f;
Assembly(second line):
011CA0FC 8B 85 60 FC FF FF    mov         eax,dword ptr [ebp+FFFFFC60h] 
011CA102 0F BE 0C 85 83 8A 3B 01 movsx       ecx,byte ptr [eax*4+013B8A83h] 
011CA10A C1 E1 08             shl         ecx,8 
011CA10D 8B 95 60 FC FF FF    mov         edx,dword ptr [ebp+FFFFFC60h] 
011CA113 0F BE 04 95 82 8A 3B 01 movsx       eax,byte ptr [edx*4+013B8A82h] 
011CA11B 25 FF 00 00 00       and         eax,0FFh 
011CA120 0B C8                or          ecx,eax 
011CA122 89 8D 68 FB FF FF    mov         dword ptr [ebp+FFFFFB68h],ecx 
011CA128 DB 85 68 FB FF FF    fild        dword ptr [ebp+FFFFFB68h] 
011CA12E DC 35 48 A8 1F 01    fdiv        qword ptr ds:[011FA848h] 
011CA134 8B 8D 48 FC FF FF    mov         ecx,dword ptr [ebp+FFFFFC48h] 
011CA13A 8B 51 04             mov         edx,dword ptr [ecx+4] 
011CA13D 8B 85 60 FC FF FF    mov         eax,dword ptr [ebp+FFFFFC60h] 
011CA143 D9 1C 82             fstp        dword ptr [edx+eax*4]

Name: John Bonston 2011-02-12 14:33

easy reading:

buffer[0][vd.pcm_current + i] = ((readbuffer[i*4+1]<<8) | (0x00ff&(int)readbuffer[i*4]) ) / 32768f;
buffer[1][vd.pcm_current + i] = ((readbuffer[i*4+3]<<8) | (0x00ff&(int)readbuffer[i*4+2]) ) / 32768f;

 buffer[0][i]=((readbuffer[i*4+1]<<8) | (0x00ff&(int)readbuffer[i*4]))/32768.f;
buffer[1][i]=((readbuffer[i*4+3]<<8) | (0x00ff&(int)readbuffer[i*4+2]))/32768.f;

Name: Anonymous 2011-02-12 14:33

I'm not going to read unaligned non-code tagged code.

Name: VIPPER 2011-02-12 14:35

>>1
Try using code tags.

Name: Anonymous 2011-02-12 14:35

How about [code]?
How about NO? Take your fucking debugger([spoiler]Console.Out.WriteLine is fine too[/spoiler]) and debug yourself.

Name: Anonymous 2011-02-12 14:49

gtfo tripfag!

Name: sage 2011-02-12 15:43

sage

Name: noko 2011-02-12 16:25

noko

Name: noko 2011-02-12 16:36

noko every day

Name: Anonymous 2011-02-12 17:03

c# code has readbuffer declared as unsigned and c code has readbuffer declared as signed ?

Name: Anonymous 2011-02-12 21:46

>>10
Really?! I spent 3 hours picking through binary data convinced it was it was a bitwise error(from the many bitwise operations in this code). I had to switch byte to sbyte. +100 internets and whatever else you want. Anon delivard! thank you thank you.

Name: VIPPER 2011-02-13 7:15

internets
Anon
delivard
You should kill yourself, please.

Name: Anonymous 2011-02-13 8:24

>>12
Yeah! That's right! Post links to some loli manga.

Name: Anonymous 2011-02-13 9:06

>>13
Go back to /fakku/, please.

Name: Anonymous 2011-02-14 1:05

stfu vipper. why do you post here everyday anyway.

Name: Anonymous 2011-02-14 1:11

>>12
also, you're the contentious fucktarded cancer that's killing 4chan, internet tough guy.

Name: Anonymous 2011-02-15 3:04

>>16
Back to /b/ please.

Name: VIPPER 2011-02-15 3:24

>>16
You just made my day.

Name: Anonymous 2011-02-15 4:33

Epic win >>16

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2011-02-15 10:01

Name: Anonymous 2011-02-15 10:05

>>20
Not loli enough.

Name: Anonymous 2011-02-15 10:32

DOOBY DUBS

Name: root !Ep8pui8Vw2 2011-02-15 20:06

OP, is right. This place is crawling with shitheads.

Don't change these.
Name: Email:
Entire Thread Thread List