Sprite Table: Difference between revisions
From NerdConsole
Jump to navigationJump to search
NerdOfEpic (talk | contribs) (Created page with "The Sprite Table describes the forground layer for a game. You can think of this as the objects that move around such as the player, enemies, and projectiles. NerdConsole has a single Sprite Table that supports up to 256 sprites. === Sprite Table Format === Sprite Tables in NerdConsole use a 4-byte structure for each entry. Bit 7 6 5 4 3 2 1 0 Byte 0 x x x x x x x x Byte 1 y y y y y y y y Byte 2 M F D C p p p p Byte 3 i i i i i i i i * x - x-axis position of the upper...") |
NerdOfEpic (talk | contribs) No edit summary |
||
Line 3: | Line 3: | ||
=== Sprite Table Format === | === Sprite Table Format === | ||
Sprite Tables in NerdConsole use a 4-byte structure for each entry. | Sprite Tables in NerdConsole use a 4-byte structure for each entry. | ||
{| class="wikitable" | |||
Bit 7 6 5 4 3 2 1 0 | ! Bit !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0 | ||
Byte 0 x x x x x x x x | |- | ||
Byte 1 y y y y y y y y | ! Byte 0 | ||
Byte 2 M F D C p p p p | | x || x || x || x || x || x || x || x | ||
Byte 3 i i i i i i i i | |- | ||
! Byte 1 | |||
| y || y || y || y || y || y || y || y | |||
|- | |||
! Byte 2 | |||
| M || F || D || C || p || p || p || p | |||
|- | |||
! Byte 3 | |||
| i || i || i || i || i || i || i || i | |||
|} | |||
* x - x-axis position of the upper left corner of the sprite on the screen | * x - x-axis position of the upper left corner of the sprite on the screen | ||
* y - y-axis position of the upper left corner of the sprite on the screen* | * y - y-axis position of the upper left corner of the sprite on the screen* |
Revision as of 14:36, 14 January 2024
The Sprite Table describes the forground layer for a game. You can think of this as the objects that move around such as the player, enemies, and projectiles. NerdConsole has a single Sprite Table that supports up to 256 sprites.
Sprite Table Format
Sprite Tables in NerdConsole use a 4-byte structure for each entry.
Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|
Byte 0 | x | x | x | x | x | x | x | x |
Byte 1 | y | y | y | y | y | y | y | y |
Byte 2 | M | F | D | C | p | p | p | p |
Byte 3 | i | i | i | i | i | i | i | i |
- x - x-axis position of the upper left corner of the sprite on the screen
- y - y-axis position of the upper left corner of the sprite on the screen*
- M - Mirror (Left/Right)
- F - Flip (Top/Bottom)
- D - Depth Flag (0 = Over BG, 1 = Under BG)
- C - Color Cycling
- p - Sub-Palette Index
- i - Tile Table Index