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.
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.
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.
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).
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.
> 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.
AnIdiotOnTheNet|3 years ago
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
badlogic|3 years ago
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
thesnide|3 years ago
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
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
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.