Difference between revisions of "MGV"

From MSX Game Library

(Extension)
 
(25 intermediate revisions by the same user not shown)
Line 1: Line 1:
MGLV is a video format for MSXgl.
+
'''MGV''' is a video format for MSXgl.
  
 
== Format ==
 
== Format ==
Line 13: Line 13:
 
| 0x0003 || 1 || Flag
 
| 0x0003 || 1 || Flag
 
|
 
|
7  6  5  4  3  2  1  0
+
<syntaxhighlight lang="txt>
│        │  └──┴──┴──┴── File format version (0-15)
+
7  6  5  4  3  2  1  0
│        └────────────── Segment size (0: 8 KB, 1: 16 KB)
+
│        │  └──┴──┴──┴── File format version (0-15)
└─────────────────────── Include video format data (4 bytes)
+
│        └────────────── Segment size (0: 8 KB, 1: 16 KB)
 +
└─────────────────────── Include video format data (4 bytes)
 +
</syntaxhighlight>
 
|-
 
|-
 
| (0x0004) || 1 || Video format - Image
 
| (0x0004) || 1 || Video format - Image
 
|
 
|
7  6  5  4  3  2  1  0
+
<syntaxhighlight lang="txt>
  │  │        └──┴──┴──┴── Screen mode (0-15)
+
7  6  5  4  3  2  1  0
  └──┴──────────────────── Bit per pixel (0: 1-bit, 1: 2-bit, 2: 4-bit, 3: 8-bit)
+
│  │        └──┴──┴── Screen mode (0-7)
 +
│  └───────────────── Screen width (0: 256 px, 1: 512 px)
 +
└──┴──────────────────── Bit per pixel (0: 1-bit, 1: 2-bit, 2: 4-bit, 3: 8-bit)
 +
</syntaxhighlight>
 
Screen mode:
 
Screen mode:
* 0: Text 1 (40x27)
+
* 0: TEXT - Screen 0, width 40 & 80
* 1: Graphic 1 (32x27)
+
* 1: GM1 - Screen 1
* 2: Graphic 2 (32x27)
+
* 2: GM2 - Screen 2 & 4
* 3: Multi Color (64x53)
+
* 3: MC - Screen 3
* 4: Text 2 (80x27)
+
* 4: BITMAP - Screen 5 ~ 8
* 5: Graphic 3 (32x27)
+
* 5: YAE - Screen 10 (GM7 + YJK + YAE)
* 6: Graphic 4 (256x212 16 colors)
+
* 6: YJK - Screen 12 (GM7 + YJK)
* 7: Graphic 5 (512x212 4 colors)
 
* 6: Graphic 6 (512x212 16 colors)
 
* 7: Graphic 7 (256x212 256 colors)
 
* 8: Graphic 3 mirrored (undocumented)
 
 
|-
 
|-
 
| (0x0005) || 1 || Video format - Replay
 
| (0x0005) || 1 || Video format - Replay
 
|
 
|
7  6  5  4  3  2  1  0
+
<syntaxhighlight lang="txt>
│  │        └──┴──┴──┴── Frame skip (0-15)
+
7  6  5  4  3  2  1  0
│  └──────────────────── Loop (0: No, 1: Yes)
+
│  │        └──┴──┴──┴── Frame skip (0-15)
└─────────────────────── Frequency (0: 50 Hz, 1: 60 Hz)
+
│  └──────────────────── Loop (0: No, 1: Yes)
 +
└─────────────────────── Frequency (0: 50 Hz, 1: 60 Hz)
 +
</syntaxhighlight>
 +
At 50 Hz, a frame skip of 1 means 25 fps.<br/>At 60 Hz, a frame skip of 5 means 10 fps.
 
|-
 
|-
| (0x0006) || 1 || Video format - Width || 1-256
+
| (0x0006) || 1 || Video format - Width || 1-256 (or 2-512 for Screen mode 6 and 7)
 
|-
 
|-
 
| (0x0007) || 1 || Video format - Height || 1-256
 
| (0x0007) || 1 || Video format - Height || 1-256
Line 56: Line 60:
 
| <tt>00</tt> || || End of data
 
| <tt>00</tt> || || End of data
 
|-
 
|-
| <tt>01</tt> || || End of line
+
| <tt>01</tt> || || End of segment (increment segment index and reset data pointer)
 
|-
 
|-
| <tt>02</tt> || ||  
+
| <tt>02</tt> || || End of line
 
|-
 
|-
| <tt>03</tt> || || End of segment (increment segment index and reset data pointer)
+
| <tt>x3</tt> || || Switch to table<br>
 +
x:
 +
* 0: Pattern table (default)
 +
* 1: Color table (screen mode 1, 2 and 3)
 +
* 2: Layout table (tile based modes)
 +
* 3: Color palette (MSX2/2+)
  
 
|-
 
|-
| <tt>n4</tt> || || Skip <tt>n</tt> bytes (1-16)
+
| <tt>n4</tt> || || Skip <tt>n</tt> bytes (1-15)
 
|-
 
|-
| <tt>05</tt> || <tt>nn</tt> || Skip <tt>nn</tt> bytes (1-256)
+
| <tt>05</tt> || <tt>nn</tt> || Skip <tt>nn</tt> bytes (1-255)
 
|-
 
|-
| <tt>06</tt> || <tt>nnnn</tt> || Skip <tt>nnnn</tt> bytes (1-65536)
+
| <tt>06</tt> || <tt>nnnn</tt> || Skip <tt>nnnn</tt> bytes (1-65535)
 
|-
 
|-
 
| <tt>07</tt> || || Skip a frame / End of frame
 
| <tt>07</tt> || || Skip a frame / End of frame
  
 
|-
 
|-
| <tt>n8</tt> || <tt>vv</tt> || Fill <tt>n</tt> bytes (1-256) with <tt>vv</tt> value
+
| <tt>n8</tt> || <tt>vv</tt> || Fill <tt>n</tt> bytes (1-15) with <tt>vv</tt> value
 
|-
 
|-
| <tt>09</tt> || <tt>vv,nn</tt> || Fill <tt>nn</tt> bytes (1-256) with <tt>vv</tt> value
+
| <tt>09</tt> || <tt>nn,vv</tt> || Fill <tt>nn</tt> bytes (1-255) with <tt>vv</tt> value
 
|-
 
|-
| <tt>0A</tt> || <tt>vv,nnnn</tt> || Fill <tt>nnnn</tt> bytes (1-65536) with <tt>vv</tt> value
+
| <tt>0A</tt> || <tt>nnnn,vv</tt> || Fill <tt>nnnn</tt> bytes (1-65535) with <tt>vv</tt> value
 
|-
 
|-
 
| <tt>0B</tt> || <tt>vv</tt> || Fill a full frame with <tt>vv</tt> value
 
| <tt>0B</tt> || <tt>vv</tt> || Fill a full frame with <tt>vv</tt> value
  
 
|-
 
|-
| <tt>nC</tt> || <tt>vv[n]</tt> || Copy <tt>n</tt> bytes (1-256) from <tt>vv[n]</tt> data table
+
| <tt>nC</tt> || <tt>vv[n]</tt> || Copy <tt>n</tt> bytes (1-15) from <tt>vv[n]</tt> data table
 
|-
 
|-
| <tt>0D</tt> || <tt>nn,vv[nn]</tt> || Copy <tt>nn</tt> bytes (1-256) from <tt>vv[nn]</tt> data table
+
| <tt>0D</tt> || <tt>nn,vv[nn]</tt> || Copy <tt>nn</tt> bytes (1-255) from <tt>vv[nn]</tt> data table
 
|-
 
|-
| <tt>0E</tt> || <tt>nnnn,vv[nnnn]</tt> || Copy <tt>nnnn</tt> bytes (1-65536) from <tt>vv[nnnn]</tt> data table
+
| <tt>0E</tt> || <tt>nnnn,vv[nnnn]</tt> || Copy <tt>nnnn</tt> bytes (1-65535) from <tt>vv[nnnn]</tt> data table
 
|-
 
|-
 
| <tt>0F</tt> || <tt>vv[]</tt> || Copy a full frame from data table (raw frame)
 
| <tt>0F</tt> || <tt>vv[]</tt> || Copy a full frame from data table (raw frame)
Line 91: Line 100:
  
 
== Extension ==
 
== Extension ==
<tt>.MGLV</tt> (for Windows/Linux) or <tt>.MGV</tt> (for MSX-DOS)
+
* Default extension (for MSX-DOS): <tt>.MGV</tt>
 +
* Alternative for Windows/Linux: <tt>.MGLV</tt>
 +
 
 +
== Change log ==
 +
* Version 1.0 (2024/03/31)
 +
** Original version (File format version 0)
 +
 
 +
[[Category:Format]]

Latest revision as of 00:59, 29 October 2024

MGV is a video format for MSXgl.

Format

Header

Offset Size Desc. Value
0x0000 3 Signature "MGV"
0x0003 1 Flag
7  6  5  4  3  2  1  0
│        │  └──┴──┴──┴── File format version (0-15)
│        └────────────── Segment size (0: 8 KB, 1: 16 KB)
└─────────────────────── Include video format data (4 bytes)
(0x0004) 1 Video format - Image
7  6  5  4  3  2  1  0
│  │  │        └──┴──┴── Screen mode (0-7)
│  │  └───────────────── Screen width (0: 256 px, 1: 512 px)
└──┴──────────────────── Bit per pixel (0: 1-bit, 1: 2-bit, 2: 4-bit, 3: 8-bit)

Screen mode:

  • 0: TEXT - Screen 0, width 40 & 80
  • 1: GM1 - Screen 1
  • 2: GM2 - Screen 2 & 4
  • 3: MC - Screen 3
  • 4: BITMAP - Screen 5 ~ 8
  • 5: YAE - Screen 10 (GM7 + YJK + YAE)
  • 6: YJK - Screen 12 (GM7 + YJK)
(0x0005) 1 Video format - Replay
7  6  5  4  3  2  1  0
│  │        └──┴──┴──┴── Frame skip (0-15)
│  └──────────────────── Loop (0: No, 1: Yes)
└─────────────────────── Frequency (0: 50 Hz, 1: 60 Hz)

At 50 Hz, a frame skip of 1 means 25 fps.
At 60 Hz, a frame skip of 5 means 10 fps.

(0x0006) 1 Video format - Width 1-256 (or 2-512 for Screen mode 6 and 7)
(0x0007) 1 Video format - Height 1-256

Commands

Cmd Options Desc.
00 End of data
01 End of segment (increment segment index and reset data pointer)
02 End of line
x3 Switch to table

x:

  • 0: Pattern table (default)
  • 1: Color table (screen mode 1, 2 and 3)
  • 2: Layout table (tile based modes)
  • 3: Color palette (MSX2/2+)
n4 Skip n bytes (1-15)
05 nn Skip nn bytes (1-255)
06 nnnn Skip nnnn bytes (1-65535)
07 Skip a frame / End of frame
n8 vv Fill n bytes (1-15) with vv value
09 nn,vv Fill nn bytes (1-255) with vv value
0A nnnn,vv Fill nnnn bytes (1-65535) with vv value
0B vv Fill a full frame with vv value
nC vv[n] Copy n bytes (1-15) from vv[n] data table
0D nn,vv[nn] Copy nn bytes (1-255) from vv[nn] data table
0E nnnn,vv[nnnn] Copy nnnn bytes (1-65535) from vv[nnnn] data table
0F vv[] Copy a full frame from data table (raw frame)

Extension

  • Default extension (for MSX-DOS): .MGV
  • Alternative for Windows/Linux: .MGLV

Change log

  • Version 1.0 (2024/03/31)
    • Original version (File format version 0)