VDP Pattern: Difference between revisions

From MegaDrive Development Wiki
Jump to navigation Jump to search
mNo edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Definition==
The pattern generator start at 0x0 at VRAM and each pattern consist of a 8x8 pixel definition (8x16 in interlace mode 2).
The pattern generator start at 0x0 at VRAM and each pattern consist of a 8x8 pixel definition (8x16 in interlace mode 2).


Each pixel is defined by a 4 bit nibble corresponding to a color number in a [[VDP_Palette|palette]]. Therefore 32 bytes are required to a complete pattern (64 bytes in interlace mode 2).
Each pixel is defined by a 4 bit nibble corresponding to a color number in a [[VDP_Palette|palette]]. Therefore 32 bytes are required to a complete pattern (64 bytes in interlace mode 2).
==Example==
[[File:tile_and_palette.png]]
A lovely cherry made of 4 tiles and its palette
===palette===
<syntaxhighlight>
cherry_pal:
.word 0x0000
.word 0x0060
.word 0x06e6
.word 0x00a0
.word 0x0020
.word 0x0006
.word 0x000a
.word 0x000e
.word 0x022e
.word 0x066e
.word 0x0aae
.word 0x0000
.word 0x0000
.word 0x0000
.word 0x0000
.word 0x0000
</syntaxhighlight>
===tile (non interlace-mode)===
<syntaxhighlight>
cherry_tile:
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x11
.byte 0x00,0x55,0x55,0x53
.byte 0x05,0x67,0x77,0x65
.byte 0x56,0x89,0x87,0x76
.byte 0x57,0x9a,0x97,0x76
.byte 0x00,0x01,0x11,0x10
.byte 0x00,0x11,0x23,0x40
.byte 0x11,0x33,0x34,0x00
.byte 0x32,0x14,0x34,0x00
.byte 0x14,0x01,0x34,0x00
.byte 0x40,0x01,0x24,0x00
.byte 0x50,0x01,0x34,0x00
.byte 0x55,0x55,0x55,0x00
.byte 0x57,0x89,0x87,0x76
.byte 0x57,0x77,0x77,0x75
.byte 0x56,0x77,0x77,0x65
.byte 0x05,0x66,0x66,0x65
.byte 0x00,0x55,0x55,0x55
.byte 0x00,0x00,0x00,0x05
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00
.byte 0x56,0x77,0x76,0x50
.byte 0x68,0x98,0x77,0x65
.byte 0x79,0xa9,0x77,0x65
.byte 0x78,0x98,0x77,0x65
.byte 0x77,0x77,0x77,0x65
.byte 0x67,0x77,0x76,0x65
.byte 0x56,0x66,0x66,0x50
.byte 0x05,0x55,0x55,0x00
</syntaxhighlight>
===tile (interlace-mode)===
<syntaxhighlight>
cherry_tile:
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x11
.byte 0x00,0x55,0x55,0x53
.byte 0x05,0x67,0x77,0x65
.byte 0x56,0x89,0x87,0x76
.byte 0x57,0x9a,0x97,0x76
.byte 0x57,0x89,0x87,0x76
.byte 0x57,0x77,0x77,0x75
.byte 0x56,0x77,0x77,0x65
.byte 0x05,0x66,0x66,0x65
.byte 0x00,0x55,0x55,0x55
.byte 0x00,0x00,0x00,0x05
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x01,0x11,0x10
.byte 0x00,0x11,0x23,0x40
.byte 0x11,0x33,0x34,0x00
.byte 0x32,0x14,0x34,0x00
.byte 0x14,0x01,0x34,0x00
.byte 0x40,0x01,0x24,0x00
.byte 0x50,0x01,0x34,0x00
.byte 0x55,0x55,0x55,0x00
.byte 0x56,0x77,0x76,0x50
.byte 0x68,0x98,0x77,0x65
.byte 0x79,0xa9,0x77,0x65
.byte 0x78,0x98,0x77,0x65
.byte 0x77,0x77,0x77,0x65
.byte 0x67,0x77,0x76,0x65
.byte 0x56,0x66,0x66,0x50
.byte 0x05,0x55,0x55,0x00
</syntaxhighlight>


[[Category:Video_system]]
[[Category:Video_system]]

Latest revision as of 06:48, 17 July 2012

Definition

The pattern generator start at 0x0 at VRAM and each pattern consist of a 8x8 pixel definition (8x16 in interlace mode 2).

Each pixel is defined by a 4 bit nibble corresponding to a color number in a palette. Therefore 32 bytes are required to a complete pattern (64 bytes in interlace mode 2).

Example

A lovely cherry made of 4 tiles and its palette

palette

cherry_pal:
.word 0x0000
.word 0x0060
.word 0x06e6
.word 0x00a0
.word 0x0020
.word 0x0006
.word 0x000a
.word 0x000e
.word 0x022e
.word 0x066e
.word 0x0aae
.word 0x0000
.word 0x0000
.word 0x0000
.word 0x0000
.word 0x0000

tile (non interlace-mode)

cherry_tile:
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x11
.byte 0x00,0x55,0x55,0x53
.byte 0x05,0x67,0x77,0x65
.byte 0x56,0x89,0x87,0x76
.byte 0x57,0x9a,0x97,0x76

.byte 0x00,0x01,0x11,0x10
.byte 0x00,0x11,0x23,0x40
.byte 0x11,0x33,0x34,0x00
.byte 0x32,0x14,0x34,0x00
.byte 0x14,0x01,0x34,0x00
.byte 0x40,0x01,0x24,0x00
.byte 0x50,0x01,0x34,0x00
.byte 0x55,0x55,0x55,0x00

.byte 0x57,0x89,0x87,0x76
.byte 0x57,0x77,0x77,0x75
.byte 0x56,0x77,0x77,0x65
.byte 0x05,0x66,0x66,0x65
.byte 0x00,0x55,0x55,0x55
.byte 0x00,0x00,0x00,0x05
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00

.byte 0x56,0x77,0x76,0x50
.byte 0x68,0x98,0x77,0x65
.byte 0x79,0xa9,0x77,0x65
.byte 0x78,0x98,0x77,0x65
.byte 0x77,0x77,0x77,0x65
.byte 0x67,0x77,0x76,0x65
.byte 0x56,0x66,0x66,0x50
.byte 0x05,0x55,0x55,0x00

tile (interlace-mode)

cherry_tile:
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x11
.byte 0x00,0x55,0x55,0x53
.byte 0x05,0x67,0x77,0x65
.byte 0x56,0x89,0x87,0x76
.byte 0x57,0x9a,0x97,0x76
.byte 0x57,0x89,0x87,0x76
.byte 0x57,0x77,0x77,0x75
.byte 0x56,0x77,0x77,0x65
.byte 0x05,0x66,0x66,0x65
.byte 0x00,0x55,0x55,0x55
.byte 0x00,0x00,0x00,0x05
.byte 0x00,0x00,0x00,0x00
.byte 0x00,0x00,0x00,0x00

.byte 0x00,0x01,0x11,0x10
.byte 0x00,0x11,0x23,0x40
.byte 0x11,0x33,0x34,0x00
.byte 0x32,0x14,0x34,0x00
.byte 0x14,0x01,0x34,0x00
.byte 0x40,0x01,0x24,0x00
.byte 0x50,0x01,0x34,0x00
.byte 0x55,0x55,0x55,0x00
.byte 0x56,0x77,0x76,0x50
.byte 0x68,0x98,0x77,0x65
.byte 0x79,0xa9,0x77,0x65
.byte 0x78,0x98,0x77,0x65
.byte 0x77,0x77,0x77,0x65
.byte 0x67,0x77,0x76,0x65
.byte 0x56,0x66,0x66,0x50
.byte 0x05,0x55,0x55,0x00