top | item 34104781

(no title)

ataru | 3 years ago

That looks really cool. I'd need more help for the next steps - a game loop that runs the game at a consistent speed on different processors, and a sound library.

discuss

order

AnIdiotOnTheNet|3 years ago

As I recall, at least in mode 13h on VGA cards you can poll a register for vsync status, so a simple way is to just busywait on that.

Alternatively you can install your own timer interrupt for a higher precision counter you can monitor.

Typically we wrote directly to the sound hardware back then, but if you're looking to have all that complexity abstracted (it isn't really that bad, there's good documentation out there and these are pretty simple devices), you could use the old DOS version of the Allegro library.

mseepgood|3 years ago

Just toggle the turbo button if it runs too fast.

badlogic|3 years ago

In DJGPP, you can use uclock() to get a sort of high precision timer, at least much higher precision than the 18.2Hz timer usually employed in DOS apps.

As for audio, I'm afraid I have no suggestions. My memory is blurry, likely because audio programming in DOS was very not good.

bananaboy|3 years ago

There’s a list with some links to source for sound libraries here: https://www.vogons.org/viewtopic.php?t=54318 Personally I’ve used Midas for an MS-DOS game project for sound effects. It’s also available for Windows so good for projects that are cross-platform. For demoscene productions I’ve used a number of different mod players (most recently IMS).

thesnide|3 years ago

I'd suggest to simply use GUS programming for audio, since it does all the heavy mixing in HW.

It was a breeze for programmers, but a bane for consumers as it wasn't really compatible with the SB yet not cheap.

But as dosbox emulates it very nicely, it sounds like a good match now.

MrYellowP|3 years ago

What's wrong with using VSync? 320x200 ran at 70Hz on every machine out there.

You don't need a sound library. You just need to know how to talk to a SoundBlaster. Virtually everything was compatible, so you were good to go. A library is only adding Points Of Failure. Programming a sfx card was way easier compared to nowadays.

zx8080|3 years ago

> Programming a sfx card was way easier compared to nowadays.

This. Replace "sfx card" with almost anything except new ones. The list would include: ios/android app, web site, etc. There's a feeling that we keep stacking an unneeded complexity in layers.