My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
SMV151  
Updated Sep 3, 2009 by justinhc...@hotmail.com

#smv is the movie capture format of Snes9x emulators

SMV 1.51 file format description

The format is very similar to the SMV 1.43 format with only the following changes:

The version byte at 004 must be 4 instead of 1

The byte 016 bit 0 (MOVIE_SYNC2_INIT_FASTROM) has no meaning and should be 0.

The byte 017 bit 1 (MOVIE_SYNC_WIP1TIMING) now has no meaning and should be 0.

The byte 017 bit 7 is now MOVIE_SYNC_NOCPUSHUTDOWN. 0 means the "SpeedHacks" config option is on, 1 means it is off. (This option is off (=1) by default, and turning it on means a different (usually laggier) timing.)

The header has an additional 32 bytes at the end:

    020 4-byte little-endian unsigned int: number of input samples, primarily for peripheral-using games
    024 2 1-byte unsigned ints: what type of controller is plugged into ports 1 and 2 respectively: 0=NONE, 1=JOYPAD, 2=MOUSE, 3=SUPERSCOPE, 4=JUSTIFIER, 5=MULTITAP
    026 4 1-byte signed ints: controller IDs of port 1, or -1 for unplugged
    02A 4 1-byte signed ints: controller IDs of port 2, or -1 for unplugged
    02E 18 bytes: reserved for future use

The header size is thus 64 bytes as opposed to 32 bytes. The only difference this makes for existing programs that deal with v1.43 SMV files is that, if they need to look at the metadata (author info), they must look for it at 0x40 instead of 0x20. The first 32 bytes in the header were not rearranged, and locating the controller and save data is unaffected because those are not stored at absolute file positions. Controller data format Also, while the meaning of controller data for a single standard SNES controller pad remains the same, each frame of controller data can contain additional bytes if input for peripherals is being recorded.

Here is how to calculate the size in bytes of a frame or sample of controller data in a v1.51 SMV:

  sizeof(InputSample) == 2*number_of_controllers + 5*num_mouse_ports + 6*num_superscope_ports + 11*num_justifier_ports

where

  number_of_controllers == the sum of the bits in byte 0x014 in the header.
  num_mouse_ports == the number of bytes 0x024 - 0x025 inclusive that are 2=MOUSE
  num_superscope_ports == the number of bytes 0x024 - 0x025 inclusive that are 3=SUPERSCOPE
  num_justifier_ports == the number of bytes 0x024 - 0x025 inclusive that are 4=JUSTIFIER

The total number of these samples stored in the movie is given by the number at 0x020 in the header. This should be the number of movie frames if no peripherals were used, or higher if peripherals were used. There is considerable redundancy in the controller data stored in a peripheral-using movie, but presumably it compresses well, and the length in bytes of an input sample continues to be uniform for a given movie.

Comment by kendo1p...@yahoo.co.jp, Aug 9, 2010

了解


Sign in to add a comment
Powered by Google Project Hosting