I've been updating the z80 VGM driver to be a bit faster and add some new features. Just so you guys don't think I've forgotten about the project, here is a quick demo of what I have.
This is quite a bit more efficient than the old driver and should support the older 1.5 style PCM samples (using 0x8n opcodes) at 8khz. This should be pretty good as is for this kind of playback.
I've also added rudimentary sound effects support as well. The sound effect must be an 8khz unsigned 8 bit PCM. Wav files could be converted with the following ffmpeg command:
The sound effect will effectively take over the PCM channel for the duration of the PCM playback. I'm not totally happy with the results, but it is a nice improvement over the old driver.
Green Hill Zone - A 1.6 VGM track with PCM samples that are referenced by 0x9n style calls.
ToeJam Slowjam - A 1.5 VGM track that starts out without PCM samples, but uses channel 6 for part of the music. Sound effect must return the state of channel 6 after finishing playback.
Elevator Beats - A 1.5 VGM track that consists almost entirely of PCM.
Pacific Coast - A very busy VGM track, no PCM.
Redwood Forest - Busy VGM track with a *ton* of banking.
Yeah, sorry I wasn't clear. With the old VGM formats for PCM your first did a 0xE0 followed by a location into PCM memory, then you followed it with 0x80-0x8F where the first nibble says to play one PCM byte and the second is how many samples to wait.
1.6 added the ability to just enable playing the PCM and to set the length to play and just execute a single 0x93 or 0x95 instruction to start the playback. The playback then occurs during 0x6n style sample waits, effectively.
The long and short is the VGM files can be a lot smaller.
Yes! This is a drop in replacement for the existing vgm driver in sgdk. I have a patch against sound.c as well that will add the sound effects playback. I'll post it when I get back from work this evening.
So you recommend Deflemask for composing new VGMs? Will the driver be able to take pretty much anything from Deflemask or are there limitations or settings to keep in mind?
It should be able to take pretty much anything from Deflemask with the caveat being the samples are 8khz. Otherwise, I've been able to play anything I've composed, plus sthe samples from Deflemask that I've tried.
I understand that there are some other good VGM tools as well, but they don't work on Linux, so I haven't used them.