Graphic Tools GuideFormat list

Sega Saturn Scroll (VDP2)
data format

SEGA2D


■ File layout

 offset
 size
 function
 $ 000
 $ 100
 Header
 variable
 variable
 Map data
 variable
 variable
 Pattern name data
 variable
 variable
 Character data
 variable
 variable
 Palette data
 variable
 variable
 Attribute data

◆ Header

 offset
 size
 function
 $ 00
 $ 10
 Identifier = "SEGA_SATURN_SCR" +? ("_" Is a space = $ 20)
 $ 10
 Long
 Map data offset address
 $ 14
 Long
 Map data size (bytes)
 $ 20
 Long
 Pattern name data offset address
 $ 24
 Long
 Pattern name data size (bytes)
 $ 30
 Long
 Character data offset address
 $ 34
 Long
 Character data size (bytes)
 $ 40
 Long
 Palette data offset address
 $ 44
 Long
 Palette data size (bytes)
 $ 50
 Long
 Attribute data offset address
 $ 54
 Long
 Attribute data size (bytes)
 $ 60
 $ A0
 All empty addresses are $ 00
Offset address data size = 0 if no data exists
The last byte of the identifier is arbitrary.

◆ Map data

 offset
 size
 function
 $ 00
 word
 Horizontal page size
 $ 02
 word
 Vertical page size
 $ 04
 $ 0C
 All dummy data $ FF
 $ 10
 variable
 Page (number) table
One page is an area of 512 dots x 512 dots. The page number is an index of the pattern name table on a page-by-page basis in the order in which it is stored.

The page table is constructed by continuously storing an array of page numbers that make up the map in memory with horizontal priority.

Please note that the map data in the SEGA2D file has a slightly different interpretation from the map data of Sega Saturn. (Equivalent by setting 1 plane = 1 page.)

◆ Pattern name data

 offset
 size
 function
 $ 00
 Long
 Character control data
 $ 04
 word
 Pattern name auxiliary data
 $ 06
 $ 0A
 All dummy data $ FF
 $ 10
 variable
 Pattern name table
The pattern name table consists of a sequence of characters spread out on one page, which is continuously stored in the memory for the total number of pages.

The size and arrangement of the pattern name table changes depending on the "pattern name data size" and "character size" set by the "character control data" and "pattern name auxiliary data".

The pattern name data is based on the Sega Saturn pattern name data.

detail
Refer to "HARDWARE MANUAL / VDP2 User's Manual / ■ 4.6 Pattern Name Table".

<Character control data>
MSB character size │ unused │ number of colors │ unused │ │
┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
│-│-│-│-│-│-│-│-│ 2│1│0│-│-│-│S│
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
│ │ │ └─ SZ: 0 = 1 cell x 1 cell │ │ │ 1 = 2 cells x 2 cells │ │ │ 
└─┴─┴───────── CN: 000 = 16 colors 001 = 256 colors 011 = 32768 colors LSB
Unused │
┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
│-│-│-│-│-│-│-│-│-│-│-│-│-│-│-│
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘

<Pattern name auxiliary data>
MSB LSB
│ │ Unused │ Pattern name auxiliary data │
┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
│P│N│-│-│-│-│0│0│0│0│0│0│0│0│0│
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
│ │ 
│ └─ NSM: Character number auxiliary mode │ 0 = 10bit
│ 1 = 12bit
│ 
└─── PNB: Pattern name data size 0 = 1 word 1 = 2 words
* All pattern name auxiliary data is reserved at 0.

<Pattern name data>
Each bit that makes up the pattern name data is expressed as follows.

The palette number expresses 16 colors as one unit.

For the character number, specify the offset address of the character pattern table (see the character data section) in $ 20 units. Therefore, the number of occupants per character changes as follows depending on the character size and the number of character colors.

 Number of character colors
 1 cell x 1 cell
 2 cells x 2 cells
 16 colors
 1
 Four
 256 colors
 2
 8
 32768 colors
 Four
 16

In Sega Saturn, when the pattern name data size is one word, the shortage of pattern name data is usually supplemented with pattern name auxiliary data.

In the SEGA2D file, all the bits that make up the pattern name auxiliary data are fixed to 0. Therefore, please note that the number of characters that can be used and the palette will be limited.

◇ When pattern name data size = 2 words
MSB
│ Invert function │ Special function │ Unused │ Palette number │
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│ HF │ VF │ Pr │ CC │ −− │ −− │ −− │ −− │ −− │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
LSB
│ │ Character number │
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│ −− │ 14 │ 13 │ 12 │ 11 │ 10 │ 9 │ 8 │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘

◇ Pattern name data size = 1 word
Character size = 1 cell x 1 cell Number of character colors = 16 colors Character number When auxiliary mode = 10 bits
MSB LSB
│ Palette number │ Invert function │ Character number │
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│ 3 │ 2 │ 1 │ 0 │ VF │ HF │ 9 │ 8 │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘

◇ Pattern name Data size = 1 word Character size = 1 cell x 1 cell Number of character colors = 16 colors Character number Auxiliary mode = 12 bits
MSB LSB
│ Palette number │ Character number │
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│ 3 │ 2 │ 1 │ 0 │ 11 │ 10 │ 9 │ 8 │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘

◇ Pattern name Data size = 1 word Character size = 1 cell x 1 cell Number of character colors = 16 colors other than character number Auxiliary mode = 10 bits
MSB LSB
│ Palette number │ Invert function │ Character number │
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│ −− │ 6 │ 5 │ 4 │ VF │ HF │ 9 │ 8 │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘

◇ Pattern name Data size = 1 word Character size = 1 cell x 1 cell Number of character colors = 16 colors other than character number Auxiliary mode = 12 bits
MSB LSB
│ Palette number │ Character number │
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│ −− │ 6 │ 5 │ 4 │ 11 │ 10 │ 9 │ 8 │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘

◇ Pattern name Data size = 1 word Character size = 2 cells x 2 cells Number of character colors = 16 colors Character number Auxiliary mode = 10 bits
MSB LSB
│ Palette number │ Invert function │ Character number │
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│ 3 │ 2 │ 1 │ 0 │ VF │ HF │ 11 │ 10 │ 9 │ 8 │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘

◇ Pattern name Data size = 1 word Character size = 2 cells x 2 cells Number of character colors = 16 colors Character number Auxiliary mode = 12 bits
MSB LSB
│ Palette number │ Character number │
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│ 3 │ 2 │ 1 │ 0 │ 13 │ 12 │ 11 │ 10 │ 9 │ 8 │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘

◇ Pattern name Data size = 1 word Character size = 2 cells x 2 cells Number of character colors = 16 colors other than character number Auxiliary mode = 10 bits
MSB LSB
│ Palette number │ Invert function │ Character number │
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│ −− │ 6 │ 5 │ 4 │ VF │ HF │ 11 │ 10 │ 9 │ 8 │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘

◇ Pattern name Data size = 1 word Character size = 2 cells x 2 cells Number of character colors = 16 colors other than character number Auxiliary mode = 12 bits
MSB LSB
│ Palette number │ Character number │
┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐
│ −− │ 6 │ 5 │ 4 │ 13 │ 12 │ 11 │ 10 │ 9 │ 8 │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘

◆ Character data

 offset
 size
 function
 $ 00
 $ 10
 All dummy data $ FF
 $ 10
 variable
 Character pattern table
The total number and array of the character pattern table changes depending on the character size and the number of character colors.

detail
"HARDWARE MANUAL / VDP2 User's Manual / ■ 4.3 cells / ■ 4.4 character patterns "

<Character pattern data>
The character pattern table is constructed by continuously storing the "cell data" that makes up a character in memory.

The cell data is arranged as follows according to the character size.

◇ When character size = 1 cell x 1 cell
┌───┬───┬───┬───┬───┬
│ Cell 0 │ Cell 1 │ Cell 2 │ Cell 3 │ Cell 4 │
├───┼───┼───┼───┼───┼
│ ・ ・ ・ │ ・ ・ ・ │ ・ ・ ・ │ ・ ・ ・ │ ・ ・ ・ │
├───┼───┼───┼───┼───┼
│ ・ ・ ・ │ ・ ・ ・ │ ・ ・ ・ │ ・ ・ ・ │ ・ ・ ・ │
├───┼───┼───┼───┼───┼

 | Cell 0 = Character 0 |
 | Cell 1 = Character 1 |
 | Cell 2 = Character 2 |
 | Cell 3 = Character 3 |
 | Cell 4 = Character 4 |
 | Cell 5 = Character 5 |
 | Cell 6 = Character 6 |
 | ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ ・ |

◇ When character size = 2 cells x 2 cells
┌───┬───┬───┬───┬───┬
│ Cell 0 │ Cell 1 │ Cell 4 │ Cell 5 │ Cell 8 │
├───┼───┼───┼───┼───┼
│ Cell 2 │ Cell 3 │ Cell 6 │ Cell 7 │ ・ ・ ・ │
├───┼───┼───┼───┼───┼
│ ・ ・ ・ │ ・ ・ ・ │ ・ ・ ・ │ ・ ・ ・ │ ・ ・ ・ │
├───┼───┼───┼───┼───┼

 --------------------
 | Cell 0 | |
 | Cell 1 | Character 0 |
 | Cell 2 | |
 | Cell 3 | |
 --------------------
 | Cell 4 | |
 | Cell 5 | Character 1 |
 | Cell 6 | |
 | Cell 7 | |
 --------------------
 | ・ ・ ・ | ・ ・ ・ |

◆ Cell data

The cell data is composed as follows according to the number of character colors.
The number in the frame is the offset address from the beginning of each cell data.

◇ When the number of character colors = 16 colors
0 1 2 3 4 5 6 7 
┌───┬───┬───┬───┐
0│ + 00│ + 01│ + 02│ + 03│
├───┼───┼───┼───┤
1│ + 04│ + 05│ + 06│ + 07│
├───┼───┼───┼───┤
2│ + 08│ + 09│ + 0a│ + 0b│
├───┼───┼───┼───┤
3│ + 0c│ + 0d│ + 0e│ + 0f│
├───┼───┼───┼───┤
4│ + 10│ + 11│ + 12│ + 13│
├───┼───┼───┼───┤
5│ + 14│ + 15│ + 16│ + 17│
├───┼───┼───┼───┤
6│ + 18│ + 19│ + 1a│ + 1b│
├───┼───┼───┼───┤
7│ + 1c│ + 1d│ + 1e│ + 1f│
└───┴───┴───┴───┘

◇ When the number of character colors = 256 colors
0 1 2 3 4 5 6 7 
┌───┬───┬───┬───┬───┬───┬───┬───┐
0│ + 00│ + 01│ + 02│ + 03│ + 04│ + 05│ + 06│ + 07│
├───┼───┼───┼───┼───┼───┼───┼───┤
1│ + 08│ + 09│ + 0a│ + 0b│ + 0c│ + 0d│ + 0e│ + 0f│
├───┼───┼───┼───┼───┼───┼───┼───┤
2 │ + 10 │ + 11 │ + 12 │ + 13 │ + 14 │ + 15 │ + 16 │ + 17 │
├───┼───┼───┼───┼───┼───┼───┼───┤
3│ + 18│ + 19│ + 1a│ + 1b│ + 1c│ + 1d│ + 1e│ + 1f│
├───┼───┼───┼───┼───┼───┼───┼───┤
4│ + 20│ + 21│ + 22│ + 23│ + 24│ + 25│ + 26│ + 27│
├───┼───┼───┼───┼───┼───┼───┼───┤
5│ + 28│ + 29│ + 2a│ + 2b│ + 2c│ + 2d│ + 2e│ + 2f│
├───┼───┼───┼───┼───┼───┼───┼───┤
6│ + 30│ + 31│ + 32│ + 33│ + 34│ + 35│ + 36│ + 37│
├───┼───┼───┼───┼───┼───┼───┼───┤
7│ + 38│ + 39│ + 3a│ + 3b│ + 3c│ + 3d│ + 3e│ + 3f│
  └───┴───┴───┴───┴───┴───┴───┴───┘

◇ When the number of character colors = 32768 colors
0 1 2 3 4 5 6 7 
┌───┬───┬───┬───┬───┬───┬───┬───┐
0│ + 00│ + 02│ + 04│ + 06│ + 08│ + 0a│ + 0c│ + 0e│
├───┼───┼───┼───┼───┼───┼───┼───┤
1│ + 10│ + 12│ + 14│ + 16│ + 18│ + 1a│ + 1c│ + 1e│
├───┼───┼───┼───┼───┼───┼───┼───┤
2│ + 20│ + 22│ + 24│ + 26│ + 28│ + 2a│ + 2c│ + 2e│
├───┼───┼───┼───┼───┼───┼───┼───┤
3│ + 30│ + 32│ + 34│ + 36│ + 38│ + 3a│ + 3c│ + 3e│
├───┼───┼───┼───┼───┼───┼───┼───┤
4│ + 40│ + 42│ + 44│ + 46│ + 48│ + 4a│ + 4c│ + 4e│
├───┼───┼───┼───┼───┼───┼───┼───┤
5│ + 50│ + 52│ + 54│ + 56│ + 58│ + 5a│ + 5c│ + 5e│
├───┼───┼───┼───┼───┼───┼───┼───┤
6│ + 60│ + 62│ + 64│ + 66│ + 68│ + 6a│ + 6c│ + 6e│
├───┼───┼───┼───┼───┼───┼───┼───┤
7│ + 70│ + 72│ + 74│ + 76│ + 78│ + 7a│ + 7c│ + 7e│
  └───┴───┴───┴───┴───┴───┴───┴───┘

◆ Palette data

 offset
 size
 function
 $ 00
 word
 Start (offset) palette number
 $ 02
 word
 Number of color tables
 $ 04
 $ 0C
 All dummy data $ FF
 $ 10
 variable
 Color table
If the number of character colors is 32768 (RGB mode), there is no palette data.

A color table is constructed by continuously storing the "color data" that makes up the palette in memory.

The start palette number is specified in units of 1 color (1 color data).

◆ Color data

MSB LSB
│ │ B │ G │ R │
┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
│-│ 4 │ 3 │ 2 │ 1 │ 0 │ 4 │ 3 │ 2 │ 1 │ 0 │ 4 │ 3 │ 2 │ 1 │ 0 │
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
The color data conforms to the data structure of the color RAM in the case of RGB 5 bits each.

detail
"HARDWARE MANUAL / VDP2 User's Manual / ■ 3.4 Color RAM Mode "

◆ Attribute data

 offset
 size
 function
 $ 00
 Word x number of characters
 Attribute data
Attribute data consists of one unit of word size, which is the same number as the number of characters, and is continuously stored in memory.

There is no particular Sega Saturn hardware function that corresponds to the attribute data. Use this field when you need some information that has a one-to-one correspondence with the character table in the application software.


Format list
Copyright SEGA ENTERPRISES, LTD ,. 1997