Since there's been a bit of talk about how CustLemm is "old-school" and all and how some people seems to prefer that, I've decided to go ahead with this, even though I'm not sure how many people really prefer this.
Anyhow, as the title says, I've hacked CustLemm so that it plays the original game's music rather than playing tracks from a CD.
In the process, I also have an answer to DragonsLover's question of why the unhacked CustLemm plays the CD tracks in the order it does. It would seem that the very same track numbers are used to select from the set of original music, and when used as indices into the set of the original game music, it apparently maps to the first 6 music you get in DOS Lemmings.
This suggests that perhaps the version of Lemmings CustLemm was made from might actually have a CD whose audio tracks contain all the original game music.
------------------
Anyhow, here we go:
http://www.geocities.com/guestlevels/lemmings/nocdlem.zip
There are 2 EXEs there, nocdlem and nocdlem2. They correspond to modified versions of custlemm.exe and custlem2.exe respectively.
The way it is right now, when you use them, it will go through just the first 6 music of DOS Lemmings. However, I do have plans later to allow a way for level designers to indicate the music they want right in the level data itself. (You'd still be restricted of course to the set of about 20 or so of the original game music.)
Ooh, This'll be good. Original music in Custlemm!:D
ccexplore, you're the best! :thumbsup:
This is awesome! A0;B) Thank you!!
QuoteThis suggests that perhaps the version of Lemmings CustLemm was made from might actually have a CD whose audio tracks contain all the original game music.
There are 6 songs in ONML, correct? Maybe that has something to do with why it loops only 6 songs? The victory/defeat messages are also the ONML ones instead of the original Lemmings ones. Just a thought.
That would be logical, except as there are exactly 6 ONML music, if the track numbers refer to those, than you would expect them to be some permutation of 1-6, and not what DragonsLover was seeing with a CD.
Still, you can try copying ONML's adlib.dat into CustLemm's folder and see what happens. (Haven't tried it myself.)
OK, I've just tried it, and as you suspected, the order of the songs isn't right for ONML. I also tried in regular Lemmings with the ONML Adlib.dat to see where the songs fell. I don't know the order of the ONML songs, since I never was able to play ONML with music (had to just play it in XP), but the locations of the songs fell as follows:
Level 1
Level 6
Level 11(I think?)
"A Beast of a level"
"What an AWESOME level"
"A BeastII of a level"
Perhaps the author(s) of CustLemm hacked the ONML music code to read tracks from original Lemmings? Is it possible to change what tracks are pointed to? (Based on what you said about even putting this data into a level, I'm guessing this is possible.)
Side question: Just curious, does your way of putting the music data inside a level have any connection with how the special levels point to their own songs?
I don't know about what anyone else thinks, but it doesn't seem that the ONML songs are nearly as good as the original Lemmings ones. I can't imagine listening to those 6 songs through 100 levels! A couple of them are not bad, but some of them are grating. A0;X_X
By the way, ccexplore didn't mention this, and it may seem obvious, but when playing "nocdlem.exe" in DOSBox, you don't need to mount your CD-ROM drive. :)
Quote from: Shvegait link=1124711479/0#5 date=1124739820Side question: Just curious, does your way of putting the music data inside a level have any connection with how the special levels point to their own songs?
No. I actually have no idea yet how the game decides which music to play. However, it does keep track of the currently played music in a fixed location in the game's memory, and I did locate the piece of code that actually makes the "play this music" call passing in that memory location.
The plan is to change it to look instead at a memory location within the level data itself. Specifically, the level data has 2 bytes that aren't currently used in CustLemm as far as I can tell, namely the one that marks the level to use Superlemming vs. normal speed. The plan is basically to store the music track in that location.
To avoid the need to hex edit your levels for this, my plan also includes writing a Windows program that does this for you with a graphical interface for you to pick the music for each level in a pack. I'll also need to do some further hacking on nocdlem[2] for this to work, but the main effort will be in writing the Windows program.
Quote from: Shvegait link=1124711479/0#5 date=1124739820I don't know about what anyone else thinks, but it doesn't seem that the ONML songs are nearly as good as the original Lemmings ones. I can't imagine listening to those 6 songs through 100 levels! A couple of them are not bad, but some of them are grating. X_X
I agree, I definitely prefer the original Lemmings songs.
Quote from: ccexplore (not logged in) link=1124711479/0#6 date=1124742463To avoid the need to hex edit your levels for this, my plan also includes writing a Windows program that does this for you with a graphical interface for you to pick the music for each level in a pack.
I haven't actually written the program yet, but here's a mock-up of what I have in mind:
http://www.geocities.com/guestlevels/lemmings/musicpicker.png
Looks good :)
Quote from: ccexplore (not logged in) link=1124711479/0#6 date=1124742463The plan is to change it to look instead at a memory location within the level data itself. Specifically, the level data has 2 bytes that aren't currently used in CustLemm as far as I can tell, namely the one that marks the level to use Superlemming vs. normal speed. The plan is basically to store the music track in that location.
Huh? I know that there is an unknown WORD in the level files at bytes 0x001E to 0x001F, but I didn't know that that's what it was for? Or am I wrong?
Well, that's what I heard anyway, that the unknown is used to indicate SuperLemming status. I'm not sure if I ever verified it myself. But in any case, CustLemm does not support SuperLemming, so I plan to use it instead to support indicating which music the level designer wants.
I'm not sure if this is possible, but if it is it'd be awesome if you could add the ability to specify what level pack CustLemm should load via command-line parameters.
Sure okay, that's easy enough.
oh sorry, I misunderstood. I thought you're talking about the program I was going to write. I realize you mean Custlemm now.
Um, I could try, but I wouldn't count on it for now. Moreover, if I'm doing it I'm probably going to only support it in nocdlem/2 because I can overwrite the CD-related code there with the stuff for parsing the command line, whereas in CustLemm to do it I would need to find a place to put the added code in, and I currently don't know for sure how to do that.
in fact, maybe it's easier if you instead just write a batch file to do the job, something like this
copy %1 levelpak.dat
custlemm.exe
If the batch file is called, say, custlemm.bat, you can launch it like this in DOSBox
custlemm.bat mypack.dat
[note: you need the .bat since there's already a custlemm.exe. Or you can choose to rename custlemm.exe to something else]
And it will run the batch file, which copies mypack.dat over to levelpak.dat and then run custlemm.exe
DOSBox should support batch files.
I guess that'd work too. It's much simpler... B)
Quote from: ccexplore (not logged in) link=1124711479/0#11 date=1124759380Well, that's what I heard anyway, that the unknown is used to indicate SuperLemming status. I'm not sure if I ever verified it myself. But in any case, CustLemm does not support SuperLemming, so I plan to use it instead to support indicating which music the level designer wants.
Just tested this and CustLemm does support SuperLemming... just set the first unknown byte to 0xFF, and SuperLemming mode is enabled...
How do you make midi files?
Modplug has MIDI capabilites, but they're rather hard to use...
Quote from: ccexplore (not logged in) link=1124711479/0#6 date=1124742463
No. I actually have no idea yet how the game decides which music to play. However, it does keep track of the currently played music in a fixed location in the game's memory, and I did locate the piece of code that actually makes the "play this music" call passing in that memory location.
The plan is to change it to look instead at a memory location within the level data itself. Specifically, the level data has 2 bytes that aren't currently used in CustLemm as far as I can tell, namely the one that marks the level to use Superlemming vs. normal speed. The plan is basically to store the music track in that location.
Why don't you implement it in the double-byte next to it which is for the special graphics levels? Or can they be used in CustLemm? And then you could reimplement Superlemming speed! (which may be a slight problem, cos I think lemedit puts something there which, when I imported levels into Mac ONML, makes them go at superlemming speed)
or maybe i'm talking crap...
Superlemming mode does work.
One of my levels uses it, my pack will be released soon.
EDIT: You could use the second of those bytes I think, as far as I tried it out Superlemming mode already works when only the first of these bytes is set to FF.
Quote from: finlay link=1124711479/15#20 date=1128271397(which may be a slight problem, cos I think lemedit puts something there which, when I imported levels into Mac ONML, makes them go at superlemming speed)
Yep, the bonehead that is the author of LemEdit put the LemEdit version number into those 2 bytes. It didn't seem to have an effect in CustLemm despite its support of SuperLemmings according to Mindless, but it's quite possible that Mac ONML checks the bytes differently (eg. check for 0 vs. check for FF).
I suppose I could try hacking CustLemm to leave those 2 bytes as 0s, although it's probably easier if you just use a hex editor yourself to fix it.
Quote from: finlay link=1124711479/15#20 date=1128271397Why don't you implement it in the double-byte next to it which is for the special graphics levels? Or can they be used in CustLemm?
You can use special graphics in CustLemm (in fact, I even made a program allowing you to create your own special graphics for CustLemm use). But I think only 1 of the 2 bytes reserved there are actually used.
Anyway, it's simple to change which bytes to use (and thanks all for the valuable information on this), the reason I haven't finished this yet is because I wanted to first finish a few more MIDIs Ahribar requested.
Quote from: ccexplore (not logged in) link=1124711479/15#22 date=1128286898
Yep, the bonehead that is the author of LemEdit put the LemEdit version number into those 2 bytes.
:D I always wondered if LemEdit was putting random data in there, I didn't know it was the version number... that explains a few things...