Paprium and it's sound engine

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

themrcul
Very interested
Posts: 116
Joined: Fri Apr 15, 2016 2:21 pm

Paprium and it's sound engine

Post by themrcul » Mon Apr 03, 2017 3:29 am

Hi all,
Most of you would be aware of Watermelon's announcement of Paprium for our beloved Mega Drive.

While reading through it's webpage I noticed two things that I found very interesting about the game.

Firstly, is the large ROM size - 80MEG. I assume they are using bank switching ala SSF2 to achieve such a large ROM size? Can anyone confirm about how to make our games larger than 32MEG? Is it at all possible using SGDK?

Secondly is the sound engine - the webpage notes that it achieves more sound channels thanks to a chip on the cartridge, DT128M16VA1LT.
I have searched for more info on this chip and I can only find webpages advertising Paprium, and nothing specificly about the DT128M16VA1LT.
I am also interested in how it works. If it plays PCM samples and mixes them together, how on earth does it send the info back to the MD for playback? I have looked at the cartridge pinout and noted that sound left and right channel ins are on pins B1 and B3, respectively. But I can find no sound output back to the console from there.
Is perhaps the DT128M16VA1LT mixing all PCM sounds together and streaming data out so the 6th YM2612 channel plays just a stream of PCM playback?
Does anyone have any theories on how they are achieving so many audio channels, at such high quality?

Flygon
Very interested
Posts: 60
Joined: Mon Sep 28, 2009 11:26 am
Contact:

Re: Paprium and it's sound engine

Post by Flygon » Mon Apr 03, 2017 3:44 am

The cartridge has it's own onboard soundchip, and uses an onboard DAC to output the result through the cartridge slot's analog audio input pins.

It's entirely possible to supplement the existing sound hardware. It's why the 32x audio can wind up being spit out of the MEGA CD, and why MEGA CD audio can be spat out of the 32x!

EDIT - Cut the crap from my explanation.

themrcul
Very interested
Posts: 116
Joined: Fri Apr 15, 2016 2:21 pm

Re: Paprium and it's sound engine

Post by themrcul » Mon Apr 03, 2017 3:48 am

Hi Flygon, thanks for taking the time to reply!

So the Audio In on the cartridge pins, is actually an audio output from the cartridge into the console? Not the other way round? I assumed it was the audio generated on the Mega Drive sent to the cartridge over those pins, but it is there for audio to be generated on the cartridge and sent down those pins to be mixed with the audio from the YM2612 + PSG?

If so, that is awesome, and opens up so many possibilities for custom cartridges with amazing sound potential!

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Paprium and it's sound engine

Post by Sik » Wed Apr 05, 2017 7:34 pm

They're audio in to the console (i.e. input from the console's viewpoint), so yeah =P It's from cartridge into console.
Sik is pronounced as "seek", not as "sick".

themrcul
Very interested
Posts: 116
Joined: Fri Apr 15, 2016 2:21 pm

Re: Paprium and it's sound engine

Post by themrcul » Wed Apr 05, 2017 10:46 pm

Yeah, I've just read through some threads dating back to 2012 about putting custom chips onto MD carts for extra features, namely fast mults and divides, trig, rotation/scaling, decompression, etc.

From my perspective, I wouldn't want to deviate too far from what the original Mega Drive was capable of. And to my knowledge only two games used expansion chips of any kind on the Mega Drive (Virtua Racing and something else? but they were for graphics.).
But using sound expansion chips was relatively common on the NES, so in my mind the precedent has been set. I'm also inspired by Paprium and what they have achieved.

At the moment with the kind of games I want to make, all I think all I would want would be better/more sound.
I would love to mix in more sound channels to the classic YM2612 sound. Either just for percussion, or having some MIDI style piano or other instruments mixed in as well for a hybrid SNES/MD sound. Could be amazing!
And rather than a sound chip that shares ROM with the rest of the game, I think it would probably be better to have all PCM sound stored on a separate EEPROM (say up to 4mb), with the game and gfx/music on the EEPROM that the MD uses.
Then have a dsPIC33 or equivalent get messages from the 68000 to play sound 1/play sound 2 and it would just render the PCM sound over the cart sound lines B1 and B3. The MD would have no knowledge or ability to see the other EEPROM, the PCM EEPROM would be directly hooked up to the PIC microcontroller - and the PIC would just read messages from the 68000 to play sounds at specific points.
It could also possibly handle saving the game to SRAM and loading, but I have no idea how that could work.
But only needing to read simple messages about what sound to play would hopefully simplify the interface between the MD and the PIC on the cart - but I could be completely wrong!

I may be naive at this point in development, but I even think that if all PCM sound was stored on another EEPROM chip, then a 32Megabit cart would be enough for the rest of the data for any of the games I want to make.

I have programmed simple things on PICs before, but I have no idea how the MD would communicate with another chip on the cart. I've looked at the pinouts of the MD cart slot, but can't read half of what the pins are, and have very little electronic engineering experience (basic soldering and assembly is all!). I've read something about putting the interrupt line of the PIC up to the /TIME pin on the cart, and then being able to read stuff then, but I'm foggy on the details! I would then need to extend the XGM format to record messages that get sent to the PIC at the right time, and then some sort of editor to be able to put that data into an XGM file! The work required to achieve this is snowballing quickly!

So really, I should just focus on building my MD engine that I've been working on for almost a year now, and then the games first before being distracted by the possibility of just having nicer sound. Particularly when I have no idea what I'm doing!

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Paprium and it's sound engine

Post by Stef » Thu Apr 06, 2017 12:45 pm

Do you know that Paprium does exactly that ? separate EEPROM for PCM data so the 68000 has no direct connection to it ?

themrcul
Very interested
Posts: 116
Joined: Fri Apr 15, 2016 2:21 pm

Re: Paprium and it's sound engine

Post by themrcul » Thu Apr 06, 2017 1:15 pm

I have no idea - I wish I knew!
If I were to implement something though, that is what I would do I think. Separate ROM for the extra microcontroller.
More space in the 32MBit rom for the rest of the game, frees up the Z80 more and could be seen as an anti-piracy feature. If you don't use the real cart, you get no sound effects.
But it's all speculation for me, as I don't know how I would interface another chip using the MD cart slot. I don't know what most of the signals mean, and which ones would conflict with the 32X or Mega CD.

Would be super fun to investigate and get going I think though!

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Paprium and it's sound engine

Post by Sik » Sun Apr 16, 2017 6:26 pm

Something I've been wondering is whether the sound stuff from the chip is in large part to avoid having the mapper get in the way in the first place (since playing back PCM over the Z80 as usual requires the data to be visible to it for starters). Not exactly impossible if you're careful, but maybe it was seen as too much of a hassle.
Sik is pronounced as "seek", not as "sick".

Flygon
Very interested
Posts: 60
Joined: Mon Sep 28, 2009 11:26 am
Contact:

Re: Paprium and it's sound engine

Post by Flygon » Mon Apr 17, 2017 2:49 am

If you're manufacturing your own custom mapper, you might as well implement an 8+ channel ADPCM sound processor while the price per unit is still cheap. :P

db-electronics
Very interested
Posts: 89
Joined: Mon Feb 24, 2014 6:04 pm
Location: Kapuskasing, Ontario, Canada
Contact:

Re: Paprium and it's sound engine

Post by db-electronics » Tue Apr 18, 2017 7:56 pm

You can most definitely feed audio into the Megadrive via the SL and SR pins on the cartridge port - this is how the FM Power Base Converter works. One thing to note however is that the input impedance is dractically different on Model 1 (75 ohms) and Model 2 ( > 10Kohms) which invariably leads to audio level differences unless the cartridge automatically adjusts for this.
What does db stand for? Well that's an excellent question...
http://www.db-electronics.ca

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Paprium and it's sound engine

Post by TmEE co.(TM) » Tue Apr 18, 2017 8:23 pm

MD2 VA0 and 1 have no 75ohm loading, VA3 and VA4 do. Nomads and Genesis3s do not connect the audio lines.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

db-electronics
Very interested
Posts: 89
Joined: Mon Feb 24, 2014 6:04 pm
Location: Kapuskasing, Ontario, Canada
Contact:

Re: Paprium and it's sound engine

Post by db-electronics » Tue Apr 18, 2017 8:27 pm

TmEE co.(TM) wrote:MD2 VA0 and 1 have no 75ohm loading, VA3 and VA4 do
Really?! I'm going to have to test this tonight - I knew I bought 10 megadrives for a reason!

I also always reference the VA0 and VA1 schematics, I've never seen a Model 2 schematic with 75 ohm input loading.
What does db stand for? Well that's an excellent question...
http://www.db-electronics.ca

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Re: Paprium and it's sound engine

Post by KanedaFr » Tue Apr 18, 2017 9:49 pm

So it could explain why almost none used these SR/SL lines...
It was something which bugged me for ages....but which company would invest on a sound system which doesn't work on every hardware revision ?

themrcul
Very interested
Posts: 116
Joined: Fri Apr 15, 2016 2:21 pm

Re: Paprium and it's sound engine

Post by themrcul » Tue Apr 18, 2017 10:19 pm

Dumb question, but there is no way the game can tell if it is playing on a Model 1 vs Model 2, let alone whether it is on a VA0/1 or VA3/4 is there?

Otherwise there would have to be an option in game to change the volume of the sound chip relative to the rest of the console... that's unfortunate...

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: Paprium and it's sound engine

Post by Mask of Destiny » Tue Apr 18, 2017 10:59 pm

themrcul wrote:Dumb question, but there is no way the game can tell if it is playing on a Model 1 vs Model 2, let alone whether it is on a VA0/1 or VA3/4 is there?
Yes and no. You can tell the difference between a unit with a discrete YM2612 (Model 1 pre-VA7 and Model 2 VA2/VA2.3) and an integrated YM3438 (everything else) by seeing if you can read the status from any other address apart from $4000 (check out Eke's post on the subject). You can tell the difference between a Model 1 pre-VA6 and VA6 and alter consoles by looking at the version register. The Model 3 (and probably Model 2 VA4) can be identified by a working TAS instruction. A Model 3 VA2 can be identified by some differences in how it handles the 128KB VRAM bit.

It's possible there are other differences that are observable from software, but those are the ones I'm familiar with. Not sure how well those map to the SR/SL impedance differences though.

Post Reply