VGM or TFM with PCM?

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

TechnoZealot
Interested
Posts: 30
Joined: Mon May 06, 2013 2:27 am
Location: Vermont, USA

Post by TechnoZealot » Fri May 17, 2013 4:06 am

A lot of commercial games for MD/Genesis tend to have sampled drum sounds in their soundtack. How was this achieved? That's mostly all of what I'm interested in, but the occasional sampled sound I'm sure can also be done. Just take a look at Shinobi III to see how they did both sampled drums in their music and a healthy variety of sampled game sounds. They had a very cool system where you could override the drums by doing certain moves continuously at the right times.

Is it likely that they were utilizing the Z80 for this? I mean I can try dumping the instructions for the Z80 with genskmod but not sure how far i'll get with that.

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

Post by TmEE co.(TM) » Fri May 17, 2013 11:10 am

I don't think any game used 68K do to samples ingame, it is hard to get good quality and have time left for a game.
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

eteream
Very interested
Posts: 81
Joined: Tue Dec 22, 2009 2:13 pm

Post by eteream » Fri May 17, 2013 8:37 pm

..
Last edited by eteream on Sat Jul 20, 2013 8:30 pm, edited 1 time in total.

foobat
Very interested
Posts: 92
Joined: Fri Sep 14, 2012 1:06 pm

Post by foobat » Sun May 19, 2013 8:10 am

I believe the z80 almost exclusively plays music in the Sonic games. It sits in a tight loop manipulating the ym2612 and sn76489, usually using the vblank interrupt for timing. The ym2612 does have timers, but it takes a lot of cycles to check them and can slow down playback and reduce the complexity of the songs you can play.

The z80 has direct access to its own 8k of RAM and will usually store the entire sound driver with samples in there. In order to play back samples the z80 will read the first byte of the sample from its RAM, write 0x2A (the address of the channel 6 DAC register in the ym2612) to 4002h, then write the byte you read from RAM to 4003h. Then you move your pointer to the next byte and after a certain amount of time elapses (maybe doing other audio work during the downtime) you repeat this process.

Some bootstrapping has to be done on the ym2612 to get it into the right mode to begin playing pcm samples.

It's actually really hard to do this in real-time from scratch.

Chilly Willy
Very interested
Posts: 2591
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun May 19, 2013 6:02 pm

foobat wrote:Some bootstrapping has to be done on the ym2612 to get it into the right mode to begin playing pcm samples.
Which is why some VGM streams don't play PCM on real hardware - they forgot that the PCM shares hardware with FM channel 6, and they don't do the commands needed to switch between the two. A prime example is VGM-MM doesn't init the PCM or do the switch commands, so you only get FM and no PCM. Deflemask originally had the same problem, but I worked with the author to fix that.

TechnoZealot
Interested
Posts: 30
Joined: Mon May 06, 2013 2:27 am
Location: Vermont, USA

Post by TechnoZealot » Tue May 21, 2013 6:57 am

I read something very interesting on BigEvilCorp's blog post here (http://bigevilcorp.wordpress.com/2012/0 ... -psg-chip/) about using the PSG to play PCM. Would that be an option? This would also free up all six channels of the YM2612 for business. Of course you would have a single bit depth for all samples played through it, but for in-game sounds, this might be useable.

foobat
Very interested
Posts: 92
Joined: Fri Sep 14, 2012 1:06 pm

Post by foobat » Wed May 22, 2013 10:15 am

using the PSG to actually play music is more valuable than having an extra channel on the ym2612 in my opinion, and the 2612 dac is way more useful. In a pinch I guess you could do some simple high-frequency sound effects with 1-bit pcm, but it won't be enough for percussion.

http://www.youtube.com/watch?v=xNWv7htg7_c

User avatar
kubilus1
Very interested
Posts: 221
Joined: Thu Aug 16, 2012 2:25 am
Contact:

Post by kubilus1 » Sat May 25, 2013 3:30 pm

A lot of games do use sampled sounds for drums (or record scratches for ToeJam & Earl), on the z80 with the Yamaha chip. Road rash does not use any PCM samples, at least in all the VGM tracks I've dug through.

r57shell
Very interested
Posts: 475
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Mon May 27, 2013 2:03 am

Toejam & Earl in Panic on Funkotron uses GEMS Sound Driver.
You can found sound driver list for example here:
http://gdri.smspower.org/wiki/index.php ... ngine_List
And here sorted by engine version:
http://elektropage.ru/r57shell/sounde_e ... sorted.txt

Now I'm working on GEMS toolkit, of course not official :Y
Here: http://github.com/realmonster/GEMS
Status: in progress, so now not enough work done. But it's allmost done :).

Many games uses PCM for SFX. You can reserve FM 5 for SFX, but it's not cool, so "cool" driver "watch" over FM 5, and when no SFX played, then play drums. If drums played, and some SFX need to start, then stop play current drum, and start SFX.

GEMS more than... GEMS know everything about channels status at every moment. For playing notes/samples GEMS uses Dynamic Voice Allocation. Right! When driver needs to play note, he search for suitable channel, and use it.
See how it works :) http://www.youtube.com/watch?v=iQjfjEHVnGY
Image

TechnoZealot
Interested
Posts: 30
Joined: Mon May 06, 2013 2:27 am
Location: Vermont, USA

Post by TechnoZealot » Wed May 29, 2013 11:36 am

Wow! :shock: This is really good stuff! Thanks r57shell!

I wonder how they even gathered all of the information to make this table.

r57shell
Very interested
Posts: 475
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed May 29, 2013 1:02 pm

TechnoZealot wrote:Wow! :shock: This is really good stuff! Thanks r57shell!
Thanks for what?
TechnoZealot wrote:I wonder how they even gathered all of the information to make this table.
Who they? Which table?
If you about Jukebox in video - it is my code. GEMS v2.8 - original code, more about GEMS see topic: viewtopic.php?t=1349.
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests