Fix layer: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
The fix layer is a non-scrollable, tile-based layer with transparency which has the highest priority on the display (it always overlaps [[sprites]]). It is used to display text or HUDs like scores and health bars.
The fix layer is a non-scrollable, tile-based layer with transparency which has the highest priority on the display (it always overlaps [[sprites]]). It is used to display text or HUDs like scores and health bars.


As only 12 bits are reserved to address fix tiles, tilesets can only contain a maximum of 4096 tiles (128KiB).
As only 12 bits are reserved to address fix tiles, tilesets can only contain a maximum of 4096 tiles (128KiB) without any kind of special bankswitching (see below).


== Graphics format ==
== Graphics format ==


Tiles used are 8*8 pixels, they're stored in the [[S ROM]]s, or in [[FIX file]]s before getting loaded to [[PSRAM]] in CD systems.
Fix tiles are 8*8 pixels, they're stored in the [[S ROM]]s, or in [[FIX file]]s before getting loaded to [[PSRAM]] in CD systems.
In MVS systems, there is an embedded fix tileset stored in the [[SFIX|SFIX ROM]] which can be swapped with the cart's one.
In MVS systems, there is an embedded fix tileset stored in the [[SFIX|SFIX ROM]] which can be swapped with the cartridge one.


The tiles graphics are 4BPP (15 colors, index 0 is transparent), each can be individually mapped to the first 16 [[palettes]].
The tiles graphics are 4BPP like sprites tiles (15 colors, index 0 is transparent), each can be individually mapped to one of the first 16 [[palettes]] (4bit palette number).


See [[Fix graphics format]] for more details.
See [[Fix graphics format]] for more details.
Line 15: Line 15:
[[File:Fixlayout.png|frame|Fix layout. The grey area is part of the display but only the area in the red rectangle should be used.]]
[[File:Fixlayout.png|frame|Fix layout. The grey area is part of the display but only the area in the red rectangle should be used.]]


The map is 40x32 tiles but only 40x28 tiles are drawn to the screen in NTSC mode: Therefor, there are 2 hidden lines of tiles at the beginning and the end of the map. Some games also don't use the leftmost and rightmost columns, as some misaligned CRT screens (?) can cut them off.
The map is in [[VRAM]] starting at address $7000. It is 40*32 words in size, but:
* Only 40x28 tiles are drawn in NTSC mode (2 hidden lines on top and bottom)
* Only 40x30 tiles are drawn in PAL mode (1 hidden line on top and bottom)


The base address in [[VRAM]] for the map is $7000. Each tile uses one 16bit word:
Some games also don't use the leftmost and rightmost columns, as some misaligned CRT screens can cut them off. SNK recomends using only a 38x28 area.
 
Each tile in VRAM uses a 16bit word:


{{16BitRegister|Palette number|4|Tile number|12}}
{{16BitRegister|Palette number|4|Tile number|12}}


Tiles are mapped from up to bottom, and left to right (see layout). The '''VRAM_MOD''' ($3C0004) register can be set to 32 if tiles need to be updated in lines. See [[Displaying text]].
Tiles are mapped from top to bottom, and left to right (see layout). The {{Reg|VRAM_MOD ($3C0004)}} register can be set to 32 if tiles need to be updated in lines. See [[Displaying text]].
 
== Bankswitching ==
 
Games using the [[NEO-CMC]] chips are able to use more than 4096 fix tiles by using VRAM space $7500+. See [[Fix bankswitching]].


[[Category:Video system]]
[[Category:Video system]]

Revision as of 18:46, 24 December 2012

The fix layer is a non-scrollable, tile-based layer with transparency which has the highest priority on the display (it always overlaps sprites). It is used to display text or HUDs like scores and health bars.

As only 12 bits are reserved to address fix tiles, tilesets can only contain a maximum of 4096 tiles (128KiB) without any kind of special bankswitching (see below).

Graphics format

Fix tiles are 8*8 pixels, they're stored in the S ROMs, or in FIX files before getting loaded to PSRAM in CD systems. In MVS systems, there is an embedded fix tileset stored in the SFIX ROM which can be swapped with the cartridge one.

The tiles graphics are 4BPP like sprites tiles (15 colors, index 0 is transparent), each can be individually mapped to one of the first 16 palettes (4bit palette number).

See Fix graphics format for more details.

Fix map

File:Fixlayout.png
Fix layout. The grey area is part of the display but only the area in the red rectangle should be used.

The map is in VRAM starting at address $7000. It is 40*32 words in size, but:

  • Only 40x28 tiles are drawn in NTSC mode (2 hidden lines on top and bottom)
  • Only 40x30 tiles are drawn in PAL mode (1 hidden line on top and bottom)

Some games also don't use the leftmost and rightmost columns, as some misaligned CRT screens can cut them off. SNK recomends using only a 38x28 area.

Each tile in VRAM uses a 16bit word:

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Def Palette number Tile number

Tiles are mapped from top to bottom, and left to right (see layout). The VRAM_MOD ($3C0004) register can be set to 32 if tiles need to be updated in lines. See Displaying text.

Bankswitching

Games using the NEO-CMC chips are able to use more than 4096 fix tiles by using VRAM space $7500+. See Fix bankswitching.