Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Questions about Meka and VGM Logging

Reply to topic
Author Message
  • Joined: 28 Nov 2014
  • Posts: 365
Reply with quote
Questions about Meka and VGM Logging
Post Posted: Sat Feb 21, 2015 6:48 pm
I had a question about Meka and how it works. I wouldn't be surprised if it doesn't have an easy answer, but wanted to make sure.

My main question is if VGM logging in meka can be triggered by a simple write flag or series of value changes and stopped similarly. There is currently no hotkey for starting stopping, which adds a bit to the work necessary to log vgms. Not difficult by any means, but attempting to automate some of it is made much more challenging due to that lack of a feature.

I tried using an external viewer to winnow down on the changes, but my tests merely crashed the emulator. I haven't returned to testing again, but I wanted to ask the author himself. Is there anyway other than having something like autohotkey control the mouse etc...cause that is more laborious than i hope for. Not sure it would be worth the effort in general, but it would be nice to setup an external tool with all the valid song values and increase after a bit of time has passed or the sound engine has stopped. I could do this without stopping logging, but it would be nice to be able to start stop rather than having a long single file I need to break up. I guess that wouldn't be too bad for organizing.

So that's my main question: is there anyway to trigger vgm logging on and off outside using the menu manually? No vgm logging emulator currently has this feature.

Another question since I have you, is I've wondered, why meka only logs vgm version 1.10 when Maxim was responsible for the vgm specs up to 1.50. Since you guys are part of the same community, I found it a bit peculiar. Technically the 1.10 is sufficent for sms logging, and the only missing feature that might sometimes be useful is the loop modifier value in the header, but files can be upgraded using other tools. I 've been wondering, maybe the timeline, or maybe support for vgm and meka haven't been as closely linked as i imagined?

I hope you'll be able to answer some of these questions. Thank you very much for your contributions to the site and community.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14685
  • Location: London
Reply with quote
Post Posted: Sat Feb 21, 2015 7:06 pm
The development is definitely not linked.

Use F12 to freeze the game and also freeze logging if active. This lets you set a breakpoint or whatever to intercept a music change, and start VGM logging instantaneously. You still have to go into the menu, though.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Sat Feb 21, 2015 7:07 pm
I can add a keyboard shortcut to start/stop VGM logging, that is absolutely trivial.

I am not sure how you'd be able to tell that the music has stopped so easily. Meka doesn't have a fancy way of scripting and accessing the runtime data live (like some NES emulators have with a LUA virtual machine).

If you knew some C/C++ you could probably tweak Meka to ease your work but in the meanwhile I can add a keyboard shortcut. If you can think if something else let me know..
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Sat Feb 21, 2015 7:18 pm
I uploaded a new build you can start stop VGM logging by pressing ALT+V

http://www.smspower.org/forums/13019?start=300#84872

I added support for VGM early on but haven't followed on the development. My impression is that using the vgm tools created by Maxim and others was a necessity to create a quality package, so the files would also pass through those tools anyway. So it looks like there's no need for an improvement on Meka side?
  View user's profile Send private message Visit poster's website
  • Joined: 28 Nov 2014
  • Posts: 365
Reply with quote
Post Posted: Sun Feb 22, 2015 12:04 am
Wow! Who knew it would be so easy :) Thanks!

The new emulator seems to have an odd bug where I can't change screens/tabs in the memory editor to any of the other windows besides ram. Not sure if the recent change caused the issue. The shortcut works fine.

Ah. It makes sense that support was only added early on. I guessed that might be the case. VGM spec is currently at 1.71. Most of that is other systems that have nothing to do with SMS related chips. There are a few features such as loop modifiers that I've had to make use of on at least a few occasions (and I haven't worked on hundreds of packs) so it might be useful. But as you said, there are tools available. I normally don't have any reason to hex edit a vgm, but the first time I did, I was confused by the very small header. 1.51 includes some SN76489 flags and 1.60 includes some volume and loop base/loop modifiers that are useful on some occasions, but there are tools to deal with that, and I do think it's nice that the sms logs aren't cluttered with info related to other systems although I have worked on those other systems, and dont find in to cumbersome to navigate.

So maybe it's better the way it is. 1.50 adds data block support and handling of YM2612 PCM data, neither of which is really needed for the vgm logs hosted here. So it might be better to leave as is since a flurry of new chips are added between 1.51 and 1.61.

On the other issue, although I am happy with the manual shortcut (sans unexplained bug) I was actually hoping to have an option of triggering the command via memory write (using external tool). As mentioned, some memory search utilities have lua capability. I've used it for simple single writes that weren't too complicated, but it wouldn't be difficult to load some of the data recently compiled into the wiki source into an array and having a script run through each iteration. Not sure the payoff when manual logging isn't too inconvenient (now made a bit easier). I generally recommend using F12 before logging as it keeps the start of the playback within 2 frames, often 1. This speeds up things considerably when trimming, as that's one less value that needs to be searched.

I am rethinking my original thoughts about it being better to have a file separated per song. Since automated logging presumably has little oversight, the time to deal with the particulars might come later.

With the hotkey, that is one less dificulty in using a tool like autohotkey. (And manual is now easier!)


I just confirmed that you can change the value of the selected rom in the load window (Rom id in list starts at 2, at 1 in memory), press enter, and the corresponding rom will load. I suppose getting things to work exactly would be up to editing the source, but I am not an a skilled programmer. so I am exploring things within my skillset. I'm willing to expand a bit where necessary. Actually, I think the latest meka source is hosted on svn, which I don't think I currently have a tool to access. But I will look at the .73 source to answer some of my questions where possible.

So I guess (sorry for these zany questions) my current remaining question is if there is a way to trigger the loading of a rom by modifying a value in memory. The current solution is adequate for more convenient manual logging, and allows an easy(er) implementation of automated tools. But if there is a "load rom trigger" and a "log vgm" trigger I can do it all within one tool in lua. I don't think think the tool supports apllication switching or keyboard shorcuts in lua.

Just ideas. Sometimes Iogging and trimming are done back to back so quickly and effectively that there would be no advantage to automatic logging. Other times, there would be. Plus, I would probably have logged more if it were possible to have it automated while I work on something else, or run a quick errand. Or not be required to interrupt what I am doing or have to listen to it. It would be nice to isolate logging from the general process of building a vgm pack.

At least theoretically I could load a directory with roms with triggers, and have some bots go through each item in the list, running thorugh all the values. Currently trimming can be quick or very time consuming, but logging is always time consuming and the area in least need of oversight. You might need some when it comes to QA and checking if anything needs redoing or was missed. This might be another of those ideas where (for me) it's too much work and little obvious benefit, but I can imagine it being very useful to have a dozen or more logged games ready for processing, and making the decision on which to process based on how well the tools interact with it rather than being merely the latest acquisition. A pack with 15 songs can take less than an hour to trim, and one with only 4 several, if there are issues with one or more of its songs that require careful sleuthing.

Thanks for the friendly gesture and quick response!
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Sun Feb 22, 2015 11:06 am
Memory Editor works here, weird. Could you try again with a few different games?

Meka 0.73 is REALLY old. Get yourself a SVN checkout such as RapidSVN or TortoiseSVN to browse the code.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Nov 2014
  • Posts: 365
Reply with quote
Post Posted: Sun Feb 22, 2015 4:49 pm
update: Finally got around to testing a hunch. I changed the resolution to ~ 800 x 600 and it works fine. I got used to clicking underneath pretty quickly, no longer necessary.


Ok. I got rapid svn since its exectuable was smaller; downloading.

The issue seems to be a bit more than that. I think the issue is I cannot change tabs using the mouse. There is a similar issue with joypad configuration window. I can't click the arrows to change the current control 1/2/etc. But I can change they joypad type and other things. If I click disable, it moves to the next joypad so there is that workaround.

//
Otherwise seems to work fine. I can click in the memory and use the arrow keys to navigate and change it, but I cannot access other tabs, so pause hack is out except with an external tool. Are there hotkeys available to switch between the tabs?
//
NM. It works but I have to click below (one line's height) and it works.
Just curious. Not sure if it is related to the fact I have a touchscreen. Or was there a mini change somwhere and there is a difference between the graphics on screen and their logical mapping?


On another note, since this was so easy for you to change, would you be able/willing to add a hotkey to hotswitch between default speed and a high speed? I hold down F3/F4 to scroll through the speeds quickly, but it would be nice to be able to toggle between 400hz and the default (50/60) according to type. Since others might not want to use 400 (and it may not always be the best setting in other uses) would it be possible to have a key that toggles between the default and last/current speed i.e if at 200hz and press it goes to 60 press again goes to 200.

This would probably be a bit more useful than the manual logger, since not being able to swich quickly sometimes leads to mistakes in logging. I suppose f12 could do, but there is the added issue (I may be wrong) that at high speeds 2 frames of silence are often logged before the music starts. This may be a pergame issue. but in general, I set the speed to default of slower, freeze, start the log, set the trigger, unfreeze, incremement to max speed, wait, lower speed, stop logging, repeat. I normally get only one frame of silence when the speed is not ramped up, but this could be game specific. Not a big deal, but it adds a bit of noise and one extra thing to check if a loop point is detected earlier than 3 frames. I don't worry about that if I know there is only one frame of silence before the start. It would be nice to switch easily without minding the numbers. I sometimes make mistakes (forgetting it is still on hight speed) and have to stop the log, delete the file and restart. Not terrible, but a hotkey toggle would help.


Thanks
  View user's profile Send private message
  • Joined: 28 Nov 2014
  • Posts: 365
Reply with quote
Post Posted: Tue Apr 21, 2015 9:59 pm
edit: Based on a friendly suggestion, I am eliminating the long wall of text intended as an exposition and just sticking to the basics.

My desire:
I was wondering if it was possible to start/stop vgm logging based on changing a single value in RAM.

The reason: Because vgmlpfnd works better with files when logged individually and that makes the logging process easier for me.

Currently I have to choose between a time laborious process of logging each vgm manually and having vgms which are more troublesome to process. If you factor in the ~80 sets that will be worked on for GG in the near future, this issue starts to become wearisome in the long term. It becomes frequently painful when working with SMS/SG sets. I have been avoiding work with them lately for this reason.

So any help here would be greatly appreciated.
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!