ValleyBell / libvgm

A more modular rewrite of most components from VGMPlay. will include sub-libraries for audio output, sound emulation and VGM playback
irc://irc.digibase.ca/#vgmrips
140 stars 33 forks source link

Wrongly played MSX2 track #106

Open vitamin-caig opened 1 year ago

vitamin-caig commented 1 year ago

Here the full pack: https://vgmrips.net/packs/pack/snatcher-msx2

Twilight of Neo Kobe City track sounds different via libvgm and site player.

Here the reference: https://www.youtube.com/watch?v=KbbF9odLDxI

ValleyBell commented 1 year ago

Hmm...this is actually a bug in the VGM.
The VGM sets the "SCC+" (K052539) mode flag, but it assumes that channels 4+5 share their wave RAM. (SCC non-plus/K051649 mode)
It never writes the 5th channel's wave RAM, so that channel goes silent.

This used to work fine in the old VGMPlay due to an implementation oddity. The actual solution should be to fix the VGM. (changing byte 0x9F in the VGM from 80 to 00)

vitamin-caig commented 1 year ago

I.e. this is invalid rip? I suppose youtube version is from real console (or emulator at least) due to quite low quality.

ValleyBell commented 1 year ago

The rip itself should be mostly okay. There is just a wrong flag set in the VGM header, but this can be easily patched afterwards.

I'll probably go further and just check+update all the SCC packs though.

grauw commented 1 year ago

Snatcher is an SCC+ game, so the flag is correctly set, but it sounds like the commands used are wrong.

ValleyBell commented 1 year ago

Okay, so then the pack is bad. I checked a few tracks and they all write only to the wave RAM of the first 4 channels. (using the SCC non-plus commands)


This issue has one good side though: This confirms that libvgm now behaves like VGMPlay MSX with incorrect SCC/SCC+ flags. (which is a good thing, as it makes incorrect VGM rips more obvious)

grauw commented 1 year ago

Ping @sdsnatcher73.

sdsnatcher73 commented 1 year ago

Most likely the issue is then originated in NEZplug v0.9.4.8 + 2 + 19.20 which was used to create the VGM's. It probably does not log the wave data correctly.

sdsnatcher73 commented 1 year ago

01.vgz.zip Here is the unmodified vgz as ripped with NEZplug, for analysis.

sdsnatcher73 commented 1 year ago

I guess kss2vgm (used for SD Snatcher) does log correctly, but officially we're not supposed to use that, right?

sdsnatcher73 commented 1 year ago

New version logged with kss2vgm. Please let me know if this works better... Snatcher (MSX2, PSG+SCC-I).zip

vitamin-caig commented 1 year ago

New version logged with kss2vgm. Please let me know if this works better... Snatcher (MSX2, PSG+SCC-I).zip

Yes, looks like problem is solved. At least, I can't hear any significant difference between reference and updated version