Skip to main content

SCRN ("NRCS") - Screen

Author(s): Gonhex
Research: NOCASH

The screen section, also known as tile map, is used to create an image by rearranging and flipping tiles. Each position on the raster gets one. This can save a lot of memory since duplicated tiles can be avoided.

Table of Contents


Data Structure

Section Container

struct ContainerSectionSCRN
{
/* 0x0 */ struct NitroSectionHeader sectionHeader;
/* 0x8 */ struct ContainerSCRN sectionData;
}; // entry size = sectionHeader.lengthSection
Field NameDescriptionData Type
sectionHeaderHeader of this section. sectionHeader.signature = "NRCS".NitroSectionHeader
sectionDataContent of this section.ContainerSCRN

SCRN Container

struct ContainerSCRN
{
// header
/* 0x0 */ uint16_t widthInPixel;
/* 0x2 */ uint16_t heightInPixel;
/* 0x4 */ uint16_t unknown0;
/* 0x6 */ uint16_t unknown1;
/* 0x8 */ uint32_t lengthDataScreen;

// data
/* 0xC */ struct TileProperties dataScreen[widthInPixel >> 3][heightInPixel >> 3];
}; // entry size = 0xC + lengthDataScreen
Field NameDescriptionData Type
widthInPixelWidth of the image in pixel.uint16_t
heightInPixelHeight of the image in pixel.uint16_t
unknown0Unused mode?uint16_t
unknown1Unused mode?uint16_t
lengthDataScreenLength of the screen data section in bytes.uint32_t
dataScreenTwo-dimensional tile map to create an image by indexing and flipping tiles.TileProperties[][]

Tile Properties

struct TileProperties
{
/* 0x0 */ uint16_t tileIndex : 10; // 0b00000011'11111111
uint16_t horizontalFlip : 1; // 0b00000100'00000000
uint16_t verticalFlip : 1; // 0b00001000'00000000
uint16_t paletteIndex : 4; // 0b11110000'00000000
}; // entry size = 0x2
Field NameDescriptionData Type
tileIndexIndex of the tile (8x8 pixel image) within the character graphic.uint16_t
horizontalFlipFlip/mirror tile horizontally.uint16_t
verticalFlipFlip/mirror tile vertically.uint16_t
paletteIndexIndex of the palette used for this tile.uint16_t

Specification

Files