Vampi's Project2612 algorithm

From vgmrips
Note: This tutorial has been retired in favor of the universal R(er)ipping for the Out-of-Element Contributor. It's retained for historical purposes.

This is the algorithm vampi uses for ripping Sega Genesis games, modernized by (Jazz) Jackalope. It can easily be adapted to other systems. For more detailed information on these steps, see R(er)ipping for the Out-of-Element Contributor.

  1. Choose game
    1. Check if game is not already ripped or in-progress, by looking in the list of Packs, on the forums (particularly, the Work-in-progress forums and Offical Pack WIP topic), or by asking in IRC (irc.digibase.ca #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. Check 50Hz Mega Drive Games to see if the game does/might need to be ripped at 50hz/PAL/Europe settings
    3. 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.
      3. Or the game might be hackable. (See Defeating Checksums to see how to bypass ROM checks.)
        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
      4. 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. Use BlastEm only for Genesis/Mega Drive games. (Read the emulator's wiki page to learn how to set up the screenshot and VGM recording paths so you can find the files easily)
    2. Start the emulator and load the game
    3. If the game needs to be run in 50hz, make sure BlastEm is displaying ~50fps
      1. If it's not, make sure you're using the European version of the game
      2. If no Europe-only dump exists, try running BlastEm in Europe mode:
        1. Use the command line or place the following in a .bat file in BlastEm's folder to run this command:
          blastem -r E
        2. If the game refuses to play, you may need to hack it or ask for help hacking it. Do so or return to 1
    4. Make sure the game is silent, then begin VGM log (m in BlastEm). Wait a second or two, then begin the next unlogged song. You may accelerate the emulator (+ to increase and - to decrease speed) until the song loops at least 2 times, plus some extra. Then stop the VGM log (m again) and THEN stop the song.
      1. While recording, you can rename the files to help you keep track of important information.
    5. If there are songs left, go to 2.4
    6. 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 before the song begins playing and get the "total" value in the braces, near the end of the line:
      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. Before proceeding, play and listen to each _trimmed VGM to check if the trim points are correct. If any points are not correct:
      1. Repeat step 3.3.1.1.3 (even if the file does not loop) for each wrongly trimmed song until you find the correct points. (For unlooped songs, you may need to extend the end point until all sound is included)
      2. Update each line in trim.bat with the new points. Rather than run trim.bat again, you may use each updated line in the terminal instead.
      3. Repeat 3.4 until all trimmed files sound correct.
  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 vgmdb.net
      2. If no results come up and you used the sound test menu
        1. Use the song names from the sound test (if they are not just numbers).
        2. If the song names are just numbers, use the level names.
        3. If there are no level names, just use the sound test numbers
      3. 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. Ensure all files are named with the following format:
      NN Track name.vgz

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

    5. Tag the files using one of these methods:
      1. Use vgmtoolbox - <a class="external free" href="http://sourceforge.net/projects/vgmtoolbox/files/" rel="nofollow">http://sourceforge.net/projects/vgmtoolbox/files/</a>
      2. Use the following script. Be sure to modify the Author, System, Year, and Creator variables:
        for %%* in (.) do set Game=%%~n*
        
        SET Author=
        SET System=SMD
        SET Year=
        SET Creator=
        
        SETLOCAL EnableDelayedExpansion
        FOR %%A in (*.vgz) DO (
        SET Title=%%A
        vgm_tag -Game:"%Game%" -Title:"!Title:~5,-4!" -Author:"%Author%" -Year:"%Year%" -Creator:"%Creator%" -System:%System% "%%A"
        )
      3. Individual tracks can later be given track-specific Notes like in-game usage and sound test numbers. This information is appreciated but optional. Info applying to all tracks should be placed in the text file below. To add notes in vgm_tag:
        vgm_tag -Notes:"%Notes%" "%%A"
        This will replace any existing note, but prepending and appending options exist.
  6. Create an m3u with the following batch file (m3u.bat):
    for %%* in (.) do dir /b /on *.vg* > "%%~n*.m3u"
    
  7. Create a template text file with the contents:
    ***********************************************
    * VGM music package                           *
    * https://vgmrips.net/                        *
    ***********************************************
    Game name:           
    System:              Sega Mega Drive/Genesis
    Music hardware:      YM2612, SEGA VDP PSG
    
    Music author:        
    Game developer:      
    Game publisher:      
    Game release date:   
    
    Package created by:  
    Package version:     
    
    Files, in approximate game order:
    
    Name                                Length:
                                        Total  Loop
    
    Notes:
    
    External links:
    GameFAQs: 
    SegaRetro: 
    GiantBomb: 
    Wikipedia: 
    Guardiana: 
    MobyGames: 
    TheGamesDB: 
    GameBase Megadrivemania GA_Id: 
    
    1. Fill in the fields in the text file: Game Name, System (if the game was only released in one region or you needed to record in 50hz, remove Mega Drive or Genesis accordingly), Music author (Composers), Developer, Publisher, Package created by (your name or nickname), Version.
    2. Check the chips used in the file info of your VGM Player. These are likely to just be YM2612 and Sega VDP PSG (given as simply "Sega PSG"). If they are different, change the line to match the reported chip info.
    3. The external links that you searched for earlier, use bit.ly 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="http://chiptune.ninja/gamebase/?system=Megadrivemania" rel="nofollow">http://chiptune.ninja/gamebase/?system=Megadrivemania</a>
    4. 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
    5. Run vgm_stat <game name>.m3u and paste the song durations in the text file.
  8. Create a screenshot of the game's title screen (one for each region with a different title screen)
    1. Use any of FileOptimizer, ImageOptim, or Trimage, or an equivalent to compress all screenshots as small as possible
  9. Move the unneeded files into another folder and add this folder to a zip with the game's name
  10. Release by posting in the Submissions forum