ragdog Posted June 13, 2010 Posted June 13, 2010 Hi I have download the new bass.dll version 2.4.5 Now compile i my old app hmm this works not invoke BASS_StreamCreateFile,NULL,addr MusicFile,0,0,BASS_SAMPLE_LOOP error A2114: INVOKE argument type mismatch : argument : 4 error A2114: INVOKE argument type mismatch : argument : 3 I look in the c/c++ package and find this BASS_StreamCreateFile(FALSE,file,0,0,BASS_SAMPLE_LOOP And this works why? Now have i look in the help file an see: HSTREAM BASS_StreamCreateFile( BOOL mem, void *file, QWORD offset, QWORD length, DWORD flags ); What make i by QWORD? greets,
Accede Posted June 13, 2010 Posted June 13, 2010 If an executable statement or a designation between the PROC statement and the INVOKE statement is inserted, the error does not occur. The example code below causes uncommenting the line before you call that the assembler to generate a local label and the code will compile correctly.; Assemble options needed: none.MODEL large, CcPrologue MACRO szProcName, flags, cbParams, cbLocals, rgRegs, rgUserParams LOCAL count count equ 0 exitm <cbParams>ENDMOPTION PROLOGUE: cPrologueYak PROTO FAR, :WORD, :WORD, :WORD, :WORD.CODELlama PROC NEAR; Uncomment following line to remove error; dummy: INVOKE Yak, AX, BX, CX, DXLlama ENDPEND LlamaI hope that help you wight the error.
ghandi Posted June 13, 2010 Posted June 13, 2010 (edited) First question i have is, are you trying to use a 64 bit library with your 32 bit project or are you assembling a 64 bit project? If it is a 32 bit library, i'm not sure why it would be asking for a QWORD, but have you tried prototyping the function with those size parameters? Also, are you trying to use the old .inc file with the newer .lib file? If there have been changes then you will need a current .inc file as well as a current .lib file wont you? BASS_StreamCreateFile PROTO _mem:DWORD,_file:DWORD,_offset:QWORD,_length:QWORD,_flags:DWORD;declare a single QWORD in your data section and after ensuring it is NULL, pass that as a parameter:.data?qwZero QWORD ?.codeinvoke BASS_StreamCreateFile,NULL,addr MusicFile,qwZero,qwZero,BASS_SAMPLE_LOOP Just as an example of what i mean: .data?qwZero QWORD ?.codeSomeFunc PROC qwOne:QWORD,qwTwo:QWORD RetSomeFunc EndPinvoke SomeFunc,qwZero,qwZero This assembled to: 00401070 . FF35 08304000 PUSH DWORD PTR [403008]00401076 . FF35 04304000 PUSH DWORD PTR [403004]0040107C . FF35 08304000 PUSH DWORD PTR [403008]00401082 . FF35 04304000 PUSH DWORD PTR [403004]00401088 . E8 25000000 CALL 004010B2 As you can see, because it is a 32 bit environment MASM had to split the QWORD into 2 DWORDs and passes each half to the function. Because it is __stdcall by default, the function corrects the stact at return. Although we can pass a QWORD as a parameter, MASM doesn't allow us to arbitrarily pass '0' or 'NULL' for a 64 bit parameter. HR, Ghandi Edited June 13, 2010 by ghandi
ragdog Posted June 13, 2010 Author Posted June 13, 2010 Thanks for the informationI have try it i cannot play with this new bass.dllShowOpenFileDialog proclocal qwZero :QWORD ; for 64-bit parameters!!!.dataszFilter db "XM-Files",0,"*.xm",0,0.data?hBuffer db 512 dup (?)ofn OPENFILENAME <>.code invoke RtlZeroMemory,addr hBuffer, 256 mov ofn.lStructSize, SIZEOF ofn mov ofn.lpstrFilter, offset szFilter mov ofn.lpstrFile, offset hBuffer mov ofn.Flags, OFN_EXPLORER + OFN_FILEMUSTEXIST + OFN_PATHMUSTEXIST mov ofn.nMaxFile,512 invoke GetOpenFileName,addr ofn .if eax == TRUE invoke BASS_Init,-1,44100,0,0,NULL invoke BASS_StreamCreateFile,FALSE,offset hBuffer,qwZero,qwZero,BASS_SAMPLE_LOOP invoke BASS_MusicLoad,FALSE,offset hBuffer,qwZero,0,BASS_MUSIC_RAMP or BASS_SAMPLE_LOOP,0 invoke BASS_ChannelPlay,eax,FALSE .endif retShowOpenFileDialog endpHave you or any an idea?
Accede Posted June 13, 2010 Posted June 13, 2010 (edited) her is an examble from delphi i thing its easy to convert to asm.procedure TForm1.FormCreate(Sender: TObject);varh: HMUSIC;beginBASS_Init(-1, 44100, 0, handle, nil);h:= BASS_MusicLoad(True, @xm, 0, length(xm), BASS_MUSIC_LOOP or BASS_MUSIC_RAMPS, 0);BASS_ChannelPlay(h, True);end;procedure TForm1.FormDestroy(Sender: TObject);beginBASS_Free;end;and to this invoke BASS_StreamCreateFile,FALSE,offset hBuffer,qwZero,qwZero,BASS_SAMPLE_LOOP invoke BASS_MusicLoad,FALSE,offset hBuffer,qwZero,0,BASS_MUSIC_RAMP or BASS_SAMPLE_LOOP,0 * invoke BASS_ChannelPlay,eax,FALSE*change this FALSE to Trueyou whant make are mod player? Edited June 13, 2010 by accede
ragdog Posted June 13, 2010 Author Posted June 13, 2010 (edited) Hmm i think to convert is not this problemonly the new bass.dll with this 64 bit supportit gives different procedurs and parameter from older version to newer Edited June 13, 2010 by ragdog
ragdog Posted June 13, 2010 Author Posted June 13, 2010 Ok I have it solved withlocal p64 :QWORD ; for 64-bit parameters!!!mov DWORD PTR [p64], 0mov DWORD PTR [p64+4], 0Thanks
ghandi Posted June 13, 2010 Posted June 13, 2010 Yes, if you use a LOCAL variable, it will most likely contain junk (its stack memory, remember?), so you must explicitly zero it first, which is why i had it in uninitialized data, because it takes up no disk space but is mapped into the .rdata section and allocated at runtime.HR,Ghandi
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now