Sega Master System / Mark III / Game Gear|
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats
Music - Videos - Development - Hacks - Translations - Homebrew
|Goto page 1, 2, 3, 4, 5, 6 Next|
VGM Logging with other EmulatorsPosted: Mon Oct 05, 2009 5:21 pm
Last edited by ValleyBell on Fri Feb 10, 2012 7:08 pm; edited 20 times in total
EDIT: All stuff related to Non-Sega-8-bit VGMs moved to http://vgm.mdscene.net.
Please go there for bug reports, VGM mods for emulators, etc.
The general idea is to implement the VGM-Format into emulators that don't support VGM-Files. The systems which don't have any format for game music (like nsf, gsf, ...) should have the main focus.
What do you think, which emulators should have VGM support?
EDIT: VGM Emulator-Mods (outdated)
Links to all vgm-modded emulators go here. I'll update this section when I do any updates.
Note: Many links are the same, because I just link to one folder with multiple files.
MAME [2011/11/16] (Win32 and Win64 binary, source)
MESS [2011/11/16] (Win32 and Win64 binary MESSUI version, source)
openMSX [2010/11/28] (Win32 binary, source)
Gens/GS [2011/02/19] (Win32 binary, source, r7+ Win32 binary [2011/07/31])
DOSBox [2011/02/19] (Win32 binary, source, still logs DROs, but they're now better to trim)
M1 [2011/07/31] (Win32 binary, source)
VGMPlay [2011/09/27] (Win32 binary, source)
in_vgm [2011/05/03] (Winamp Plugin, source [2010/12/27]), 0.40 alpha [2011/09/27]
VGM Pack Folder
latest VGM Spec. (1.61 alpha) [2011/09/27]
VGM logging with NeoPop
Note: NeoPop's sound timing is horrible. Please use MESS instead.
It wasn't really difficult to add VGM logging, but there are some important things to know:
1. The program versions:
- NeoPop-Win32.exe - the emulator (standard build)
- NeoPop-Win32_VGM.exe - with VGM logging (way 1)
- NeoPop-Win32_VGM-MIDI.exe - with VGM (way 2) and MIDI logging (2 years old)
- NeoPop-Win32_WAV.exe - logs all sound output
2. The 2 ways of VGM logging
1st way: Only the volume of the left channel is logged and the noise frequency is simulated.
2nd way: The left-channel-chip (tone chip) has the VGM command 0x50 while right-channel-chip (noise chip) has the unused command 0x40.
Both ways work with in_vgm, but I prefer way 1.
If there is an update of in_vgm there may be also VGM-Packs for NeoGeoPocket.
3. Other things
- I added stereo support (was easy to do)
- The VGMs are quite huge, but very accurate. There are often 4 or more volume commands within 1 frame.
In the future I may add VGM support to MAME, but I have problems with multiple chips of one type emulated at the same time.
||Posted: Mon Oct 05, 2009 6:27 pm|
VGM support in Mame would be just awesome :D
You might also look into Final Burn Alpha which emulates less systems, and already has partial CYM support if I remember correctly.
If all else fails you can also give a shot to the M1 core.
||Posted: Mon Oct 05, 2009 9:08 pm|
|If you can find me a simple emulator for the sound chip that has a liberal licence (in_vgm is somewhat breaking GPL already though) then I don't mind adding support. I'd prefer a real emulator to a "conversion" to the SN76489.|
||Posted: Mon Oct 05, 2009 11:13 pm|
|So what are some NGPx games with decent tunes?|
||Posted: Mon Oct 05, 2009 11:37 pm|
|Stereo! VGM! I love this guy. Thank you heaps for this.|
||Posted: Wed Oct 07, 2009 4:55 pm|
|Does the noise channel of the NGP chip resemble the standard SN76489 chip or the SMS clone? Or is it entirely different? (The wikipedia page has no info beyond it being a SN76489 clone)|
||Posted: Wed Oct 07, 2009 9:32 pm|
I used Sonic Pocket Adventure to test NeoPop. I think the music is nice.
Most of the tunes are ported from Sonic 3 on MegaDrive, but the Credits and Special Stage Music is unique.
Especially the Title Screen, Aquatic Relix Act 2 and the Special Stage use Stereo.
MAME has also CYM support and GYM support is already done. Yes, it's GYM, not VGM. I only wanted to hear something and GYM files have no header to care about.
I will add VGM support, when I found a way to log each emulated chip into one seperate file.
I think my programming skills are quite good and sooner or later there will be vgm logging.
||Posted: Thu Oct 08, 2009 2:58 am|
|the mame cym & gym logging only works when the game has ym2151 and/or ym2612 (respectively) audio, right?|
||Posted: Thu Oct 08, 2009 9:45 am|
I wonder if you should "cheat" and use the 2612 dac stream to store 2151 pcm streams for games such as Outrun which otherwise would be without percussions...
edit: to clarify, I know the 2151 doesn't have a pcm stream. I meant that games such as the arcade version of Outrun use an additional chip for the pcm, and it might be convenient to store it alongside the 2151 data, maybe as a separate stream using the same vgm flags as the 2612 dac.
||Posted: Thu Oct 08, 2009 8:25 pm|
then the issue is "if there's a ym2151, should we store a pcm chip no matter what that chip is?" i know capcom games use OKI(M)6295 as its pcm when using a ym2151, but what abt other games w/other pcm chips?
given that the cym format was mainly for capcom cps1 games, i propose we add the oki(m)6295 to vgm's data block format. ym2612 dac data is vgm data type $00, so the oki(m)6295 data could be vgm data type $01. vgm "seek to data offset" and "write from data and advance x samples" events should still be able to work, assuming that oki(m)6295 data is to be stored the same way as ym2612 dac data.
first above all, tho, in_vgm 2 should be updated to play ym2151 vgms again.
||Posted: Sat Oct 10, 2009 1:18 pm|
There is a tool called Musicdump by Thor that seems to dump all of the music files in an NGPC rom - could be helpful for ripping full soundtracks to VGM.
The actual file doesn't seem to be on the server so I downloaded it from an archived version of the website (hooray for Resurrect!). I also have Thor's sources for a game that uses his sound format.
VGM Logging with MAMEPosted: Mon Oct 19, 2009 1:38 pm
Last edited by ValleyBell on Wed Mar 30, 2011 10:32 am; edited 1 time in total
It' s done! MAME with VGM support and even GD3 Tags.
In the end, it wasn't as difficult as I thought. I needed some time to figure out how to get the game descriptions.
The following chips are supported:
- YM2413 (untested)
- Sega PCM
I included a small tool named PCMPlay.exe to play the bin-files until the chip are supported by the VGM format.
Also there are some limitations:
- every chip (or instance of a chip) is logged into one file
- the PCM chips are logged to .bin-files because of the missing VGM-support
- sometimes there are no delays (this seem to happen, if you play one game 2 times without closing MAME)
- the bin-files are really huge because of unoptimized logging (every memory access logs 4 bytes)
And now, let's start!
Here is the link to the compiled MAME:
And then, you can start MAME and play a game with one or more of the chips listed above ...
... and nothing will happen. There will be no logs.
Why? Logging can be turned on or off.
Just add the line
vgmwrite 1to mame.ini and it will work.
EDIT: Attachment "MAME with VGM support (source)" removed.
||Posted: Tue Oct 20, 2009 9:15 pm|
|Gorgeous! I'll try it under wine.|
||Posted: Tue Oct 20, 2009 11:25 pm|
|@valleybell - how abt you propose these changes to the mame devs themselves? r.belmont (who i used to remember seeing around project2612, but also updates his mame-related website fairly regularly) is pretty fair abt updating music-related stuff in mame.|
||Posted: Wed Oct 21, 2009 1:19 pm|
|Weird request: logging games with two PSGs to two vgm files? This would cover Systems 1, 2 and E and the SG1000 hardware.|
||Posted: Wed Oct 21, 2009 2:28 pm|
I'm so waiting for that, so I will be able to log Super Locomotive :D
However I think a revision of the vgm format is needed now. There are more and more chips (or dual chips, as stated above) which should be supported, not to mention PCM streams (which can be generalised, however). How feasible would a vgm 2.0 format be?
And yes I know that a vgm 2.0 format would call for a new in_vgm and a new VgmTool, but from what I gathered a new VgmTool is already in the works, this might be the good chance to give a solid bump to the format. And actually, instead of a new in_vgm, there could be a dedicated player, open sourced and multi platform.
Maybe I'm dreaming too much?
Oh well, while that I'm dreaming, I'd also recommend you to add the YM2610, so we could log Neo-Geo games :p
And the YM2203 would be a nice addition too, and that should be easy, since it's basically half of a YM2612.
||Posted: Wed Oct 21, 2009 4:18 pm|
I'd love to drop the legacy crap that the VGM has in it. Many of the original decisions were distinctly sub-optimal. The problems I see are:
1. Backwards compatibility. Am I going to tell everyone they need to run their files through a convertor?
2. I have no time. If someone else (who is as obsessive as me) is able to write a new plugin and a new vgmtool then that'd really help. The format has to have a quality player that is updated and has plenty of features.
3. Old files. We'd have to get Project2612 on board, for example.
4. Old emulators. It's hard enough to get logging support added, now we're going to break it?
A new extension (vgm2?) avoids some of the pain, but it's not as nice as transparent backwards compatibility. New features could exist only in the new format.
VGM nominally supports multiple tracks and/or chips by appending the files together; but I always thought that was a bad idea and have never supported it.
The new format would ideally be:
1. Chunked, to allow multiple streams of data to coexist. It'd still be one file per track, but there's be one stream per chip. This might be a bit more efficient too.
2. Interleaved. While this kind of sucks (it makes playback more complicated), it screws up any possibility to stream or decompress on the fly if you have to seek. Loggers could skip this.
3. Use a standard tag format like ID3/APE/OGG. No point reinventing the wheel.
I'd rather have a Winamp plugin.
All you need is a reasonably free chip emulator to add to the player and to define the format for the logging emulators to implement. Adding chips to the old format is (relatively) easy. Dealing with people bitching about the inaccurate chip emulator is harder.
I really need to get some quality coding time to finish up in_vgm 2.0. Pretty much all emulators seem to need to use a resampler to get decent sound out of them, and unfortunately this causes architectural (because of sample latency) and licensing (SRC is no-plugins-allowed GPL) problems. Also, "quality coding time" usually means "unemployment" and I'd rather not do that.
||Posted: Thu Oct 22, 2009 5:49 pm|
The next things I will do are to log different chips into one vgm and optimize PCM logging (if there is a memory write to address 0x05 that write byte 0x01 and the byte is already 0x01 it logs this useless command).
The PSG chip is the next chip I will add, but I'm open for requests.
And if you request chips, can you please list 1 or 2 games that use this chip? A game with the YM2413 would be also nice.
@neologix: I will talk to r.belmont when my code is more complete
@Maxim: Can you give me the source of the newest in_vgm plugin? I would add the 2 PCM chips. dsp/dsw project files would be nice. (I have VC++ 6)
I'm also interested in the source of the VGMTool.
||Posted: Thu Oct 22, 2009 9:47 pm|
You can get full lists of games which use a chip with the folder view in Mame.
A game which uses the YM2413 is Pang, which also uses an MSM6295
I'll list you some random games from my collection.
Bubble Bobble uses an YM2203 and an YM3526
Hang-On uses an YM2203 and "Sega PCM"
Knights of the Round and Pang 3 use an YM2151 and an MSM6295
Outrun uses an YM2151 and "Sega PCM"
Pitfall II and Super Locomotive use a dual SN76496
Rainbow Islands uses an YM2151 and an MSM5205
Road Runner and Marble Madness use a 6502, an YM2151, a TMS5220 and a Pokey
Snow Bros uses an YM3812
I could list more but I think these are more than enough for now :)
||Posted: Thu Oct 29, 2009 3:32 am|
|Just thought of something: what about adding VGM logging to the M1 arcade music player based on MAME? That way one could log full soundtracks easily.|
||Posted: Thu Oct 29, 2009 11:33 am|
Actually I suggested that in the first reply of this thread :p
I, too, thought that adding features to the M1 core would have been easier than implementing them into an emulator, but apparently I've been proven wrong...
Re: VGM Logging with MAMEPosted: Sat Oct 31, 2009 5:45 am
Link no longer works. Can somone please repost this?
||Posted: Sat Oct 31, 2009 9:40 pm|
|I will upload the next release in 1 or 2 days. It's almost ready.|
MAME VGM - Release 2Posted: Tue Nov 03, 2009 8:56 pm
There are many improvements since the last version.
All (different) chips are now written to one file.
Here is a complete list of supported chips:
- Sega PCM
- YM2203 (mapped to YM2612)
- YM2608 (mapped to YM2612)
- YM2610 (mapped to YM2612)
- YM3526 (mapped to YM3812)
- Y8950 (mapped to YM3812)
The RF5C68 PCM stream is still huge.
in_vgm causes Winamp to hang after a few YM3812 commands, so YM3812 logging is disabled by default. You must set vgmwrite to 2, if you want it.
I expanded the VGM specification to support all the new chips. It's an idea for version 1.51.
||Posted: Tue Nov 03, 2009 9:03 pm|
Comments on the 1.51 spec:
- The invert flag is a waste of time. As far as I know, there's no real effect on the audio and it's just a matter of which way round the audio output is connected. I guess it's there due to the original John Kortinck data analysis from years ago.
- It looks like you put the chip addresses in the right ranges, which is nice.
- Why 80 for the Sega PCM ROM data? Why not 1?
- Are you going to implement all this in a player? :)
Which version of in_vgm hangs? I recommend the last beta from http://www.smspower.org/maxim/forumstuff/in_vgm_latest/in_vgm_1_last_beta.zip .
||Posted: Tue Nov 03, 2009 10:28 pm|
This is awesome, but wait a second, how could you map the YM2608 and the YM2610 to the YM2612? They have way more channels and additional features compared to the YM2612, unless Wikipedia is doing it wrong. Wikipedia also mentions an YM3016 DAC, but I don't think I ever saw it used, and according to my MAME it's not used in any arcade game so yeah you can forget about it.
One thing you can do with little to no effort, instead, is to add support for the YM3438, which is basically identical to the YM2612.
||Posted: Wed Nov 04, 2009 8:47 pm|
Sorry, but I completety forget to add the YM3438, because MAME already maps it to the YM2612.
The other 26?? chips have commands similar to the YM2612. The other channels are controlled with commands that are unused by the YM2612.
@Maxin: I will remove the invert flag.
I use the 80, because I want to say: "It's a complete ROM dump, not a dumped stream."
I want to implement all these things to in_vgm, but I was unable to compile the 0.35 source. Some files are missing (eg. vgmcore.c and dialogues.rc).
It would be really nice to have a complete source of the newest in_vgm.
And yes, I'm using the latest in_vgm (v0.36 beta Mar 5 2008).
||Posted: Wed Nov 04, 2009 9:17 pm|
|I'll see if I can find some better source. I'm in the middle of a major refactoring to try to allow emulation at native rates with resampling, as this fixes many sound bugs, but it's been on hold for about 6 months with the code in a huge mess.|
MAME VGM PlayerPosted: Sun Nov 29, 2009 2:17 pm
I decided to write a vgm player for the VGMs logged by MAME and here it is:
ALL logged chips are completely supported and hey, it took me only 5 days to get all the chips working.
The archive also includes an update for MAME, as I removed the chip mapping.
As a demo-file, there is Magical Sound Shower from Out Run.
I wrote some tools to make trimming easier:
- a vgm2txt with support for the YM2151 and SegaPCM chips
- a SegaPCM-Update for vgm2mid
I also updated the vgm spec to support all these things.
By the way: there are some easter eggs.
- VGMPlay supports another 2 formats.
- MAME can log 2 chips of 1 type to one file supported by VGMPlay.
I hope there will be an offical update of the vgm spec soon as well as some arcade music in the VGM music section.
||Posted: Sun Nov 29, 2009 6:45 pm|
Your VGM player is awesome. Seriously. I will never stress this enough.
I already associated it to my vgm and vgz files.
What language did you use to write it?
||Posted: Sun Nov 29, 2009 10:38 pm|
|Cool, now I have some more chips to add support for in XPMCK (after I finish the YM2413 code).|
||Posted: Sun Nov 29, 2009 11:29 pm|
I need more time to work on this :(
Did you implement optvgm-style sample optimisation for the PCM?
Why does the 9.3MB download consist of 8.7MB of MAME and 0.6MB of the actual player?
Posted: Mon Nov 30, 2009 9:34 am
Last edited by ValleyBell on Mon Nov 30, 2009 8:32 pm; edited 1 time in total
I used Visual C++ 6 to write this player. I tried to do as less changes as possible to the MAME source.
The MAME update is included, because the old MAME is completely incompatible with my VGM player.
Here is the player without MAME:
All things described in the vgm spec are implemented and I tested all the chips. The only exception is the Y8950.
Some words to the INI-file:
- If you delete it, standard values would be used.
- If you set EmulatePause to True and you press Space, the chips are stiil emulated and create sound.
- I used to disable the YM2203 to turn the sounds of Bubble Bobble off.
EDIT: link updated, I forgot to include zlib
||Posted: Mon Nov 30, 2009 1:10 pm|
|Thought I should mention zlib1.dll should probably be included with player.|
||Posted: Mon Nov 30, 2009 1:21 pm|
Couple of other issue i've encountered.
If I try to use any sampling rate above 22000 I get choppy sound.
If I try to launch the player from the command line it crashes but double clicking the executable works fine.
Currently running Vista Ultimate 64bit with a SoundBlaster X-Fi card.
||Posted: Mon Nov 30, 2009 1:41 pm|
Really? That thing predates the standardisation of C++, and so has a number of bizarre bugs (broken scope on for loops being a notable one). Is there any particular reason you're using such an old version? :-)
I'm getting choppy audio (as if someone was swinging the volume control up and down as fast as they can) with the default settings (no INI file) - Vista Business 32-bit, SigmaTel High Definition Audio CODEC.
||Posted: Mon Nov 30, 2009 1:44 pm|
Advantage 1: XP ships with msvcrt.dll
Advantage 2: easy to pirate
Still, it does suck. (And I program in VC6 for work...)
||Posted: Mon Nov 30, 2009 9:19 pm|
|Player works great here, with Wine.|
||Posted: Tue Dec 01, 2009 4:28 am|
|w/o looking at the source code, i'd recommend trying to make it more cross -platform, so maybe try to get the core functionality out of vc6 and go more gcc compatible?|
||Posted: Tue Dec 01, 2009 5:36 pm|
Here's the sound bugfix for Vista. I'm sure it will work.
I had this problem with Windows 95. The sound stutters, if the audio buffer is shorter than 500 ms. This works even in Winamp.
I have no idea, why the program crashes in Windows Vista. Does the console window open, before it crashes?
And I'm sorry, I don't have Windows Vista. I can test it only with Win2000 and WinXP (and Win95).
And why I program in VC6:
- I own it (including offline help)
- it's fast (very fast, compared to VS2005)
- I hate to install things like the .NET Framework
@neologix: I'm sure the code is all in all compatible with gcc. But I don't think that there will be a release for other platforms before christmas.
Has someone already found one of the easter eggs?
||Posted: Wed Dec 02, 2009 12:14 pm|
Console window is already open as I'm running from command line... running by double clicking the executable works perfectly.
It gets as far as displaying:
I can only give you the following debug info:
Unhandled exception at 0x0040171b in VGMPlay.exe: 0xC0000005: Access violation writing location 0x00000001.
disassembly leading up to the point that crashes:
004016F4 call 00417ED0
004016F9 mov edx,eax
004016FB mov edi,425158h
00401700 or ecx,0FFFFFFFFh
00401703 xor eax,eax
00401705 inc edx
00401706 push 425154h
0040170B repne scas byte ptr es:[edi]
0040170D not ecx
0040170F sub edi,ecx
00401711 push ebp
00401712 mov eax,ecx
00401714 mov esi,edi
00401716 mov edi,edx
00401718 shr ecx,2
0040171B rep movs dword ptr es:[edi],dword ptr [esi]
Attached is the minidump
||Posted: Thu Dec 03, 2009 7:06 pm|
This bugfix should now work with Windows Vista.
I think it failed to get the name of the exe-file that is used to read the ini-file.
Thanks for the bug report. It helped a lot.
I'm interested in any special messages it may display, if you run it from the console.
||Posted: Thu Dec 03, 2009 9:48 pm|
|Well you'll be happy to know that the fix works. There have not been any other messages or issues so far.|
Posted: Fri Dec 25, 2009 11:10 pm
Last edited by ValleyBell on Wed Dec 30, 2009 3:08 pm; edited 1 time in total
I wish you all a happy Christmas.
The XMas-Release features 5 hidden songs.
Just type one of the following words instead of a filename:
I hope you also like my S3K PC: Ice Cap Zone 8-bit vgm.
Please feel free to post the words of the other 2 songs. They're easy to find, if you look into the exe-file.
I'm waiting for MAME 0.136 to update my vgm-logging MAME. The next one will support all YM-chips. (VGMPlay already supports them.)
EDIT: command-line bugfix uploaded
||Posted: Tue Dec 29, 2009 12:11 pm|
Oddly enough the crash at command line launch in Vista is back.
(clyde & rudolph)
||Posted: Wed Dec 30, 2009 6:13 am|
|I'm having the same crash, with XP SP3.|
||Posted: Thu Dec 31, 2009 3:32 am|
i like this program! simple, small, and the accurate sound of the genplus-gx ym2612 core at work.
gives me an idea for an iphone vgm player...
||Posted: Fri Jan 01, 2010 9:23 pm|
I'm really happy that you all like my program. I plan to release the source code soon, but I need to update the sound core to MAME 0.136 first.
I will upload my updated vgm player and an updated vgm logging MAME in 2 days or so.
||Posted: Sat Jan 09, 2010 11:49 am|
OK, here's the complete tool collection for VGM files 1.51.
I updated the core of MAME VGM as well as the sound core of VGMPlay to 0.136.
NeoPop writes 2-chip vgm files that are supported by VGMPlay.
Here are the links:
Source (only changed files): http://www.mediafire.com/file/jzgj2q45cxz
NeoPop (vgm logging):
One last note: I reinserted the PSG flags. Maybe it's fun to play around with them. It should be also possible to detect the exact PSG type from these flags.
||Posted: Tue Feb 02, 2010 6:35 pm|
|This all seems too good to be true.. However as a future request would it be too much trouble to write a wave dumper that works like Winamp's disk writer? Some of us like to keep lossy encodes for portability purposes ;) Recording in real-time ala M1 can be painful.|
|Goto page 1, 2, 3, 4, 5, 6 Next|