Skip to content

MAME/MESS VGM mod

Current version: 0.256 (released on 2023-06-28)

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

Moderator: Staff

Post by Kaminari »

:homer:

Maybe I don't get it, but why would you want to log Amiga music in VGM?
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Yeah, I didn't make a new VGM modded MAME for quite a while.
I have yet to convince myself to install their most-recent toolchain. (They seem to redo their toolchain every few months.)
  • Arbee Offline
  • Posts: 1
  • Joined: 2016-08-17, 21:01:18
  • Contact:

Post by Arbee »

MAMEdev has flipped the script on this - the next version will *play* VGM/VGZ rips.
  • TEOL Offline
  • Posts: 6
  • Joined: 2013-05-25, 16:31:02

Post by TEOL »

Kaminari wrote::homer:

Maybe I don't get it, but why would you want to log Amiga music in VGM?
I listen to them in native but the VGM Rips website only does VGM.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

This still leaves the question: Why you would want to have VGMs of Amiga MOD files?
(Logging MODs to VGM is pretty pointless IMO, since MOD is 1. the more popular format and 2. can be played back perfectly without emulation.)
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

And for the games that don't have MOD format music, UADE supports a *lot* of various Amiga sound formats, even playing them back using their original sound driver.

There is a MOD to VGM converter, but it was mainly designed for people wanting to play back MODs on a real MSX with the Moonsound expansion cartridge.
  • Alianger Offline
  • Posts: 81
  • Joined: 2016-05-13, 23:55:38

Post by Alianger »

So how do I use this? I just want to check what sound chip these games are using for now:
Main Event, Gradius III, Devastators, MIA, SPY, Punk Shot

Edit: Ok so it's in the machine info. Didn't see a chip mentioned for Main Event though, is it samples only then?

Post by Kaminari »

Like Gradius 3, I believe the audio chip of Main Event is a Konami K007232.
  • Alianger Offline
  • Posts: 81
  • Joined: 2016-05-13, 23:55:38

Post by Alianger »

Yes, though Gradius III also uses YM2151. I guess TME is samples only then, but it doesn't quite sound like it to me.
https://www.youtube.com/watch?v=F8kGukHeuzo
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

I posted this previously on IRC, but since I still have trouble getting my current MAME VGM mod to work correctly, I'll just leave this here.

MAME 0.181 VGM mod beta: Win64 Binary / Source Diff.
It's "beta", because dumping the sample ROM doesn't work for half of the chips due to me having trouble to figure out how to dump the data.
The MAME devs did some significant changes to the internal structure and I still don't know how to obtain the actual sample ROM size.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

I posted this some time on IRC, but I forgot to post it here.

MAME 0.188 VGM mod beta: Win64 Binary + Source Diff.

It is complete in terms of features (i.e. all chips logged by MAME 0.164 are properly logged in this version), but I consider this sort of a beta because of only one reason:
For chips with sample ROMs it likes to crash. A lot.

On my development machine there was a very high chance of MAME crashing shortly after starting the game, right at the point where the sample ROM is dumped. (Even though I don't really do it differently than in MAME 0.164.)
For some reason, running MAME with the debugger enabled seems to reduce the crashes a bit.
The only good thing is, that if it passes the point where the sample ROM is written, it seems to run pretty stable.

Anyway, enjoy ripping.
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Well, here we have MAME VGM mod 0.200, see OP. I also added the source for MAME 0.192 and 0.196 mods, in case anyone is interested.

To me it still crashes a lot, often before emulation starts, but it doesn't seem to be the VGM logging code. (It usually crashes inside some LUA scripts.)
As a small bonus, it includes ctr's QSound HLE core, which also improves QSound VGM logs a lot.

Happy ripping!
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Since JonKaruzu asked for it, I compiled a 32-bit version of the MAME 0.200 VGM mod and added it to the OP.
It might have a few more bugs than the 64-bit version though - I had to disable a few warnings that MAME team marked as critical in order to make it compile. (i.e. I compiled it with "make NOWERROR=1".)

Unable to compile MAME 200 in Ubuntu 18.04

Post by RandomName »

I'm unable to compile the VGM mod MAME 200 with either GCC or Clang.

I applied the VGM and Qsound diffs and uncommented NOWERROR = 1 in the makefile.

Here are the error messages.

Clang 6.0

Code: Select all

Done. Generated 347/347 projects.
Compiling src/lib/util/vgmwrite.cpp...
../../../../../src/lib/util/vgmwrite.cpp:189:68: error: must explicitly qualify
      name of member function when taking its address
  ...FUNC(vgmfile_callback), this));
     ^    ~~~~~~~~~~~~~~~~
          VGMTimer::
In file included from ../../../../../src/lib/util/vgmwrite.cpp:11:
In file included from ../../../../../src/lib/util/../../emu/emu.h:29:
../../../../../src/lib/util/../../emu/debug/../emucore.h:220:17: note: expanded
      from macro 'FUNC'
#define FUNC(x) &x, #x
                ^~
1 error generated.
utils.make:645: recipe for target '../../../../linux_clang/obj/x64/Release/src/lib/util/vgmwrite.o' failed
make[2]: *** [../../../../linux_clang/obj/x64/Release/src/lib/util/vgmwrite.o] Error 1
Makefile:25: recipe for target 'utils' failed
make[1]: *** [utils] Error 2
makefile:1302: recipe for target 'linux_x64_clang' failed
make: *** [linux_x64_clang] Error 2
GCC 7.3.0

Code: Select all

In file included from ../../../../../src/lib/util/../../emu/emu.h:29:0,
                 from ../../../../../src/lib/util/vgmwrite.cpp:11:
../../../../../src/lib/util/vgmwrite.cpp: In constructor ‘VGMTimer::VGMTimer(running_machine&)’:
../../../../../src/lib/util/vgmwrite.cpp:189:73: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function.  Say ‘&VGMTimer::vgmfile_callback’ [-fpermissive]
 timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(vgmfile_callback), this));
                                                                     ^
../../../../../src/lib/util/../../emu/emucore.h:220:18: note: in definition of macro ‘FUNC’
 #define FUNC(x) &x, #x
                  ^
utils.make:645: recipe for target '../../../../linux_gcc/obj/x64/Release/src/lib/util/vgmwrite.o' failed
make[2]: *** [../../../../linux_gcc/obj/x64/Release/src/lib/util/vgmwrite.o] Error 1
Makefile:25: recipe for target 'utils' failed
make[1]: *** [utils] Error 2
makefile:1280: recipe for target 'linux_x64' failed
make: *** [linux_x64] Error 2
VB edit: I moved the post into the MAME topic. (Aside from that, it was out of place in the "Problems and Suggestions" forum, which is mainly for website stuff.)
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

In src/lib/util/vgmwrite.cpp, please try to replace this line

Code: Select all

		m_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(vgmfile_callback), this));
with this

Code: Select all

		m_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(VGMTimer::vgmfile_callback), this));
and tell me if that fixes the issue.

The former line is actually incorrect. I'm not sure why MinGW GCC 7.2.0 didn't catch that issue.
Post Reply