6 ms·
DOS demo/game development template
- ataru 4y agoThat 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.
- mseepgood 4y agoJust toggle the turbo button if it runs too fast.
- AnIdiotOnTheNet 4y agoAs 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.
- badlogic 4y agoIn 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.
- thesnide 4y agoI'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.
- thesnide 4y agoHave a look into https://bespin.org/~qz/pc-gpe/ https://bespin.org/~qz/pc-gpe/ for a trip down the memory lane
- bananaboy 4y agoThere’s a list with some links to source for sound libraries here: https://www.vogons.org/viewtopic.php?t=54318 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).
- MrYellowP 4y agoWhat'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 4y 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.
- MrYellowP 4y ago> There's a feeling A feeling? ... Ever since the OOP nonsense started decades ago, adding more and more bureaucracy to programming has been the norm. Nowadays we live in a world where programmers suck, because they've never learned to actually program the computer! Instead they've learned how to use programming languages, aka dealing with all the unnecessary bullshit I call bureaucracy! Once you start piling Bureaucracy onto something , more and more will get stacked on top of it.
- _the_inflator 4y agoThis comes in handy. Yesterday I ordered a book that covers ASM/C demo effects from the 90th. It is called "PC Underground", available from the second hand book mark.
- codetrotter 4y agoIs this the book? https://www.goodreads.com/en/book/show/2146200.PC_Underground https://www.goodreads.com/en/book/show/2146200.PC_Undergroun...
- greenbit 4y agoWas amused to see in the first review the comment that it was 'a bit disorganized'. This reminded me of the 'door stop' books of the 90s, those great thick things that weighed about 3 lbs. In the early days they tended to be worth every penny, but toward the end of the decade the publishers seemed to have gotten some kind of gold-rush mentality, because while there was a sudden proliferation of these hefty tomes, the quality definitely became hit or miss, and it became work to find the gems.
- EvanAnderson 4y agoDoor stop books. Heh heh. Michael Abrash’s “Graphics Programming Black Book”[0] comes to mind. That thing weighs a ton. (I also didn’t realize how pricey it has gotten in the used market! Yikes!) [0] https://github.com/jagregory/abrash-black-book https://github.com/jagregory/abrash-black-book
- myth_drannon 4y agoyes,too bad. 500$ for a book is too much. Why not re-print it...
- winrid 4y agoI have a copy I got for $100, but someone had written "trash" on the sides, I guess until someone realized it's worth something lol
- qwerty456127 4y agoCool. What about a modern setup for VB/VBA? The last time I had to define a custom statistical function for Excel and had limited time I felt handicapped and annoyed by how dumb the code editor (still the same as in VB5) is.
- pjmlp 4y agoThat would be VB.NET with the Office SDK. https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/interop/walkthrough-office-programming https://learn.microsoft.com/en-us/dotnet/csharp/programming-...
- wolpoli 4y agoDepending on your requirement, it might be better to create custom functions in Javascript [1]. One difference is that the functions are tied to the Excel installation, and not on the workbook like VBA. [1]: https://learn.microsoft.com/en-us/office/dev/add-ins/excel/custom-functions-overview https://learn.microsoft.com/en-us/office/dev/add-ins/excel/c...
- hdjjhhvvhga 4y agoGreat work! I hope someone adds out of the box Allegro support...
- DanielG75 4y agoDoes this make DOS .com files or DOS MZ executables (.exe, .com, .dll)?
- LocalH 4y agoIt uses DJGPP, so it makes protected mode EXEs.
- zozbot234 4y agoLLVM devs are apparently still working on adding proper i386 support https://github.com/llvm/llvm-project/issues/58470 https://github.com/llvm/llvm-project/issues/58470 but if that were to be addressed, we might even be able to use clang or rustc to build proper DPMI-based code for DOS. That would then leave 8086 real mode and 80286 protected mode as the next steps - admittedly quite a bit harder, given the need to deal with the complexity of segmented memory and the related issue of "code models".
- andrewf 4y agoSome people have been maintaining a GCC with 16-bit DOS support for a few years now. It started as near pointer only (so only tiny/small memory models) but now has far pointers and some memory model support. I haven't really used it in anger. https://gitlab.com/tkchia/build-ia16/-/releases https://gitlab.com/tkchia/build-ia16/-/releases If you want C++ you have to build a cross-compiler from source on a modern platform; they supply DJGPP binaries that'll compile C to 16-bit.
- mmastrac 4y agoDJGPP was great, but if you want to drop to assembly for performance reasons, NASM was the way to go. AT&T syntax on Intel was a poor choice IMO, and the pain of juggling inline assembly register requirements was just not worth it.
- brink 4y agoThank you for libGDX, Mario. I developed using it in 2017, and it was a great experience.
- analognoise 4y agoSuper strange to run into this - I've been using Dosbox Staging with MASM611 to do some MASM x86 assembly. I really want to understand the original packet driver assembly code; once I understand it, I can write a little packet driver (just as a learning exercise). I love when stuff like this (something very related) gets posted. Sheesh, HN is great.