Vampi's Project2612 algorithm

From vgmrips
Jump to: navigation, search

This is the algorithm vampi uses for ripping Sega Genesis games. It can easily be adapted to other systems.

Note: The conventions used in this tutorial, such as file naming and text file format are specific to Project2612
  1. Choose game
    1. Check if game is not already ripped or in-progress, by asking on forums ( and and IRC ( #vgmrips)
      1. If already ripped, choose another game. Go to 1.
      2. If in-progress, ask about status.
        1. If status is "working on it", go to 1.
        2. If status is unclear or "stalling" or "procrastinating", rip the game yourself. This algorithm will give you enough guidance to do that properly, so you don't have to wait for the other person.
        3. If status is "stuck on something", ask on what, figure out if you have time and skill to help or take over
          1. If you have time and/or skill to help, help the other person
          2. If you don't have time or skill, go to 1.
      3. If unclear or not ripped, continue ripping
    2. Boot up game, see if it has sound test
      1. If it has a sound test menu, use that.
      2. If it doesn't, check if it has a cheat. Google for cheats or GameGenie cheats and see if there's a way to select levels
        1. If there's a way to disable sound fx, disable them
        2. If not, just start the level and try standing still, not to generate any sound fx, while the music loops
      3. If there is no sound test, and no level select cheats, you'll have to play the game to advance, use save states. This might be difficult, so decide now if you want to continue with this game or try another one.
        1. If there's a way to disable sound fx, disable them.
        2. If not, very carefully find places where the music can be listened to without any sound fx. You might have to patch the final song together from bits of music.
  2. Ripping phase
    1. Start the emulator and load the game
    2. Make sure the game is silent, then begin VGM log. Create a folder with the game name, and save the file with the song number as its name. Wait a second or two, begin the song. You may accelerate the emulator (backspace in Fusion) until the song loops at least 2 times. Then stop the VGM log (CTRL+V in Fusion) and THEN stop the song.
    3. If there are songs left, go to 2.1
    4. You now have all the songs logged. Time to trim.
  3. Trimming phase. All the batch files below can be saved and copied over each time.
    1. Output a text dump for every vgm file with this batch file (all2txt.bat):
      FOR %%A IN (*.vgm) DO vgm2txt "%%A" 0 0
    2. Create a trimming batch file by running this batch file (mktrim.bat):
      echo. > trim.bat
      FOR %%A IN (*.vgm) DO echo vgm_trim %%A >> trim.bat
    3. Go through each .txt file that we generated earlier, and, after the header, look for long Wait commands (some will be as long as 65536 samples). Find the last one and get the "total" value in the braces, near the end of the line:
    4. 0x00000046: 61 16 F9    Wait:  63766 samples (   1445.94 ms)   (total  194836 (00:04.41))

      Paste this value after the corresponding file in trim.bat

      1. For every vgm file:
        1. If it is a looping song, open a terminal (cmd or mingw) and run vgmlpfnd on it. Keep the terminal open for other songs.
          1. If vgmlpfnd outputs a range with a "!" in it, copy the two values and paste them at the end of the trim.bat line:
            Start     Time          Start     Time          Cmds    Time
            1655110 00:37.53  !     4134245 01:33.75        78703   02:30.20

            From this, copy the two Start values (1655110 and 4134245) and paste them at the end of the line corresponding to the vgm file in trim.bat. It should now have 3 values after the vgm file name, such as:

            vgm_trim foo.vgm 306688 1670694 3937437
          2. If there is no "!" line, try listening to the song and figuring out where it loops. vgmlpfnd outputs several lines usually, and one of the lines might be correct.
          3. If vgmlpfnd doesn't find anything useful, it's time to convert the vgm file to a wav file, and find the loop points using a wave file editor, such as Audacity.
        2. If it is not a looping song, use 0 as the second value, and look in the corresponding txt file for the last sample, and use that as the third value.
      2. Run trim.bat, and you should have the _trimmed versions of each song.
  4. Optimizations
    1. Run optvgm on each _trimmed file with this batch file (opt.bat):
      for %%f in (*_trimmed.vgm) do optvgm "%%f" "%%~nf.vgz" & vgm_cmp "%%~nf.vgz" & gzip.exe "%%~nf_optimized.vgm" & ren "%%~nf_optimized.vgm.gz" "%%~nf_optimized.vgz"
  5. Tagging.
    1. Find info on the game by searching GameBase, MobyGames, GameFAQs, SegaRetro, Guardiana, Wikipedia and TheGamesDB. Keep the URLs for later (perhaps by leaving the tabs open).
    2. Find the following info:
      • Game name (all releases)
      • Developer
      • Publisher
      • Date of release
      • Composer(s)
    3. Find the track names
      1. Search for official names for the soundtracks by searching on
      2. If no results come up and you used the sound test menu
      3. 1 If there are no results, use the song names from the sound test (if they are not just numbers).
      4. 2 If the song names are just numbers, use the level names.
      5. 3 If there are no level names, just use the sound test numbers
      6. If you didn't use a sound test menu, just use the level names.
        1. If the levels don't have names, just use their number.
    4. Name the files with the following format:
      NN - Track name.vgz

      Where NN is the track number (01, 02 etc.). Follow by one space, one dash and one space.

  6. Tag the files using one of these methods:
    1. Use vgmtoolbox - <a class="external free" href="" rel="nofollow"></a>
    2. Use the following script. Be sure to modify the Author, System, Year, Creator and Notes variables:
      for %%* in (.) do set Game=%%~n*
      REM SET Game=
      SET Author=
      SET System="Sega Mega Drive / Genesis"
      SET Year=
      SET Creator=
      SET Notes=
      SETLOCAL EnableDelayedExpansion
      FOR %%A in (*.vgz) DO (
      SET Title=%%A
      vgm_tag -Game:"%Game%" -Title:"!Title:~5,-4!" -Author:"%Author%" -Year:"%Year%" -Creator:"%Creator%" -Notes:"%Notes%" "%%A"
  7. Create an m3u with the following batch file (m3u.bat):
    for %%* in (.) do set CurrDirName=%%~n*
    dir /b *.vgz > "%CurrDirName%.m3u"
  8. Create a template text file with the contents:
    * Megadrive VGM music package                 *
    *                     *
    Game name:           
    System:              Sega Mega Drive
    Complete music dump: Yes
    Original author:     
    Package created by:  
    Package version:     1.00
    Files, in approximate game order:
    Name                                Length:
                                        Total  Loop
    External links:
    GameBase Megadrivemania GA_Id: 
    1. Fill in the fields in the text file: Game Name, System (if not Sega Mega Drive), Original author (Composers), Publisher, Package created by (your name or nickname).
    2. The external links that you searched for earlier, use to shorten them and paste them in the External links section. For GameBase GA_Id (Game ID), use the search box here: <a class="external free" href="" rel="nofollow"></a>
    3. If you have any notes about the game or the ripping process, add them in the "Notes:" section. You can also add, optionally:
      • Full game credits
      • Info on the emulator used
      • Info on how you ripped the songs, and any difficulties you encountered
      • Your comments on the songs
      • Any cheats you used, and an URL of the page describing the cheat
    4. Run vgm_stat <game name>.m3u and paste the song durations in the text file.
  9. Create a screenshot of the game's title screen
  10. Move the unneeded files into another folder and add this folder to a zip with the game's name.
  11. Release by posting in the forum