Fix layer: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
mNo edit summary
 
No edit summary
 
(13 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Fix Layer ==
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 most often used to display text or HUDs like scores and health bars.


[[File:Cd2 psram.jpg|right|thumb|Pseudo-Static RAM used in the CD hardware versions, to store the Fix layer tileset.]]
It is somewhat limited compared to sprites:
* Tilesets can only contain a maximum of 4096 tiles (128KiB) without using bankswitching (see below).
* Only the first 16 palettes can be used.


40x32 tiles made of 8x8 pixels.
=Graphics format=


Upper 2 and lower 2 rows out of the visible screen area.
Fix tiles are 8*8 pixels, they're stored in the [[S ROM]], or in [[FIX file]]s before getting loaded to [[PSRAM]] in CD systems.
In some MVS systems, there is an embedded fix tileset stored in the [[SFIX ROM]] which can be swapped with the cartridge's one.


16 colors per tile
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 index).


Tiles can only use the first 16 palettes.
See [[Fix graphics format]] for more details.


Base address in VRAM for the map: $7000, one word per tile (4 bits for the palette number, 12 bits for the tile number).
=Fix map=


In MVS systems, the default fix tileset is stoed in the [[SFIX]] ROM.
[[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.]]


[[Catégorie:Video system]]
[[File:Fixlayout-tmpl.png|frame|Complete Fix layout map for reference.]]
 
The map is in [[VRAM]] starting at address $7000. The area used for display is 40*32 = 1280 words in size, but only 40x28 tiles are drawn in NTSC mode (2 hidden lines on the top and bottom).
 
Most games don't use the leftmost and rightmost columns, as some CRT screens can cut them off. SNK recomends only using a centered 38x28 safe zone.
 
Each map entry in VRAM uses a 16 bit word:
 
{{16BitRegister|Palette number|4|Tile number|12}}
 
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]]

Latest revision as of 17:11, 6 April 2020

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 most often used to display text or HUDs like scores and health bars.

It is somewhat limited compared to sprites:

  • Tilesets can only contain a maximum of 4096 tiles (128KiB) without using bankswitching (see below).
  • Only the first 16 palettes can be used.

Graphics format

Fix tiles are 8*8 pixels, they're stored in the S ROM, or in FIX files before getting loaded to PSRAM in CD systems. In some MVS systems, there is an embedded fix tileset stored in the SFIX ROM which can be swapped with the cartridge's 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 index).

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.
Complete Fix layout map for reference.

The map is in VRAM starting at address $7000. The area used for display is 40*32 = 1280 words in size, but only 40x28 tiles are drawn in NTSC mode (2 hidden lines on the top and bottom).

Most games don't use the leftmost and rightmost columns, as some CRT screens can cut them off. SNK recomends only using a centered 38x28 safe zone.

Each map entry in VRAM uses a 16 bit 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.