-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformat specs v2.txt
37 lines (29 loc) · 1.63 KB
/
format specs v2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
0x00-0x03: 4-byte signature: 6D 6D 32 67 ("mm2g")
0x04-0x05: version number: 2-byte, unsigned, big-endian (should be 00 02)
0x06-0x09: length: 4-byte, unsigned, big-endian
Following this header is length frames of data.
Each frame starts with 3 bytes:
xPos yPos flags
xPos:
Mega Man's X position (pixels)
yPos:
Mega Man's Y position (pixels)
Positions are given in the game world's coordinate space (as used for collision detection), as opposed to
the screen space (as used for drawing). It is entirely unnecessary to store the scroll of either axis.
flags:
7654 3210
---- CAWF
|||| ||||
|||| |||+- Flipped: whether Mega Man's sprite is flipped (facing right). Updates every frame.
|||| ||+-- Weapon: set when the currently equipped weapon changes. When this bit is 1,
|||| || the index of the new weapon (1 byte) will follow, on the range [0,12].
|||| |+--- Animation: set when Mega Man's animation index changes. When this bit is 1,
|||| | the index of the new animation (1 byte) will follow. 0xFF is a sentinel value unused by
|||| | the game, which signifies no animation (Mega Man is offscreen, etc.) in this file.
|||| +---- sCreen #: set whenever Mega Man crosses over to a new screen. When this bit is 1,
|||| the new screen number (1 byte) will follow. This value can be interpreted as the high
|||| byte of Mega Man's X position.
++++------ Unused. Set to 0.
If multiple "extra byte" flags are set, their corresponding extra bytes will appear in order from least to most
significant bit. i.e., Weapon, Animation, Screen #.
These flags essentially create an RLE compression scheme for important variables that don't change often.