Controls the video output from all the VDPs.
Register (W) | 300h |
---|---|
Status (R) | 300h |
Data (R/W) | 304h |
Bits | Description | |
---|---|---|
0 ~ 4 | Register | |
5 ~ 13 | Current raster | |
14 | When in interlaced mode, contains which field is being shown. | 0 = Even field |
1 = Odd field | ||
15 | Currently displaying? (Not in V or H blank) |
0x00 | Screen mode |
---|---|
0x01 | Palette number |
0x02 | Palette data (R) |
0x03 | Palette data (W) |
0x04 | HuC6270 (7up) palette |
0x05 | HuC6272 (KING) BG0/1 palette |
0x06 | HuC6272 (KING) BG2/3 palette |
0x07 | HuC6271 (Rainbow) palette |
0x08 | Priority |
0x09 | Priority |
0x0A | Chroma Key Y |
0x0B | Chroma Key U |
0x0C | Chroma Key V |
0x0D | Constant Color |
0x0E | Cellophane control |
0x0F | Sprite cellophane bank select |
0x10 | Cellophane Coefficient 1A |
0x11 | Cellophane Coefficient 1B |
0x12 | Cellophane Coefficient 2A |
0x13 | Cellophane Coefficient 2B |
0x14 | Cellophane Coefficient 3A |
0x15 | Cellophane Coefficient 3B |
Set screen properties.
Bits | Description | Values |
---|---|---|
0 ~ 1 | Line count | 00 = 263line |
01 = 262line | ||
10 = interlace | ||
11 = Unknown | ||
2 | Sync source | 0 = Internal sync |
1 = External sync | ||
3 | Dot clock | 0 = 5MHz (256px wide) |
1 = 7MHz (320px wide) | ||
6 | BG color depth | 0 = 16 colors |
1 = 256 colors | ||
7 | Sprite color depth | 0 = 16 colors |
1 = 256 colors | ||
8 | HuC6270 (7up) BG Display | 0 = Hide |
1 = Show | ||
9 | HuC6270 (7up) SPR Display | 0 = Hide |
1 = Show | ||
10 | HuC6272 (KING) BG0 Display | 0 = Hide |
1 = Show | ||
11 | HuC6272 (KING) BG1 Display | 0 = Hide |
1 = Show | ||
12 | HuC6272 (KING) BG2 Display | 0 = Hide |
1 = Show | ||
13 | HuC6272 (KING) BG3 Display | 0 = Hide |
1 = Show | ||
14 | HuC6271 (RAINBOW) Display | 0 = Hide |
1 = Show |
Select a palette/color for operation.
Set the color data for the palette's color as selected in 0x01. Uses YUV format colors. Autoincrements 0x01 upon write.
Write only.
The current palette color. Read only.
HuC6270 (7up) palette offsets
Bits | Description |
---|---|
0 ~ 6 | 7up BG palette offset. (Upper 7 bits) |
8 ~ 14 | 7up Sprite palette offset. (Upper 7 bits) |
HuC6272 (KING) BG0/1 palette offsets
Bits | Description |
---|---|
0 ~ 6 | KING BG0 palette offset. (Upper 7 bits) |
8 ~ 14 | KING BG1 palette offset. (Upper 7 bits) |
HuC6272 (KING) BG2/3 palette offsets
Bits | Description |
---|---|
0 ~ 6 | KING BG2 palette offset. (Upper 7 bits) |
8 ~ 14 | KING BG3 palette offset. (Upper 7 bits) |
HuC6271 (Rainbow) palette offset
Bits | Description |
---|---|
0 ~ 6 | Rainbow palette offset. (Upper 7 bits) |
Bits | Description |
---|---|
0 ~ 2 | 7up BG |
4 ~ 6 | 7up SPR |
8 ~ 10 | RAINBOW |
Bits | Description |
---|---|
0 ~ 2 | KING BG0 |
4 ~ 6 | KING BG1 |
8 ~ 10 | KING BG2 |
12 ~ 14 | KING BG3 |
Chroma color key, Y portion. Top 8 bits are maximum, low 8 bits are minimum.
You can disable color keying by setting minimum greater than maximum.
Chroma color key, U portion. Top 8 bits are maximum, low 8 bits are minimum.
You can disable color keying by setting minimum greater than maximum.
Chroma color key, V portion. Top 8 bits are maximum, low 8 bits are minimum.
You can disable color keying by setting minimum greater than maximum.
The set color register for front cellophane and back cellophane effects. Same color format as palettes.
Changes only take effect on every new line (no mid-scanline changes.)
See cellophane description for more information.
Cellophane control. The layer bits are for which coefficient set to use. 0 is disabled.
Bits | Description | |
---|---|---|
0 ~ 1 | 7up BG | |
2 ~ 3 | 7up SPR | |
4 ~ 5 | KING BG0 | |
6 ~ 7 | KING BG1 | |
8 ~ 9 | KING BG2 | |
10 ~ 11 | KING BG3 | |
12 ~ 13 | RAINBOW | |
14 | Enable/Disable Cellophane | 0 = Disable |
1 = Enable | ||
15 | Cellophane location | 0 = Back |
1 = Front |
Changes only take effect on every new line (no mid-scanline changes.)
Each bit corresponds to whether that color palette bank gets cellophane treatment.
Changes only take effect on every new line (no mid-scanline changes.)
Cellophane Coefficient set 1's A value.
See cellophane description for more information.
Cellophane Coefficient set 1's B value.
See cellophane description for more information.
Cellophane Coefficient set 2's A value.
See cellophane description for more information.
Cellophane Coefficient set 2's B value.
See cellophane description for more information.
Cellophane Coefficient set 3's A value.
See cellophane description for more information.
Cellophane Coefficient set 3's B value.
See cellophane description for more information.
PC-FX doesn't use an RGB palette, it uses YUV. Most common RGB -> YUV conversion formula:
Y = 0.2990R + 0.5870G + 0.1140B U = -0.1686R - 0.3311G + 0.4997B + 0x80 V = 0.4998R - 0.4185G - 0.0813B + 0x80
The U and V values will be in the range 0 ~ 255. You must scale them to 1/16th to fit. Hword format for palette entry:
Bits | Description |
---|---|
0 ~ 3 | V (0 ~ 15) |
4 ~ 7 | U (0 ~ 15) |
8 ~ 15 | Y (0 ~ 255) |
The cellophane colors are determined using the constant color and the coefficients in the set chosen.
Coefficient values are packed like so:
Bits | Description |
---|---|
0 ~ 3 | Coefficient V value |
4 ~ 7 | Coefficient U value |
8 ~ 11 | Coefficient Y value |
Output colors are then determined like so: (If they are above 0xFF, they get clipped back to 0xFF)
Y = ((AY / 8) * FrontY ) + ((BY / 8) * BackY ) U = ((AU / 8) * (FrontU - 0x80)) + ((BU / 8) * (BackU - 0x80)) + 0x80 V = ((AV / 8) * (FrontV - 0x80)) + ((BV / 8) * (BackV - 0x80)) + 0x80