Skip to content

S98 tools

What kind of tools? For converting S98s to VGM :v

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

  • User avatar
  • tails_ Offline
  • Posts: 170
  • Joined: 2012-03-18, 16:59:23
  • Location: Tomsk, Russia
  • Contact:

Post by tails_ »

OK, posted on dmpsoft's BBS.
  • User avatar
  • drdevil Offline
  • Posts: 73
  • Joined: 2015-08-30, 14:24:00
  • Location: Scotland
  • Contact:

Post by drdevil »

When converting an S98 to VGM, the first FM note does not play. Why is this? Or am I just not converting it properly? Or is my VGM player not playing it correctly? :bash:

I have attached the original S98 file and the VGM file for reference.
Attachments
manji_07.S98
(271.9 KiB) Downloaded 396 times
manji_07.vgm
(286.44 KiB) Downloaded 405 times
I'm HarmoDevil. Formerly Dr Devil, but I still use the drdevil username here.

Check out my Soundcloud.

I might get back to VGM ripping someday.

Post by Kaminari »

Did you record it yourself, or is it an existing S98 rip? I've found that many old S98 files don't convert properly to VGM, even with the Japanese tool S98v1tov3 (S982VGM only supports v3 version, if I'm not mistaken).
  • User avatar
  • drdevil Offline
  • Posts: 73
  • Joined: 2015-08-30, 14:24:00
  • Location: Scotland
  • Contact:

Post by drdevil »

It was an existing rip.

Hopefully, in the future, someone will modify the program so that old .s98 files will convert to .vgm properly. :(
I'm HarmoDevil. Formerly Dr Devil, but I still use the drdevil username here.

Check out my Soundcloud.

I might get back to VGM ripping someday.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

There are two things that can cause oddities:
  1. The YM2608 can run in YM2203 mode and does this by default (like the OPL2 fallback on OPL3). S98 files seem to lack the YM2608 enable command pretty often. (56 29 80 in VGMs)
    I'm pretty sure this is the issue, btw. You can fix this by hex-editing the VGM. (I think just overwriting the first command should work.)
  2. The VGM you posted has LOTS of commands at sample 0. This might be due to the way the S98 was trimmed. MAME's sound emulators sometimes don't like that. (I didn't see any KeyOn command before the loop point though. Those cause the most problems, so it should work.)
From what I could see in a vgm2txt, the song doesn't seem to use the extra YM2608 channel at all, except that it sends a few KeyOff commands to those channels. (VGM file offset 0x55D to 0x572) I assume that if you would remove those, you could as well make a YM2203 VGM.
  • User avatar
  • drdevil Offline
  • Posts: 73
  • Joined: 2015-08-30, 14:24:00
  • Location: Scotland
  • Contact:

Post by drdevil »

Sounds like good ideas to me. Unfortunately, I'm not very good at hacking so it will take a long time before I fully understand the ideas. :lol:
I'm HarmoDevil. Formerly Dr Devil, but I still use the drdevil username here.

Check out my Soundcloud.

I might get back to VGM ripping someday.
  • Ancient Offline
  • Posts: 10
  • Joined: 2017-11-28, 19:45:47
  • Location: Tokyo, Japan

Post by Ancient »

Hi,
S982.exe 0.3 is newest?

I have Hoot's ssg_mix information.
It is parameter for fmgen's psg.cpp


void PSG::SetVolume(int volume)
{
double base = 0x4000 / 3.0 * pow(10.0, volume / 40.0);
for (int i=31; i>=2; i--)
{
EmitTable = int(base);
base /= 1.189207115;
}
EmitTable[1] = 0;
EmitTable[0] = 0;
MakeEnvelopTable();

SetChannelMask(~mask);
}


>pow(10.0, volume / 40.0)

It means 2 x power decibel.

derived these value
PC-8801 10^(-2/40) -> 89.1 %
PC-88VA 10^(-4/40) -> 79.4 %
PC-9801-26(K) 10^(-13/40) -> 47.3 %
PC-9801-86 10^(-18/40) -> 35.5 %
  • Ancient Offline
  • Posts: 10
  • Joined: 2017-11-28, 19:45:47
  • Location: Tokyo, Japan

Post by Ancient »

>I did convert some Sharp X1 s98 files (PSG only) with S982, but it has become a treble.

Some Hoot's S98-out have problem.

I did S982 with -hootx1 option.

The output's VGM header reports,
YM2151 -> 4MHz
YM2149(AY-3-8910) -> 4MHz <- It's wrong, It must be 2MHz.

I patched to wrong VGMs, it become correct sounds.
  • Ancient Offline
  • Posts: 10
  • Joined: 2017-11-28, 19:45:47
  • Location: Tokyo, Japan

S98toVGM converter C lang version

Post by Ancient »

I wrote C version converter.
It was still under development, and not supported multi-chip.

Usage
S982VGM filename [master volume] [ssg volume]

volume option needs percent value.
master volume changes VGM header's VolumeModifier.
ssg volume changes Extra header's Volume.

I'll attach binary and source.
Source code needs vgmtools's header.
I was compiled by VC2017
Attachments
S982VGM.zip
(14.01 KiB) Downloaded 378 times
S982VGM_src.zip
(3.72 KiB) Downloaded 341 times
  • Ancient Offline
  • Posts: 10
  • Joined: 2017-11-28, 19:45:47
  • Location: Tokyo, Japan

Post by Ancient »

New version of S982VGM.
I've implemented dual-chip feature but not yet tested. :wink:

These features not yet supported.
DATA block
ADPCM
TAGs
Attachments
S982VGM_src.zip
Source Code
(4.81 KiB) Downloaded 370 times
S982VGM.zip
Binary
(14.99 KiB) Downloaded 409 times
  • Ancient Offline
  • Posts: 10
  • Joined: 2017-11-28, 19:45:47
  • Location: Tokyo, Japan

Post by Ancient »

As is well known, the Hoot's S98 output resolution is only 10/1000.
But it can modify to high resolution via binary patch.

The corresponding binaries are as follows.

68 E8 03 00 00 6A 0A 6A

PUSH 1000
PUSH 10
PUSH ~

to

68 00 EE 02 00 6A 01 6A

PUSH 192000
PUSH 1
PUSH ~

There are 46 corresponding binaries on Hoot 2017/12/31 version.
This will increase the resolution to 1/192000.
However, there may be some conflict with the driver of Hoot and the playback speed may be wrong.
Especially, I'll not recommend 1/44100 or 1/48000.
In addition, I do not know players of S98 which supported 1/192000 resolution.
But, You can convert this S98 to VGM via S982VGM.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

I'm a bit late, but thanks for all your hard work!

The volume algorithms are really useful (I'll use them sometime to make a proper list of VGM volume values.) and the Hoot patch is very neat.


I have a small question that is only slightly related: Do you know where I can find S98 files that use sound chips other than OPNA?
I was only able to find S98 files that use OPNA, YM2149 PSG and OPM. I haven't seen any S98 that uses e.g. a chip from the OPL series.

Post by RandomName »

OPL3DEMO S98 from Programming Terrace Wiki

Post by RandomName »

You can also convert OPLx DRO/VGM to S98. Just do a search on Ru^3 Honpo for "Update 2011/01/04". The filename is s98v3conv_110104.zip
  • Basillica Offline
  • Posts: 4
  • Joined: 2019-11-16, 16:24:50

Post by Basillica »

Are rips created with PMD2S98 -> s982.exe acceptable for uploading, or do they have to be logged from an emulator?

What issues are there when converting "older OPN PMDs" with PMD2S98?
Post Reply