Jump to content
IGNORED

Pitfall 2: How does the sound travel from the cart?


ElectricTroy

Recommended Posts

AFAIK (and IIRC ;)) the chip on the cart doesn't produce any sound but (somehow) triggers the original audio hardware.

 

UPDARE: I have searched a bit, here is what the author of PCAE writes:

"A note about Pitfall II: Lost Caverns: this game, unlike all other Atari 2600 games, has a special chip that contains 2k of extra data in addition to the standard 8k. It also contains three random number generators and a three-channel square wave generator."

 

Every scan line the program code reads the contents of the generators and puts it into the volume registers.

  • Like 1
Link to comment
Share on other sites

Basically, how does the sound "get out" of the cart, through the 2600 console, and to the speakers?  

 

Is there an extra wire on the Pitfall 2 connector that carries sound?

 

Thanks.

 

The exposed edge of the printed circuit board (PCB) of the Pitfall II: Lost Caverns cartridge has 24 connector contacts, the same as any other Atari 2600 cartridge. There are twelve contacts on the top side of the cartridge PCB and twelve on the bottom side. These 24 contacts line up with and connect to the 24 contacts of the cartridge slot mounted on the Atari console motherboard.

 

Of the 24 contacts:

 

- 12 contacts are used as Address Lines for accessing each of the 4096 byte locations within a 4K ROM. It takes 12 bits of addressing combinations to uniquely address all 4096 ROM locations, and therefore there is one connection per addressing bit.

 

- 8 contacts are used as Data Lines for sending a full byte of data to the TIA chip, which resides on the Atari console motherboard and which is responsible for translating that byte of data sent from the cartridge into video and sound signals.

 

- 4 contacts are reserved for voltage and ground to power up and enable the ROM chip inside the cartridge.

 

 

Therefore, even if the Pitfall II cartridge had an "extra wire" (connector?), it would have no corresponding connector available on the Atari motherboard to connect to.

 

The secret to the sound produced by Pitfall II lies within a custom chip, designed by David Crane himself, which is added onto the PCB inside the cartridge. The chip contains square wave generators, whose signals are superimposed onto the 8 output Data Lines on the cartridge PCB. The enhanced signals are then fed into the TIA chip onboard the Atari motherboard and the enhanced sound signals are interpreted and analog sound signals are generated from there. Of course, actual sound is not produced until those analog sound signals are fed to your speakers.

 

 

Ben

Link to comment
Share on other sites

The enhanced signals are then fed into the TIA chip onboard the Atari motherboard and the enhanced sound signals are interpreted and analog sound signals are generated from there.  Of course, actual sound is not produced until those analog sound signals are fed to your speakers.

 

Of course. I should have said "audio" not sound. So the process is this:

 

CART has a specialized chip to produce audio data

---->

[CPU reads data from the cart's chip]

---->

2600 has sound chip Tia to convert that data to audio

---->

RF CABLE carries audio signals to speakers

----->

SPEAKERS convert audio to sound.

Link to comment
Share on other sites

audio 1 : of or relating to acoustic, mechanical, or electrical frequencies corresponding to normally audible sound waves which are of frequencies approximately from 15 to 20,000 hertz

 

sound 1 a : a particular auditory impression : TONE b : the sensation perceived by the sense of hearing

Link to comment
Share on other sites

  • 10 years later...

Hmmm... At my computer on a Sunday morning an unrelated search turned up this post - 10 years later. But the DPC chip sound generators were such a fun circuit I will explain them here (remembering the good times as I relate the story) in case anyone is still interested.

 

The 2600 had the ability to use the TIA sound chip as a 4-bit D to A (digital to analog converter). One turned OFF the TIA's square wave audio circuit - leaving it in a logic "1" state - and adjusted the 4-bit volume control. Set the volume to 0 and the DC level of the output of the sound chip is zero. Set the volume to $0f (1111) and the DC level output of the sound chip is at maximum. Modulate the audio output between the 16 values of $00 to $0f and you could generate a waveform. With this method one could create almost understandable speech - with the consequence of stopping the game and turning off the display since the CPU's entire processing time would be taken up by the process.

 

For the DPC I designed 3 independent, free-running clock dividers similar to the two in the TIA itself. One sets a divide counter value and divides the system clock by n to create a square wave in the audible range. Once set, there are 3 asynchronously running square wave pulse streams being generated which, if you could hear them would be audible tones.

 

So now the big question: How to get those tones from the cartridge and into the TIA chip (and ultimately to the TV's speaker)?

 

This was accomplished first with combinational logic that simulated an adder circuit. The best way to understand this circuit is to imagine that the first of the bit streams has a value of 6; the second a value of 5; and the third a value of 4. So the first bit stream is outputting: 0,0,0,0,0,6,6,6,6,6,0,0,0,0,0,6,6,6,6,6... and so on.

 

Now add the three numbers together.

 

A1 A2 A3 Value

0 0 0 0

0 0 4 4

0 5 0 5

0 5 4 9

6 0 0 6

6 0 4 10

6 5 0 11

6 5 4 15

 

The result is a 4 bit number that represents the mixing of 3 independent tones. It even has the added benefit of providing different relative volumes between the tones. Channel one is slightly louder than the rest, so is used for melody. The other two channels have the right volume mix for harmony and base.

 

Now, how do we get this 4 bit value into the TIA? The 4-bit value is presented to the CPU bus through an address on the DPC chip. In other words, if the code reads a specific address the value changes each time it is read as the data changes with the music. One could simply set up an infinite loop of "LOAD ADDRESS, STORE VOLUME" and three-part harmony music will play out of the TV speakers.

 

But that is not very useful. If all the CPU is doing is reading and writing audio samples, there is no display and no game. So I had to introduce a sampling system. If that "LOAD/STORE" could be performed at least as often as every scan line of the TV signal the audio would be updated at a sampling rate of 15,750 Hz. This is sufficient to achieve reasonable fidelity.

 

Using that fact, I inserted that "LOAD/STORE" into every line of the display kernel, every game play subroutine, every line of setup, vertical sync, overscan, etc. I often had to put multiple LOAD/STORES into long calculation routines to make sure that the sample rate was kept up. If not, the music would begin to get fuzzy or even introduce harmonics between the notes and the sample rate. With a little trial and error I was satisfied with the quality of the musical score in Pitfall II.

 

I created the DPC chip because the poor old 2600 had lasted years past the lifespan anyone had ever hoped for it. And if we were going to keep making games for the system it needed a bit of a facelift. Sadly, after Pitfall II, sales of 2600 games finally fell below the point where a game could be made profitably. It would have been fun to see what else we could have done with the technology.

 

David Crane, August 2013

 

P.S. The TIA has two audio channels, and among the built-in 'tones' available is a noise generator. While the first TIA audio channel was busy working as a D to A, I used the second audio channel in noise mode to create a snare drum track. But any time the game needed to produce a sound effect - like Harry's jump - I needed that sound channel. Has anyone ever noticed that the snare drum goes away whenever the game plays a sound effect?

  • Like 32
Link to comment
Share on other sites

Hmmm... At my computer on a Sunday morning an unrelated search turned up this post - 10 years later. But the DPC chip sound generators were such a fun circuit I will explain them here (remembering the good times as I relate the story) in case anyone is still interested.

Cool!

 

Did you know that more and more modern homebrews (e.g. Space Rocks) are using the DPC (actually in an ARM driven enhanced version called DPC+)? Suitable not only for music, but for all TIA registers.

 

In Space Rocks, effectively only the kernel (and vertical sync) is written in 650x assembler. Almost everything else is C code now, which handles the game logic and prepares the queues for the kernel.

Edited by Thomas Jentzsch
  • Like 1
Link to comment
Share on other sites

I created the DPC chip because the poor old 2600 had lasted years past the lifespan anyone had ever hoped for it. And if we were going to keep making games for the system it needed a bit of a facelift. Sadly, after Pitfall II, sales of 2600 games finally fell below the point where a game could be made profitably. It would have been fun to see what else we could have done with the technology.

 

As Thomas has mentioned, a group of us have worked up a sequel to DPC that we've called DPC+. This topic goes over the features. Some of the key things are:

  • Processing can be offloaded to a 70 MHz ARM during Overscan and Vertical Blank processing
  • 24K (six 4K banks) for 6507 and ARM code
  • 4K Display Data (initial state is stored in ROM, but working copy is in RAM so contents can be changed at run-time)
  • 3-voice digital music with custom waveforms
  • Fast Fetch mode for 2 cycle reads of the DPC+ registers

DPC can draw and color a sprite in 14 cycles:

 LDA DF0DATAW
 STA GRP0
 LDA DF1DATA
 STA COLUP0

 

The Fetch Fetch mode works by overriding LDA #. This means we can now draw and color a sprite in 10 cycles:

 LDA #<DF0DATAW
 STA GRP0
 LDA #<DF1DATA
 STA COLUP0

The final version of Space Rocks, including source, can be found in this blog entry. If you have a Harmony Cartridge you can try it out in real hardware. You can check it out via Stella as we've added DPC+ emulation to it. Space Rocks is being released at PRGE so you can check it out there as well. Another game will be announced at PRGE - it really shows off DPC+ music with custom waveforms.

  • Like 2
Link to comment
Share on other sites

Just wish David had given us the ability to turn off the music via difficulty or B/W switches. I loved the game, but always played it with sound muted.

I like the "happy" tune so much that I'd purposely stand there and wait until it ends to pick up another treasure. Also, I never did notice the snare drum cutting out at all. I was too involved with playing the game!

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...