lcd_controller
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
lcd_controller [2025/03/22 02:27] – arisotura | lcd_controller [2025/05/17 00:05] (current) – arisotura | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== LCD controller ====== | ====== LCD controller ====== | ||
- | The gamepad provides simple | + | The gamepad provides simple display hardware |
Register map: | Register map: | ||
Line 13: | Line 13: | ||
| 0xF0009418 | Horizontal end of display | | | 0xF0009418 | Horizontal end of display | | ||
| 0xF000941C | Vertical end of display | | | 0xF000941C | Vertical end of display | | ||
- | | 0xF0009420 | ?? | | + | | 0xF0009420 | Video feed X offset |
- | | 0xF0009424 | ?? | | + | | 0xF0009424 |
- | | 0xF0009428 | + | | 0xF0009428 | Video feed Y offset | |
+ | | 0xF000942C | Video feed height | | ||
+ | | 0xF0009430 | ||
+ | | 0xF0009434 | ||
| 0xF0009460 | Framebuffer X offset | | | 0xF0009460 | Framebuffer X offset | | ||
| 0xF0009464 | Framebuffer width | | | 0xF0009464 | Framebuffer width | | ||
Line 22: | Line 25: | ||
| 0xF0009470 | Framebuffer stride | | | 0xF0009470 | Framebuffer stride | | ||
| 0xF0009474 | Framebuffer address | | | 0xF0009474 | Framebuffer address | | ||
+ | | 0xF0009478 | ?? | | ||
| 0xF0009480 | Display control | | | 0xF0009480 | Display control | | ||
+ | | 0xF0009484 | ?? | | ||
+ | | 0xF0009488 | ?? | | ||
+ | | 0xF0009490 | ?? | | ||
+ | | 0xF0009494 | ?? | | ||
| 0xF00094B0 | Pixel format | | | 0xF00094B0 | Pixel format | | ||
| 0xF00094B4 | ?? | | | 0xF00094B4 | ?? | | ||
+ | | 0xF00094B8 | ?? | | ||
+ | | 0xF00094BC | ?? | | ||
+ | | 0xF00094C0 | ?? | | ||
+ | | 0xF00094C4 | ?? | | ||
| 0xF00094C8 | VCount - current vertical position | | | 0xF00094C8 | VCount - current vertical position | | ||
+ | | 0xF00094D0+(N*4) | YUV->RGB matrix (N=0..8) | | ||
+ | | 0xF00094F4 | ?? | | ||
+ | | 0xF00094F8 | Camera sync | | ||
| 0xF00094FC | Counter of sorts | | | 0xF00094FC | Counter of sorts | | ||
+ | | || | ||
| 0xF0009500 | Palette address | | | 0xF0009500 | Palette address | | ||
| 0xF0009504 | Palette data | | | 0xF0009504 | Palette data | | ||
Line 33: | Line 49: | ||
| 0xF0009510 | VCount IRQ position 3 | | | 0xF0009510 | VCount IRQ position 3 | | ||
| 0xF0009514 | VCount IRQ position 4 | | | 0xF0009514 | VCount IRQ position 4 | | ||
- | | 0xF0009600+(N*4) | Color correction LUT entry N | | + | | || |
+ | | 0xF0009600+(N*4) | Color correction LUT entry N (N=0..31) | ||
| 0xF0009684 | Color correction mask | | | 0xF0009684 | Color correction mask | | ||
+ | | || | ||
| 0xF0009700 | ?? | | | 0xF0009700 | ?? | | ||
| 0xF0009704 | ?? | | | 0xF0009704 | ?? | | ||
Line 137: | Line 155: | ||
^ Bits ^ Desc. ^ | ^ Bits ^ Desc. ^ | ||
| 0 | ?? breaks display | | | 0 | ?? breaks display | | ||
- | | 1 | Must be set for display | + | | 1 | Enable |
- | | 2 | ?? causes weird effects | + | | 2 | Enable video feed (camera/ |
- | | 3 | ?? | | + | | 3 | Video feed input? (0=post-processed camera?, 1=raw camera? |
- | | 4 | Must be set for display to work. Presumably general display enable. | + | | 4 | Enable overlay | |
+ | | 5 | ?? | | ||
+ | | 6 | ?? | | ||
**0xF00094B0** | **0xF00094B0** | ||
Line 150: | Line 170: | ||
| 2 | ?? | | | 2 | ?? | | ||
| 3 | ?? | | | 3 | ?? | | ||
- | | 7 | Weird color mode (YUV?) | | + | | 7 | Color mode; 0=RGB, 1=YUV | |
| 8 | ?? collapses overlay to 1px vertical line | | | 8 | ?? collapses overlay to 1px vertical line | | ||
| 9 | ?? | | | 9 | ?? | | ||
Line 164: | Line 184: | ||
For the paletted formats, see the palette registers. | For the paletted formats, see the palette registers. | ||
+ | |||
+ | Bit 7 causes color components to be interpreted as YUV, with the following mapping: R=V, G=Y, B=U. It seems the handling is different based on the pixel format? Notably, in YUV mode, pixel formats 0 and 1 seem to entirely ignore the palette and instead somehow directly convert indices to color components. | ||
+ | |||
+ | In YUV mode, the matrix at 0xF00094D0..0xF00094F0 is used to convert the YUV components to RGB. | ||
Line 169: | Line 193: | ||
Current vertical position. | Current vertical position. | ||
+ | |||
+ | |||
+ | **0xF00094D0+(N*4)** | ||
+ | |||
+ | YUV->RGB matrix. | ||
+ | |||
+ | ^ Register | ||
+ | | 0xF00094D0 | Y -> G factor | 0x0A5 = 74 | | ||
+ | | 0xF00094D4 | U -> G factor | 0x04E = -14 | | ||
+ | | 0xF00094D8 | V -> G factor | 0x062 = -34 | | ||
+ | | 0xF00094DC | Y -> B factor | 0x0A5 = 74 | | ||
+ | | 0xF00094E0 | U -> B factor | 0x122 = 136 | | ||
+ | | 0xF00094E4 | V -> B factor | 0x000 = 0 | | ||
+ | | 0xF00094E8 | Y -> R factor | 0x0A5 = 74 | | ||
+ | | 0xF00094EC | U -> R factor | 0x000 = 0 | | ||
+ | | 0xF00094F0 | V -> R factor | 0x0B9 = 114 | | ||
+ | |||
+ | The factors work in a bit of a weird way. | ||
+ | |||
+ | ^ Bits ^ Desc. ^ | ||
+ | | 0-5 | Amount | | ||
+ | | 6 | Sign | | ||
+ | | 7-8 | Multiplier; 0=1, 1=2, 2/3=4 | | ||
+ | |||
+ | The sign bit makes the value negative, but it's not two's complement. Instead: 0x3F = 63, 0x7F = -63. | ||
+ | |||
+ | The multiplier allows to increase the final value. For example, values 0x30, 0x98, 0x10C and 0x18C are equivalent. | ||
+ | |||
+ | Note: YUV mode produces darker colors, even with maximum factor values. One can use the color correction registers at 0xF0009600 to compensate for this. | ||
+ | |||
+ | |||
+ | **0xF00094F8** | ||
+ | |||
+ | Camera sync. | ||
+ | |||
+ | ^ Bits ^ Desc. ^ | ||
+ | | 0-10 | Vertical position | | ||
+ | | 15 | ??? | | ||
+ | |||
+ | This register allows to synchronize camera output to the display. The camera frame IRQ fires 8 scanlines after the specified position. | ||
+ | |||
+ | This register can be disabled by setting it to a value equal to or greater than the display' | ||
lcd_controller.1742610475.txt.gz · Last modified: 2025/03/22 02:27 by arisotura