maybe someone can help...

i found the minifmod library on the fmod site and wanted to implement it to my project. first i tested it on tasm but the lib use a coff header so i started to implement it with masm.
after translating the header files and adding it to my aplication it doesnt also work.

has someone done it before and can help me or have an example of this?

... thanks
Posted on 2002-03-09 18:43:40 by adapix
EXTRN FSOUND_Init:proc

same for every other procedure
Posted on 2002-03-10 00:29:56 by comrade
thanks but it doesnt work
this is the errormessage i actually get from the linker



fmusic.obj : error LNK2001: unresolved external symbol __imp__waveOutWrite@12
fmusic.obj : error LNK2001: unresolved external symbol __imp__waveOutPrepareHeader@12
fmusic.obj : error LNK2001: unresolved external symbol __imp__waveOutUnprepareHeader@12
fsound.obj : error LNK2001: unresolved external symbol __imp__waveOutOpen@24
fsound.obj : error LNK2001: unresolved external symbol __imp__waveOutClose@4
fsound.obj : error LNK2001: unresolved external symbol __imp__waveOutReset@4
fsound.obj : error LNK2001: unresolved external symbol __imp__waveOutGetPosition@12
window.exe : fatal error LNK1120: 7 unresolved externals


i included the minifmod.lib to my projet and added the 6 obj files to the Link.exe commandline. it looks actually like this

 

c:\masm32\bin\Link.exe /SUBSYSTEM:WINDOWS window fmusic fsound mixer_fpu_ramp music_formatxm system_file mixer_clipcopy rsrc.obj
Posted on 2002-03-10 12:19:14 by adapix
link with minifmod.lib and the windows DLL import libraries needed...
like winmm.lib . You'll probably find that there's some additional
missing symbols if you don't link with libc.
Posted on 2002-03-10 12:43:02 by f0dder
thanks

i forgot to add winmm.lib
but the FSOUND_SAMPLE struct is missing

do you have an idea what to do?
Posted on 2002-03-10 14:17:24 by adapix
Afternoon, adapix.

ummm. *what* FSOUND_SAMPLE struct?
I didn't think there was one.

Caleb uses fmod in his example proggy.

Cheers,
Scronty
Posted on 2002-03-10 20:01:58 by Scronty
adapix,

Get the full FMOD download and use the helpfile: FMODAPI350\DOCUMENTATION\FMOD.CHM

It tells you everything you need to know and how to set it up properly.
Posted on 2002-03-11 02:41:23 by gscundiff
Full FMOD uses a DLL and thus doesn't need the libc runtimes (as
they are linked with the .DLL). Full FMOD doesn't give you those very
tiny intros though ;). You don't really need the FSOUND_SAMPLE
if you just want to play back a .xm, but (I guess?) it might be needed
if you want to generate your own samples on the fly.
Posted on 2002-03-11 07:28:32 by f0dder
thanks for all the replays!
i need small code that i can include into an intro thats right! the dll is to big for my project.

@fodder
ok thanks i will test it without this structure stuff. i hope it works. the only problem i really have is including this call



FSOUND_File_SetCallbacks(fileopen, fileclose, fileread, fileseek, filetell);


maybe this one is better to include. im not sure didnt test it yet. i testet to recode the 'test' file in masm with extarnal xm file.



FSOUND_File_SetCallbacks(memopen, memclose, memread, memseek, memtell);
Posted on 2002-03-11 11:56:42 by adapix
If you take a look at the filesystem callback examples used in the
minifmod example, you will see that it's not very hard to write
code that uses the win32 API directly...

I'm afraid you still need libc for pow() and a few other things though.
You can rewrite these yourself, or link to the msvcrt.lib (to link dynamically
to the msvcrt.dll runtime library).
Posted on 2002-03-11 12:07:20 by f0dder
hi f0dder

here is my code. i tested many version to open the file (file mapping, without mapping... )with standard api's but i think that the best way would be to use the mmIO file routines



;---------------------------------------------------------
; unsigned int fileopen(char *name)

fileopen proc f_name:DWORD

push MMIO_READWRITE
push f_info
push f_name
call mmioOpen
mov eax, f_info.hmmio

ret
fileopen endp


;---------------------------------------------------------
; void fileclose(unsigned int handle)

fileclose proc f_handle:HANDLE

push MMIO_FHOPEN
push f_handle ;f_info.hmmio
call mmioClose

ret
fileclose endp

;---------------------------------------------------------
; int fileread(void *buffer, int size, unsigned int handle)

fileread proc lpBuffer:LPVOID, nBytesToRead:DWORD, f_handle:HANDLE

push nBytesToRead
push lpBuffer
push f_handle ;f_info.hmmio
call mmioRead

ret
fileread endp

;---------------------------------------------------------
; void fileseek(unsigned int handle, int pos, signed char mode)

fileseek proc f_handle:HANDLE,pos:DWORD, mode:BYTE

push SEEK_SET ;SEEK_CUR
push pos
push f_handle ;f_info.hmmio
call mmioSeek

ret
fileseek endp

;---------------------------------------------------------
; int filetell(unsigned int handle)

filetell proc f_handle

push NULL
push f_info
push f_handle ;f_info.hmmio
call mmioGetInfo
mov eax, f_info.lDiskOffset

ret
filetell endp


and my winProc call looks like this



push offset filetell
push offset fileseek
push offset fileread
push offset fileclose
push offset fileopen
call FSOUND_File_SetCallbacks

push 0
push 44100
call FSOUND_Init

push NULL
push offset xm_filename
call FMUSIC_LoadSong

push modul
call FMUSIC_PlaySong


but i realy dont know why my system crashs. i hope you have an idea else i really have to use the msvcrt.dll fileroutines but my idea was to do all the stuff without this library and to recode the parts of the minifmod using this lib (pow for example).
also i have problems creating the include file for msvcrt.dll
Posted on 2002-03-11 14:52:34 by adapix