Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.msdos.programmer > #4181

Re: is there a high-frequency timer available on the PC? (besides the PIT)

From rridge@csclub.uwaterloo.ca (Ross Ridge)
Newsgroups comp.os.msdos.programmer
Subject Re: is there a high-frequency timer available on the PC? (besides the PIT)
Date 2022-08-19 15:25 +0000
Organization Aioe.org NNTP Server
Message-ID <tdoa0p$1831$1@gioia.aioe.org> (permalink)
References <tdieam$4gt$1@gioia.aioe.org>

Show all headers | View raw


Mateusz Viste  <mateusz@xyz.invalid> wrote:
>So here's the question: Is there any kind of timer available on the PC
>that would allow to generate some 8 kHz samples?

Yes, the PIT.  You can't generate a 8000 kHz timer exactly, but you can
come close enough (8008 Hz).

> - PIT (18.2 Hz default, changing it doesn't work under Windows)

Changing it works just fine under Windows, as demonstrated by countless
MS-DOS games.  Try Star Control 2 for example, it uses tracker based
music, mixed in real-time on the CPU on most soundcards.  Probably a
lot like what you're trying to do.

One important thing do is to chain the original BIOS handler at the rate
it expects.  The easest way to do this it add your PIT reload value
(149 for 8kHz if I've done my math correctly) to a 16-bit variable on
every interrupt and then call the old handler when it overflows.

-- 
 l/  //	  Ross Ridge -- The Great HTMU
[oo][oo]  rridge@csclub.uwaterloo.ca
-()-/()/  http://www.csclub.uwaterloo.ca:11068/
 db  //	  

Back to comp.os.msdos.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

is there a high-frequency timer available on the PC? (besides the PIT) Mateusz Viste <mateusz@xyz.invalid> - 2022-08-17 12:01 +0200
  Re: is there a high-frequency timer available on the PC? (besides the PIT) Johann Klammer <klammerj@NOSPAM.a1.net> - 2022-08-17 19:02 +0200
  Re: is there a high-frequency timer available on the PC? (besides the PIT) rridge@csclub.uwaterloo.ca (Ross Ridge) - 2022-08-19 15:25 +0000
    Re: is there a high-frequency timer available on the PC? (besides the PIT) rridge@csclub.uwaterloo.ca (Ross Ridge) - 2022-08-19 19:44 +0000
      Re: is there a high-frequency timer available on the PC? (besides the PIT) Mateusz Viste <mateusz@xyz.invalid> - 2022-08-19 22:16 +0200
        Re: is there a high-frequency timer available on the PC? (besides the PIT) "Alexei A. Frounze" <alexfrunews@gmail.com> - 2022-08-19 21:20 -0700

csiph-web