Slimelite BBS

.Mods, Autodetection and File Merging(

Back to R25C

From Anthony Hamilton · 1996-04-05 08:12 · #75191 in R25C

Hiay!

 OG> Thanks for your reply, Conan!

No-problem!

 AH> Else you could let the user choose the settings before the demo runs.
 AH> Some good demos do this.

 OG> Maybe, but I want this demo to be as small and easy to run as
 OG> possible. (see next comment)

I see.

How big is the MOD you wish to play?

All of the compact BBS adds I've seen with music in them use FM music.

 OG> The most important thing is that the mod plays in the background
 OG> without causing trouble while the demo runs.

That's no problem; all sound libraries that plat MOD files will most
certanly do it under interrupt.

Are you good at assembler? If not, the only option is to use a library
at this stage.

 OG> Does the library you mention come as a .lib or with complete source
 OG> code,

Yep(!). The DSMI library comes as .OBJ files, .LIB files AND you get the
source. It's got all the bells and whistles...

 OG> because I would like to be able to cut out any functions I don't
 OG> need.

You can do that, too (your linker will usually intelligently link only
functions used). But the major part of a sound libary like this is the
mixing routine that will allow multiple digital channels on sound cards
like the SoundBlaster. Once you link in the bare minimum, you've already
knocked the .EXE size up by around 40-50K :(

There /are/ many other MOD playing libraried around that are MUCH
simpler and smaller. I saw one the other day on Gunsmoke BBS (see origin
line). I can't remember what it was called, but if you do a search for
SoundBlaster, you should come up with somthing. Although, I wouldn't be
able to apppriciate the quality from the lib myself, 'cos it doesn't
support the Gravis Ultrasound.

[ Data/.EXE file concatination ]

 OG> I suppose if you knew the file offset of the pcx you could add it to
 OG> the end of the exe, have the program open itself and fseek to the right
 OG> position. The trouble I'm having is in finding a way to physically link
 OG> the files.

Physically link the .EXE and data files? That's easy enough. Just write
your own file copy routine that adds one file to another. Need you more
help with this in particualr?

How you would know the size the program currently being compiled, will
compile to is tricky.

I /think/ there are routines that alow you to link data files as part of
your normal .OBJ link and let you access 'em. This was a discussion in
here a couple of years ago, but I never took much notice.

 OG> The best idea I've had is to uuencode the two files and
 OG> manually join the end of the exe to the start of the pcx,

Heh-heh! That's bizzar :)

 OG> As a seperate issue, the way I make sure the demo runs at the same
 OG> speed on a P166 and a 486 is by setting the internal timer to a fast
 OG> speed and have the program's main loop pause for one timer tick each
 OG> time it runs.

Cool, I know a fair bit about speed regulation...

Your method can be MUCH improved. How about simply waiting for virtical
video retrace? I can tell you how, if you don't know.

It depends on how much time it takes for one frame of your demo to
animate and how lower a machine you wish it to be ran on.

You could make it run the same speed on a 8086 by using your
accellerated timer (set it to 70hz to use it WITH the virtical
retrace) to count the amount of clicks it takes to draw a frame and
advance everything that moves extra places before drawing the next
frame.

As I say... it depends on things.

 OG> This works fine with DOS, but when I run it under Windows
 OG> 95 it crawls. I'm certain that this is because Windows won't let me
 OG> change the speed of the timer. Is there any way round this?

I dunno if there's a limit to the range you can set the timer within the
Windows environment, but I do know that Windows screws-up the smoothness
of the PIT timer. Waiting for a virtical retrace isn't effected by
Windows (as long as the DOS window isn't minimized).

 OG> Thanks again, 0ly.

Take-care, man!

m, - Conan

... Lemming magnet #16: The law
--- GEcho 1.11+
 * Origin: Gunsmoke BBS! 28800! V.34! (01494) 871293 (2:252/174)