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 |
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 |
offset | size | function |
---|---|---|
$00 | word | Horizontal page size |
$02 | word | Vertical page size |
$04 | $0C | Dummy data all $FF |
$10 | variable | Page (number) table |
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.)
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 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.
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 │ ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐ │−│−│−│−│−│−│−│−│−│−│−│−│−│−│−│ └─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
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
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 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.
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 │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
MSB LSB │ │Reverse │ │Palette │function│ │number │ | Character number ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ │3 │2 │1 │0 │VF│HF│9 │8 │7 │6 │5 │4 │3 │2 │1 │0 │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
MSB LSB │Palette │ │ │number │Character number │ ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ │3 │2 │1 │0 │11│10│9 │8 │7 │6 │5 │4 │3 │2 │1 │0 │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
MSB LSB │ │Reverse │ │Palette │function│ │number │ | Character number ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ │−−│6 │5 │4 │VF│HF│9 │8 │7 │6 │5 │4 │3 │2 │1 │0 │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
MSB LSB │Palette │ │ │number │Character number │ ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ │−−│6 │5 │4 │11│10│9 │8 │7 │6 │5 │4 │3 │2 │1 │0 │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
MSB LSB │ │Reverse │ │Palette │function│ │number │ | Character number ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ │3 │2 │1 │0 │VF│HF│11│10│9 │8 │7 │6 │5 │4 │3 │2 │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
MSB LSB │Palette │ │ │number │Character number │ ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ │3 │2 │1 │0 │13│12│11│10│9 │8 │7 │6 │5 │4 │3 │2 │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
MSB LSB │ │Reverse │ │Palette │function│ │number │ | Character number ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ │−−│6 │5 │4 │VF│HF│11│10│9 │8 │7 │6 │5 │4 │3 │2 │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
MSB LSB │Palette │ │ │number │Character number │ ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ │−−│6 │5 │4 │13│12│11│10│9 │8 │7 │6 │5 │4 │3 │2 │ └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘
offset | size | function |
---|---|---|
$00 | $10 | Dummy data all $FF |
$10 | variable | character pattern table |
Cell data is arranged as shown below depending on the character size.
┌─────┬─────┬─────┬─────┬─────┬ │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| | ・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
┌─────┬─────┬─────┬─────┬─────┬ │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| | -------------------- | ... |........... |
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│ └───┴───┴───┴───┘
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│ └───┴───┴───┴───┴───┴───┴───┴───┘
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│ └───┴───┴───┴───┴───┴───┴───┴───┘
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 |
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).
MSB LSB │ │ B │ G │ R │ ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐ │−│4│3│2│1│0│4│3│2│1│0│4│3│2│1│0│ └─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
offset | size | function |
---|---|---|
$00 | Word x number of characters | attribute data |
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.