News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Porting the FCPlay lib to MASM32

Started by r0ger, March 28, 2021, 06:26:49 AM

Previous topic - Next topic

r0ger

already inserted these libs that are required , and i'm still getting this error when i tried to implement it in masm32 .
LINK : fatal error LNK1196: invalid or corrupt import object: unknown version
i think i'm gonna try with fcplay 1.29 instead, because it only has a lot of stdcalls and the C++ headers can be easily ported in masm and can be compiled with it without any problems.
r0ger // PRF

LiaoMi

Quote from: Biterider on March 29, 2021, 04:15:45 AM
Hi
I found some .fc files here http://xmms-fc.sourceforge.net/.
Importing the binary content into the .const section does the trick.

Bin2inc.exe is the right tool, but incbin can also be used with less effort:
.const
fctune label BYTE
incbin <.\modules\Arcane-Theme.fc>
fctunesize = $ - fctune


Unfortunately, not that many .fc files are currently available.

Biterider

Hi Biterider,

perhaps this is a copy of that archive
https://github.com/slippyex/TinyFC-Replayer/blob/master/test_modules/test_modules.zip

P.S. Is it possible to recode .mp3 format to .fc?


r0ger

since i've already ported fc14play v1.29 from c++ to masm32, now all i need to insert i think , is crt.lib , so i get this error :
LINK : fatal error LNK1104: cannot open file "crt.lib"

do i need to get this lib from a new SDK ?
r0ger // PRF

jj2007

Try copying/renaming \Masm32\lib\msvcrt.lib

r0ger

added these commands into the linker : /NODEFAULTLIB:crt.lib /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:oldnames.lib
, and then i've included msvcrt inc and lib, libvcruntime.lib, ucrt.lib and Uuid.lib , then i've got this error :
fc14play_v1.29.lib(fc14play v1.29.obj) : error LNK2001: unresolved external symbol ___ftoll
now what lib should i need to use now ?

jj2007 , i tried renaming the msvcrt.lib to crt.lib and i get 2  __ftoll and _fltused errors.
r0ger // PRF

Biterider

Hi
@LiaoMi: Thanks for the link. The archive contains these and many other files  :thumbsup:
I don't think you can easily convert a .mp3 to a .fc file, but I've learned never to say that something is not possible  :biggrin:

@ R0ger: CRT & Co are not easy to setup. If you show us your code, we can try to fix it.

Biterider

r0ger

oh yeah, almost forgot, here it is.
r0ger // PRF

Biterider

Hi R0ger
I checked your project, but unfortunately, the files you need are not part of the MASM32 distribution. You need to take them from the Windows SDK. You will also need a newer linker that is compatible with the FC-library.
Even if you've met all of these requirements, your app won't run. There are additional bugs that you need to find out. I changed the code so that the sound plays for a few seconds when the app starts. This is how to check if the library works okay.


I send you the modified source code for further study.


Regards, Biterider

TimoVJL

#23
Quote from: r0ger on March 29, 2021, 06:42:16 AM
added these commands into the linker : /NODEFAULTLIB:crt.lib /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:oldnames.lib
, and then i've included msvcrt inc and lib, libvcruntime.lib, ucrt.lib and Uuid.lib , then i've got this error :
fc14play_v1.29.lib(fc14play v1.29.obj) : error LNK2001: unresolved external symbol ___ftoll
now what lib should i need to use now ?

jj2007 , i tried renaming the msvcrt.lib to crt.lib and i get 2  __ftoll and _fltused errors.
Oops, that was for Pelles C

This one is for msvc and CDECL, so inc file needs that C in function prototype.
http://masm32.com/board/index.php?topic=9261.msg101692#msg101692

EDIT: fc14_v1.29s.lib is just 32-bit stdcall version
May the source be with you

Biterider

Hi TimoVJL
It would be great if you could compile the static library v1.29 for 32 and 64 bit (release, stdcall)  :biggrin:

Biterider

TimoVJL

#25
Quote from: Biterider on March 29, 2021, 09:14:11 PM
Hi TimoVJL
It would be great if you could compile the static library v1.29 for 32 and 64 bit (release, stdcall)  :biggrin:

Biterider
You mean for crtmt.lib ?
Link option -nodefaultlib:msvcrt.lib is useful.

EDIT: those was built with -Gz -O2 and using WDK 7.10 headers, so with masm32 libraries, just use -nodefaultlib:crtmt.lib
May the source be with you

Biterider

Hi TimoVJL
Perfect!, thanks for the files  :thup:

Biterider