Japanese
Graphic Tools GuideFormat list

for 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
 pallet 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 vacant addresses $00
If no data exists, offset address/data size = 0
The last byte of the identifier is optional.

◆Map data

 offset
 size
 function
 $00
 word
 Horizontal page size
 $02
 word
 Vertical page size
 $04
 $0C
 Dummy data all $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 in the order in which it is stored on a page basis.

A page table is constructed by storing an array of page numbers that make up a map contiguously in memory with horizontal priority.

Please note that the map data in the SEGA2D file has a slightly different interpretation than the map data in the Sega Saturn. (It will be equivalent if 1 plane = 1 page.)

◆Pattern name data

 offset
 size
 function
 $00
 long
 character control data
 $04
 word
 Pattern name auxiliary data
 $06
 $0A
 Dummy data all $FF
 $10
 variable
 pattern name table
The pattern name table consists of a sequence of characters laid out on one page that is stored consecutively in 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
Please refer to "HARDWARE MANUAL/VDP2 User's Manual/ ■4.6 Pattern Name Table ".

character control data
MSB              Number     size
│               │  of │     │ │
│    Unused    │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
│   │       │ Pattern name    │
│   │Unused │ 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 are reserved as 0.

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

Palette numbers are expressed as 1 unit of 16 colors.

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

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

In Sega Saturn, if the pattern name data size is 1 word, the missing pattern name data is usually supplemented with pattern name auxiliary data.

In the SEGA2D file, all bits that make up the pattern name auxiliary data are fixed to 0. Therefore, there are restrictions on the number of characters and palettes that can be used, so please be careful.

◇When pattern name data size = 2 words
MSB
 │Reverse function
 │      │Special function
 │          |   Unused     │   Pallete 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
When character number auxiliary mode=10bit
MSB                                           LSB
│           │Reverse  │
│Palette    │function│
│number     │     |       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
When character number auxiliary mode=12bit
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 = other than 16 colors
When character number auxiliary mode=10bit
MSB                                           LSB
   │        │Reverse  │
   │Palette │function│
   │number  │     |       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 = other than 16 colors
When character number auxiliary mode=12bit
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
When character number auxiliary mode=10bit
MSB                                           LSB
│           │Reverse  │
│Palette    │function│
│number     │     |       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
When character number auxiliary mode=12bit
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 = other than 16 colors
When character number auxiliary mode=10bit
MSB                                           LSB
   │        │Reverse  │
   │Palette │function│
   │number  │     |       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 = other than 16 colors
When character number auxiliary mode=12bit
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
 Dummy data all $FF
 $10
 variable
 character pattern table
The total number and arrangement of character pattern tables vary depending on the character size and number of character colors.

detail
"HARDWARE MANUAL/VDP2 User's Manual/ ■4.3 Cell / ■4.4 Character Pattern "

Character pattern data
A character pattern table is constructed by storing the "cell data" that make up a character consecutively in memory.

Cell data is arranged as shown below depending on the character size.

◇When character size = 1 cell x 1 cell
┌─────┬─────┬─────┬─────┬─────┬
│Cell0│Cell1│Cell2│Cell3│Cell4│
├─────┼─────┼─────┼─────┼─────┼
│.....│.....│.....│.....│.....│
├─────┼─────┼─────┼─────┼─────┼
│.....│.....│.....│.....│.....│
├─────┼─────┼─────┼─────┼─────┼

 |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
┌─────┬─────┬─────┬─────┬─────┬
│Cell0│Cell1│Cell4│Cell5│Cell8│
├─────┼─────┼─────┼─────┼─────┼
│Cell2│Cell3│Cell6│Cell7│.....│
├─────┼─────┼─────┼─────┼─────┼
│.....│.....│.....│.....│.....│
├─────┼─────┼─────┼─────┼─────┼

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

◆Cell data

Cell data is structured as follows depending on the number of character colors.
The numbers in the frame are the offset addresses from the beginning of each cell data.

◇When 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 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 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
 Starting (offset) pallet number
 $02
 word
 Number of color tables
 $04
 $0C
 Dummy data all $FF
 $10
 variable
 color table
If the number of character colors is 32768 colors (RGB mode), palette data does not exist.

A color table is constructed by storing the "color data" that make up a palette in memory consecutively.

The starting 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│
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
Color data follows the data structure of color RAM in the case of 5 bits each for RGB.

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 of characters as the number of characters, and is stored contiguously in memory.

There are no specific Sega Saturn hardware functions that correspond to attribute data. Use this field if your application software requires some information that corresponds one-to-one with the character table.


Format list
Copyright SEGA ENTERPRISES, LTD. 1997