Jump to content
IGNORED

TIA sound polynomial counters?


Recommended Posts

I found most emulators have sound that is accurate to the hardware, and the TIA involves two channels with a 9-bit polynomial counter each. The TIA involves 16 waveshape selections, with most of them duplicated and some silent. These range from pure squares, to buzzy tones, to white noise.

 

But the problem is, every doc I found on the internet does not provide the exact timbral or feedback taps that give the sounds their accuracy. If any TIA emulator developer knows of these, let me know immediately!

Link to comment
Share on other sites

Poly counters = LFSRs (Linear Feedback Shift Register).

 

They can be replicated programatically easily. With an LFSR the existing value is shifted, 2 existing bits have a formula applied (like XOR) which is used as the incoming bit, and another bit is tapped to use in the audio algorithm.

AFAIK with Atari's use of them with TIA and Pokey the audio algorithm might either use the LFSR output directly or AND it with the flip/flop that toggles at AUDF frequency that if selected by AUDC would normally give a pure tone.

 

There's various length polys, the values generated are predictable and easily reproducable and repeat each 2 to the power of (n-1) samples.

From memory the Pokey polys update every machine cycle but the TIA ones update based on the AUDF value for each voice. The problem with updating indepdendant of AUDF is that in some situations the AUDF divisor will mean you can read the same sample which gives silent output.

 

 

Not sure if the exact LFSR algorithms are documented on a webpage but emulator source code would likely have the info required.

Link to comment
Share on other sites

The current best 2600 emulator, Stella, doesn't get it totally correct.

An upcoming version will improve the audio reproduction, but of course at the cost of using more processor power.

 

I read a long text that thoroughly explained the sound generation.

I don't remember where, but someone here may remember the link.

Link to comment
Share on other sites

IMO, none of the 2600 emulators has ever gotten this fully correct, since they were almost all based on Ron Fries sound code, which, while quite accurate, described sound at a high level, and didn't take interference patterns into account (where each channel interferes with the other).

 

There has been much work done on this over the past year. It started with a document by Crispy, then my attempt to get it working in Stella, and finally new code being added to Stellerator. This work is being ported to Stella, and will be present in the next major point release after 5.1. Some documentation on this as follows:

  • Like 2
Link to comment
Share on other sites

The only full "documentation" of the audio generation logic that I am currently aware of:

  • Crispys audio code (available in the old new-sound branch in the Stella repo on github)
  • The implementation in 6502.ts which is a straightforward port of said code
  • The TIA schematics :)

If you're curious, you can find the relevant code in Stella here and in 6502.ts here and here. I am currently in the progress of porting the rewritten audio code back to Stella.

Edited by DirtyHairy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...