Page 3 of 3

Re: Sound bits

PostPosted: Thu Mar 10, 2011 11:57 am
by deathshadow60
Certain PIO disk devices, software controlled refreshes and polling on non-DMA computers (Jr/1k) -- they can often crash if you don't call it soon enough/often enough or spread out enough.

For my uses usually adding that much logic to my ISR doesn't help a whole lot either -- doesn't leave enough CPU free to do anything else. It's called load balancing -- you spread it out instead of blowing it all out in one slice... Which is usually why timers are used in the first place.

See why multitasking time slicing is pretty much how every modern OS handles it.

Re: Sound bits

PostPosted: Fri Mar 11, 2011 8:58 am
by Trixter
deathshadow60 wrote:Certain PIO disk devices, software controlled refreshes and polling on non-DMA computers (Jr/1k) -- they can often crash if you don't call it soon enough/often enough or spread out enough.


Good point, and something to watch out for.

you spread it out instead of blowing it all out in one slice... Which is usually why timers are used in the first place.
See why multitasking time slicing is pretty much how every modern OS handles it.


Were I writing an OS that has to manage multiple timeslices of unknown duration, I would agree, but DOS programs have access to the entire machine when they're running and the author of a program knows beforehand how long each timeslice takes. On fast machines, the overhead is negligible, but for machines as slow as the ones we work with, interrupt service overhead is substantial.

For a program that, for example, must update the screen at an interval of 30Hz, there is no difference between a 30Hz timer that "blows it all out in once slice", and one that uses a 240Hz timer and spaces calcs out, updating the screen once every 8 ticks. In fact, I'd argue that the latter method is less efficient, because calcs in one timeslice that finish early waste time that cannot be used by calcs in other timeslices (or worse, one timeslice will get interrupted by another).

Re: Sound bits

PostPosted: Tue Dec 06, 2016 7:00 pm
by KenG
I know this is a very old thread, but I found it and now have sound in Battlechess. I did discover one thing in testing it. Once I typed tsound s to re activate the speaker, typing tsound kept giving the message "Speaker sound activated". I thought about this while taking a shower. Typing anything except s will turn Tandy sound back on.

Re: Sound bits

PostPosted: Sun Jan 29, 2017 7:02 pm
by Vorticon
KenG wrote:I know this is a very old thread, but I found it and now have sound in Battlechess. I did discover one thing in testing it. Once I typed tsound s to re activate the speaker, typing tsound kept giving the message "Speaker sound activated". I thought about this while taking a shower. Typing anything except s will turn Tandy sound back on.


Yeah :) Here's the listing of the program (Turbo Pascal) and you can clearly see in the bolded section that this would indeed be the case. Minor bug, but still works fine.

PROGRAM TSOUND(INPUT);
VAR ANS:CHAR;
BEGIN
IF ParamCount>0 THEN
ANS:=ParamStr(1)
ELSE
ANS:='T';
WRITELN;
IF (ANS='S') OR (ANS='s') THEN
BEGIN
PORT[97]:=13;
WRITE('SPEAKER NOW ACTIVE...');
END
ELSE
BEGIN
PORT[97]:=125;
WRITE('TANDY SOUND NOW ACTIVE...');
END;

WRITELN;
END.