Although I'm more interested in 2600 development than 7800 development, I've had an idea for a POKEY alternative for 7800 developers. My intention would be to release an open-source framework that other developers could build upon if desired.
The GADGETT (Great Audio Doesn't Get Easier Than This) would be an 8-pin DIP Cypress microcontroller which would be programmed with a small bootloader and would attach to a few pins on the 7800 bus. The part in question costs $2.50 in quantity 100 and could be added to a 7800 cart with no other components required except a one or two resistors.
I've sketched out the CPU/RAM requirements and would expect the following to be workable:
- Six-voice wave-table synthesizer; each voice would mix two 256-byte wave tables in arbitrary proportion, and both mixers would be controlled by independent envelope generators. Maybe vibrato/pitch envelopes as well--not sure about that one.
- Two digitized waveform channels, with arbitrary playback speed, looping, and event queueing. Wave data could be 4- or 8-bit.
- Probably about 12K of flash available for wave and envelope tables, digitized waveforms, high scores, etc.
To make something like a piano sound, one could load two waveforms--one for a "bright" piano wave and one for a more mellow wave, and two envelopes--one with a quick decay and one with a slower decay. Attach the first wave to the first envelope and the second to the second envelope. When a note was played it would start with a bright sound and fade into a mellower one.
To produce speech, one would have to store digitized phonemes in memory and then queue up a list of events to play them. Since the player would support looping, vowel sounds would not need to take up huge amounts of space. Alternatively, one could simply store spoken messages although 12K of storage wouldn't be a whole lot for that.
I don't want to go so crazy on the specs that I can't get the thing done, but I don't want to make something so wimpy that it's not worth using. If the micro features a write-protected bootloader, code in the 7800 could pump it with whatever sound generation software and wave tables were desired. I could supply a binary code image for a decent sound generator, but if anyone wanted to write their own they could.
In bootloader mode, one would send/receive a byte of data from the GADGETT using something like the following:
; Write the byte in the accumulator; read a byte into the accumulator sta temp asl asl asl asl sta $8000 ; GADGETT latches data on D4 and outputs data through a resistor on D0 lsr $3F ; Or some other unused address ror sta $8000 lsr $3F ror sta $8000 lsr $3F ror sta $8000 lsr $3F ror lsr lsr lsr lsr sta temp2 lda temp sta $8000 lsr $3F ; Or some other unused address ror sta $8000 lsr $3F ror sta $8000 lsr $3F ror sta $8000 lsr $3F ror and #$F0 ora temp2
A little clunky, but not totally outrageous. Once the music player was started, it would switch to using both D0 and D4 as inputs from the 6502 thus allowing two-byte commands to be transmitted quickly:
sta $8000 lsr sta $8000 lsr sta $8000 lsr sta $8000 txa sta $8000 lsr sta $8000 lsr sta $8000 lsr sta $8000
Anyone like the concept?