VOGONS


First post, by Scali

User metadata
Rank l33t
Rank
l33t

Perhaps some of you were aware that this past Easter weekend, the world's biggest demoparty was on: Revision.
There was one release for 8088 there, it was a chipmod song using the sound routine that reenigne originally developed for the endtune of 8088 MPH. The rules required that the executable be 32 KB or less. Of course we can pack 3 minutes of music in there just fine
Perhaps you like it. This will run on a real IBM 5150 or 5160 provided you have enough memory (I suppose 256 KB should do it, perhaps slightly more).
https://www.youtube.com/watch?v=L2ppIrtcD3w

I also created a 'safe' version that requires a slightly faster CPU, but uses the PIT for timing, and is therefore not sensitive to the speed of the system. This makes it more friendly for clones and emulators.
Binaries can be downloaded here: https://www.dropbox.com/s/l6s4f3bigilkoz8/SIZ … _drums.zip?dl=0

Last edited by Scali on 2017-04-19, 17:36. Edited 1 time in total.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 1 of 8, by Stiletto

User metadata
Rank l33t++
Rank
l33t++

I have a general Revision2k17 thread going here if you want to post about other cool things you saw there, general reactions, etc. 😀
Revision2K17 is this weekend

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 2 of 8, by dr.zeissler

User metadata
Rank l33t
Rank
l33t

DL does not work for me ? 404...

BadCat was a bad game, but on my Schneider EuroPC (8088/or upgraded to nec V20 9,54Mhz) it had Digisound in the Intro that was VERY nice (if you only knew PC-beeper) !

https://www.youtube.com/watch?v=Pby7dLQA08o But it's too fast here.
here is better https://www.youtube.com/watch?v=U7E--gBF2Gk

Retro-Gamer 😀 ...on different machines

Reply 4 of 8, by dr.zeissler

User metadata
Rank l33t
Rank
l33t

Thx! DL works. I can use "safe" when running in dosbox and go down to cycles 600 (XT-speed),
so it should work on my XT too...great! I will test it...

I think it uses 100% cpu-time, so perhaps music playing while running a MDA/CGA/EGA slideshow
should not be possible, or am I wrong?

Retro-Gamer 😀 ...on different machines

Reply 5 of 8, by Scali

User metadata
Rank l33t
Rank
l33t
dr.zeissler wrote:

Thx! DL works. I can use "safe" when running in dosbox and go down to cycles 600 (XT-speed),
so it should work on my XT too...great! I will test it...

I've made a slightly more optimized version: https://www.dropbox.com/s/aldvo61jaygqn8b/OPTMTRS.EXE?dl=0
This one works on my 8088 with 8 MHz turbo. The other version isn't fast enough for 8 MHz. Not sure how fast your system needs to be then.

dr.zeissler wrote:

I think it uses 100% cpu-time, so perhaps music playing while running a MDA/CGA/EGA slideshow
should not be possible, or am I wrong?

The 'safe' version is designed to run as a 'background' player, running from the timer interrupt. So in theory you can do something in the foreground. A slideshow should be simple enough.
You'd just have to balance the background and foreground CPU time by adjusting the sound quality. You'd also want to avoid 'long' instructions like mul and div, because they cannot be interrupted, which would result in audible jitter.

The optimized version actually puts code in segment 0, so on top of the interrupt handlers. Currently only irq0 (timer) and irq1 (keyboard) are left in the table, the rest is used for code.
That means you won't be able to access DOS/BIOS routines, or hardware that uses interrupts (such as floppy and most HDD controllers).

I might be able to move them up far enough to at least get things up to int 21h working, but I'd have to see.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 6 of 8, by wbc

User metadata
Rank Member
Rank
Member

pretty nice track! 😉

Scali wrote:

The optimized version actually puts code in segment 0, so on top of the interrupt handlers. Currently only irq0 (timer) and irq1 (keyboard) are left in the table, the rest is used for code.

just a curious question, but what's the reason of overlaying interrupt table with player code (afaik can't remember that explicitly using segment 0 will give some benefits)?

--wbcbz7

Reply 7 of 8, by Scali

User metadata
Rank l33t
Rank
l33t
wbc wrote:

just a curious question, but what's the reason of overlaying interrupt table with player code (afaik can't remember that explicitly using segment 0 will give some benefits)?

The advantage is that you can assume that cs == 0. Therefore, you can directly access the interrupt vector for the timer interrupt, allowing you to install a new handler at each interrupt (mov cs:[int*4], handler).
That way you can make a 'chain' of handlers. In my case, most handlers play only a single sample (which is patched into the immediate operand of a mov al, nn instruction directly), and every now and then, I place a special handler that jumps to the mixing routine, which generates new samples into the chain of handlers.
So I need no extra playback logic whatsoever. No countdown timers, no compares, no branches, nothing.

If I didn't place the handers in segment 0, I would have the additional overhead of saving a segment register on stack, setting it to 0, updating the handler, and then restoring the segment register.
Since the actual sample playback is so optimized that it's pretty much this:

push ax
mov al, nn
out 0x42, al
pop ax

The extra segment register stuff would be a significant impact, making it almost twice as slow. So putting the handlers in segment 0 give me a significant performance increase.

Edit: by the way, the other 'safe' version uses a similar trick: It uses 64k segment as a circular sample buffer, and places the interrupt handler inside this sample buffer. As a result, cs points to the sample data by definition, and you can use mov al, cs:[nnnn] to load the next sample, or cs:lodsb for example.
This version requires some periodic checking in the foreground thread to move the interrupt handler around periodically.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 8 of 8, by mr_bigmouth_502

User metadata
Rank Oldbie
Rank
Oldbie
dr.zeissler wrote:
DL does not work for me ? 404... […]
Show full quote

DL does not work for me ? 404...

BadCat was a bad game, but on my Schneider EuroPC (8088/or upgraded to nec V20 9,54Mhz) it had Digisound in the Intro that was VERY nice (if you only knew PC-beeper) !

https://www.youtube.com/watch?v=Pby7dLQA08o But it's too fast here.
here is better https://www.youtube.com/watch?v=U7E--gBF2Gk

That's literally the most 80s thing I've heard all day. 🤣 I love it.