This format exists to simplify hexediting, since manually hexediting the binary
GM2 format is non-trivial. This format will consist of only ASCII characters
and will be very easy to edit with any text-manipulation tool. Gens will
be able to read from and write to this format natively.
Because it is intended for editing, this format will not contain any
corruption detection measures such as a CRC checksum.
Line separators may be either unix-style ('\n') or DOS-style ('\r\n').
Because this chunk is intended for editing, all data will be encoded into
human-editable text. The format will appear as follows, one line for each
field:
8-character chunk name ('frames ')
recorded controlers ('controllers_recorded:1,1,1,0,0,0,0,0') *
controller types ('controller_types:2,1,2,0,0,0,0,0')
Note: Because editing is likely to change the number of frames, the frame
count is explicitly excluded from this data. It must be derived
from the number of frames.
Note: The values on the 'controller_types' line represent the following
controllers: 1, 2, 1b, 1c, 1d, 2b, 2c, 2d.
After this, the chunk will contain frame data conforming to the following
BNF description:
lines := lines line |
line |
"!" "\n"
line := frame-comment ":" button-lists "\n"
frame-comment := non-colon-char frame-comment |
""
non-colon-char := a-zA-Z0-9,./<>?;'"{}[]\|~!@#$%^&*()_+=-
button-lists := button-lists "," button-list |
button-list |
""
button-list := controller-number button-chars
controller-number := 1-8
button-chars := button-chars button-char |
""
button-char := UuDdLlRrAaBbCcSsXxYyZzMm
It is recommended that Gens store the number of each frame before the colon
to make editing simpler, however Gens must ignore this information when reading
the file
because editing may cause it to become inconsistent.
The end of this chunk will consist of an ASCII exclamation mark at the end of a line.
Button presses are stored in comma separated strings consisting of 1 character for controller number and 1 or more characters for buttons pressed. Controller number must be
an ASCII character 1-8. Valid characters for button are u,d,l,r,a,c,b,s,x,y,z,m (case insensitive). In the event of a frame showing the same controller number in multiple segments, only the
last segment for each controller will be used.
All of the following are valid frames:
45:1abud
painintheassframe:1ab,2d,1alb,1alaU
foobar:1u
:
?!?!;:1a,2cu,3l,6r
xyz:
foo:1bar,2cab
this_is_the_last_frame:1ab!
[
1]: Sound rate should not affect synchronization. --
Bisqwit
- In an utopian world maybe, but should not and does not aren't the same thing. Both Gens and Snes9x have troublems where sound output affects emulation, but shouldn't. 44100 should always be the preselected in Gens, but that is an emulator implementation and not a format dito. -- Truncated
- In my opinion, sound output should NEVER affect emulation. Instead of adding that header, fix the "sound ouput that affects emulation" problem. Hax like that won't resolve the problem. -- Phil
[
2]: I think the chunk ID should be restricted into ASCII bytes. This avoids inconvenient byte/character length confusions that may apply in fixed-width fields.
Also you should specify the padding used (spaces?). And direction of padding? --
Bisqwit
- Changed chunk ID to ASCII (I think it was that previously). Padding is specified as seen in every chunk (spaces at the end). -- Truncated
[
3]: Why must it occur before the input stream? Even though Gens will probably always save the chunks in the same order, why must this be a requirement? I thought the idea of chunks was that new ones could be added, left out, or ignored, regardless of order. --
Truncated
- Maybe not necessarily. It would just perhaps make the playback / other analysis based on the movie easier. At least it wouldn't need backtracking in the file. --Bisqwit
- It's a very small change in the Gens code that would make external processing significantly simpler. I think it's a good trade-off. --ideamagnate
- Because the input stream is constantly changing size, it should always be the last chunk. Otherwise, all data after it will also have to be rewritten constantly, which increases the chance of corruption, as well as general wear on the disk. --upthorn
[
4]:
nitsuja: Can these "x improvement" options possibly cause desync?
If not, they are a nuisance to store because viewers who prefer a certain option
will want to change it whenever the recorder didn't happen to use it.
- This should be looked into. I've included all options to be safe. The problem is that it's easy to show that an option can cause a desync for a certain movie, but hard to show that it never will. --ideamagnate
[
5]:
Bisqwit: I think, for clarity, the up/down option should be moved to 00010000 or something, so that if more chipset-related options are added later, they will still be in a contiguous block.
- I'm not sure if it will prove necessary, but there are plenty of bits to spare. --ideamagnate
- It's not a question of bits to spare. It's a question of readability of the format description. Don't you agree that a list grouped by purpose is easier to read than a randomly shuffled list? --Bisqwit
[
6]:
upthorn: Why are these bitwise? There will never be a situation where master system is combined with anything else, and if we give each system it's own number, there's more space for future expansion, even if it means that the genesis and its addons get 4, that's 4 out of 256, rather than 4 out of 8.
[
7]:
Phil: It's not that it affects emulation but some games, such as Battletoads, use special resolution. Unfortunately, Gens doesn't auto-detect those games to use the correct resolution. So, either we put something in the header or make Gens to detect those games to use the correct resolution.
What I think is that when you start recording you have the option to use other resolution, so when people play the movie, Gens auto-resize to desired resolution. Default is 320*240.
P.S. AVI dumping doesn't let Windows users to use other resolution than 320*240.
- This seems to be a poor solution to a larger problem. But more importantly, it isn't something which can affect movie sync, so the movie file isn't a good place to change how it's handled. --upthorn
upthorn: I'm starting to implement this format, and I'm going to change some parts of the specification that don't make sense to me, or I see a better way to do.
Summary of changes:
- Got rid of stored filenames -- CRC is far more meaningful than filename.
- The CRC is more useful unless you're a human trying to figure out which ROM the GM2 goes with. I'd keep both of pieces of information. --Ideamagnate
- Well, the game's internal ROM name is still stored, which should be enough for most humans to work with, and the filenames for various bios files are probably unnecessary anyway -- there are only 2 versions of each country's SegaCD bios, two of the 32X bios images don't even seem to be used (not that there are multiple versions, anyway), and I think there was only one or two versions of the Genesis BIOS. Unless someone records a movie using a homebrew version of one of those, it's not likely to be a problem. --upthorn
- Replaced stored filesize in header with a stored number of chunks.
- Added sound rate storage to the config flags.
- Modified frame chunk format slightly -- multitap is now derived from which controllers are recorded, and there is no need to reserve a controller type for "inactive".
- Added a spec for SMS controller data format.
- Merged console events chunk into framedata -- slightly less efficient file-size wise, but seems much simpler to handle this way.

GM2 last edited by
upthorn on 2007-03-02 04:20:14
Page info and history | Latest diff | List referrers