Jump to content
Tuts 4 You

Kibloy's Blog

  • entries
    7
  • comments
    19
  • views
    50,165

XM on x64

Killboy

5,832 views

This is the result of trying to play back xm music on 64-bit Windows.

I wrote a simple wrapper around libmodplug that reads its raw PCM output and writes it to the standard wave output.

All you have to do is create an instance of ModPlay which needs a buffer + size of the xm file to be played.

Then just call the play() function and voila :sorc:

I have to say that it roughly adds 40kb of code to your binaries, you have to decide if that is worth it for you. Personally I don't care, especially because you can compress the **** out of it with UPX :)

Attached are the wrapper C++ files, WINMM import libraries from the Windows SDK and 2 static libraries of libmodplug (compiled with VS 2008, you might need to build libmodplug yourself for other compilers/configs, see below for tips)

Any problems, questions, suggestions, let me know.

PS: If you want/need to compile libmodplug, just make sure you define these to keep the library size as small as possible:

MODPLUG_BASIC_SUPPORT

MODPLUG_FASTSOUNDLIB

MODPLUG_NO_FILESAVE

NO_PACKING

For VC++ I added this version of stdint.h, added the libmodplug subfolder to the include dirs and it pretty much compiled out of the box. :wub:

  • Like 2


2 Comments


Recommended Comments

Ufo-Pu55y

Posted

64 is teh new rulez. n1.

will it work with fasm:?

if not i keel you omf!

Share this comment


Link to comment
Killboy

Posted

hehe well, if you're hardcore enough to code FASM64(?) you probably know how to rewrite it without classes to compile with C name mangling :zorro:

Share this comment


Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×