Jump to content



1

How exactly does the Pitfall 2 DPC work?


8 replies to this topic

#1 Ben_Larson OFFLINE  

Ben_Larson

    Moonsweeper

  • 336 posts
  • Location:Columbus, OH, USA

Posted Fri May 15, 2009 9:47 PM

I recently acquired a Pitfall 2 cartridge, and having remembered that it uses a proprietary chip for the sound, I became curious as to how exactly it works.

From looking through the Stella archives, I gather that it generates sound waveforms by changing the sound register volume every scanline. I guess I'm wondering how exactly that's done though. Is the chip, like, intercepting dummy instructions on the fly and replacing them with real instructions to load/store the next value in the sound register?

#2 grafixbmp OFFLINE  

grafixbmp

    Dragonstomper

  • 659 posts
  • Location:South Central US

Posted Fri May 15, 2009 10:44 PM

I've rather been curious as to the features the pitfall 2 chip had as well. I knew about it's sound features but not how they worked. And someone told me that it also had a truer RND but it was only used for the eel flicker. Other than this, I have no clue. Has there ever been a comprehensive breakdown of the chip? If so, is there a link?

#3 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Fri May 15, 2009 11:44 PM

I'd be interested to see new games using this chip.

Even a Pitfall 3 (renamed of course to avoid legal issues) would be great.

#4 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,236 posts
  • begin 644 contest

Posted Sat May 16, 2009 12:30 AM

View Postgrafixbmp, on Fri May 15, 2009 11:44 PM, said:

I've rather been curious as to the features the pitfall 2 chip had as well. I knew about it's sound features but not how they worked. And someone told me that it also had a truer RND but it was only used for the eel flicker. Other than this, I have no clue. Has there ever been a comprehensive breakdown of the chip? If so, is there a link?
You can search for the patent on the chip (#4644495) which I think gives a high-level description of the various functions. I didn't find the patent quite as useful as emulator source code when trying to figure out how the DPC worked so I could simulate it in hardware (the Harmony cart is the only cart that can simulate the DPC chip, or at least the only one that has.)

The DPC has some features that are not used by Pitfall II. I'm not certain what all of those are. My own breakdown of the various functions is as follows, at least as used in Pitfall II:

Read registers:
$1000-$1004: Random number generator. Reads return an 8-bit random number.
$1005-$1007: Music fetcher. Reads return the current amplitude of the multiple-voice music waveform that will be written into the 2600's sound volume register. Typically this will be read at least once every scanline.
$1008-$100F: Display data reads. Reads from one of 8 data streams containing graphics, and increments the graphics pointer.
$1010-$1017: Display data reads ANDed with flag. Reads from one of 8 data streams containing graphics, ANDs the data with a flag, and increments the graphics pointer. Flag is $FF if the low byte of the graphics pointer is between "top" and "bottom" register (see below) or $00 otherwise (this isn't the whole truth - if the low byte of the pointer is stored to a value between "top" and "bottom" then the flag will be $00.)
$1018-$101F: Same as $1010-$1017, but nybbles are swapped. Not used by Pitfall II.
$1020-$101F: Same as $1010-$1017, but bits in the byte are reversed. Not used by Pitfall II.
$1018-$101F: Same as $1010-$1017, but byte is shifted one bit right. Not used by Pitfall II.
$1018-$101F: Same as $1010-$1017, but byte is shifted one bit left. Not used by Pitfall II.
$1038-$103F: Return the current value of the flag. Apparently not used by Pitfall II.

Write registers:
$1040-$1044: Write to "top" register.
$1045-$1047: Write music frequency of channel 1-3. Frequency is 20 kHz/value
$1048-$104F: Write to "bottom" register.
$1050-$1057: Write to low byte of graphics pointer (pointer is an address in a 2k graphics ROM)
$1058-$105C: Write to high byte of graphics pointer (appears to only store the lower 3 bits)
$105D-$105F: Control byte for music channel (on/off)
$1060-$106F: Apparently not used by Pitfall II, but may have another function.
$1070-$1077: Random number reset. Apparently not used by Pitfall II.
$1078-$107F: Apparently not used by Pitfall II, but may have another function.

There is also a "draw line" function that is not used by Pitfall II. It apparently calculates a value to store in HMOVE to help with drawing lines. I think it may have been originally designed for a vine but that never made it to the game.

Edited by batari, Sat May 16, 2009 12:55 AM.


#5 Propane13 ONLINE  

Propane13

    Stargunner

  • 1,385 posts
  • Location:Philly

Posted Mon May 18, 2009 11:17 AM

View Postyuppicide, on Sat May 16, 2009 12:44 AM, said:

I'd be interested to see new games using this chip.

I don't think that's 100% possible. From what I remember, there's 2K of ROM data in there that's specific graphic information for Pitfall 2.
However, a derivative of the chip-- possible, but probably expensive.

-John

#6 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Mon May 18, 2009 11:57 AM

Interesting to hear all this. But if there's 2k of specific Pitfall 2 data, maybe it can be used to make PF3. I loved PF2 much better than 1. I never liked any version after 2 that I've seen.

#7 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,236 posts
  • begin 644 contest

Posted Mon May 18, 2009 1:14 PM

View PostPropane13, on Mon May 18, 2009 12:17 PM, said:

View Postyuppicide, on Sat May 16, 2009 12:44 AM, said:

I'd be interested to see new games using this chip.

I don't think that's 100% possible. From what I remember, there's 2K of ROM data in there that's specific graphic information for Pitfall 2.
However, a derivative of the chip-- possible, but probably expensive.

-John
You should learn about the standalone Harmony (do not confuse this with the Harmony developer's cart.)

The stanalone Harmony already supports the DPC chip, including its 8k game data and 2k graphics, and should eventually house single homebrews, so you could make new homebrews based on this chip, and it shouldn't be any more expensive.

Edited by batari, Mon May 18, 2009 1:15 PM.


#8 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Mon May 18, 2009 8:25 PM

I am well aware of the Harmony and am awaiting it's arrival. :) I'd probably take two of them.

#9 maiki OFFLINE  

maiki

    Moonsweeper

  • 394 posts

Posted Wed Jun 29, 2011 8:07 PM

The background music sounds somewhat scratchy in Stella in both NTSC and PAL versions. You can clearly hear interruptions in the tune (not presented in the C-64 version for instance...). Is that a limitation of the actual DPC hardware or just a bad emulation?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users