Sound bits

Discussions on programming older machines

Re: Sound bits

Postby deathshadow60 » Thu Mar 10, 2011 11:57 am

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.
The only thing about Adobe web development products that can be considered professional grade tools are the people promoting their use.
deathshadow60
 
Posts: 62
Joined: Mon Jan 10, 2011 6:17 am
Location: Keene, NH

Re: Sound bits

Postby Trixter » Fri Mar 11, 2011 8:58 am

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).
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 523
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Sound bits

Postby KenG » Tue Dec 06, 2016 7:00 pm

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.
Enhanced PCjr with a jr-IDE (1GB DOM) and a parallel port side car with a compact flash reader and backpack 1.44mb floppy attached. Tandy video mod.
KenG
 
Posts: 149
Joined: Sat Jul 16, 2016 5:36 pm

Re: Sound bits

Postby Vorticon » Sun Jan 29, 2017 7:02 pm

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.
Vorticon
 
Posts: 276
Joined: Fri Nov 27, 2009 7:25 am

Previous

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron