L0 ROM

From NeoGeo Development Wiki
Revision as of 06:50, 26 June 2012 by Furrtek (talk | contribs)
Jump to navigation Jump to search
Toshiba LO ROM chip taken from an AES system.
File:Cd2 lo.jpg
LO ROM chip found on a CDM3-2 board.

LO stands for "LOokup". It's a 64KiB ROM chip found in every NeoGeo systems, which contains byte values used by the GPU to shrink sprites vertically.

The dump is often called 000-lo.lo in BIOS sets.

Data

The data contained in this ROM is actually 256 tables of 256 bytes, each table corresponding to a value of the vertical shrinking for sprites.

For the first 256 lines (first half of a full sprite), the index in the table is the horizontal line number of the sprite currently being drawn (scanline - Y position).

Each byte is used as 2 nibbles:

  • The upper nibble is the tile number index to read in the tilemap table in VRAM SCB1 (0 to 15).
  • The lower nibble is the line number of that tile to fetch in the C ROMs.

For the last 256 lines (second half of a full sprite), the index in the table is 255-((scanline - Y position) & 255). The table is read backwards.

Each byte is used as 2 nibbles:

  • The upper nibble is the tile number index XOR $1F to read in the tilemap table in VRAM SCB1 (0 to 15).
  • The lower nibble is the line number XOR $F of that tile to fetch in the C ROMs.

Example of GPU processing

(Maybe place this part in the GPU page ?)

Sprite with Y zoom value = $1B and tile height = 2 (32 pixels).

  • Line 0 of sprite. GPU asks LO data at address $1B00. Data is $00: Tilemap index 0, line 0 of tile.
  • Line 1 of sprite. GPU asks LO data at address $1B01. Data is $08: Tilemap index 0, line 8 of tile.
  • Line 2 of sprite. GPU asks LO data at address $1B02. Data is $10: Tilemap index 1, line 0 of tile.

...

  • Line 26 of sprite. GPU asks LO data at address $1B1A. Data is $E8: Tilemap index is $E, line 8 of tile.
  • Line 27 of sprite. GPU asks LO data at address $1B1B. Data is $F8: Tilemap index is $F, line 8 of tile.
  • Line 28 of sprite. GPU asks LO data at address $1B1C. Data is $FF: Tilemap index is $F, line $F of tile.
  • Line 29 of sprite. GPU asks LO data at address $1B1D. Data is $FF: Tilemap index is $F, line $F of tile.

...

Datasheet

Official TC531001 datasheet: [[1]]