LCD Registers

From 3dbrew
Jump to navigation Jump to search

Registers

NAME PHYSICAL ADDRESS PROCESS VIRTUAL ADDRESS KERNEL VIRTUAL ADDRESS WIDTH
REG_LCDCOLORFILLMAIN 0x10202204 0x1ED02204 0xFFFD6204 4
REG_LCDCOLORFILLSUB 0x10202A04 0x1ED02A04 0xFFFD6A04 4

REG_*MAIN registers are used for the top LCD, while SUB is used for the bottom LCD. The registers for the main LCD is located at 0x1EF00400, while the sub LCD registers are located at 0x1EF00500.

REG_LCDCOLORFILL

Bit Description
7-0 Red component intensity
15-8 Green component intensity
23-16 Blue component intensity
24 Enable
31-25 ?

When the enable bit is set, the specified solid color is displayed on the LCD instead of the framebuffer.

0x1EF00X5C

Bit Description
15-0 Framebuffer width
31-16 Framebuffer height

This controls the displayed LCD framebuffer dimensions.

0x1EF00X70

Bit Description
15-0 Framebuffer format
31-16 ?

Framebuffer format

Bit Description
2-0 Color format
3 ?
4 Unused?
5 Set when the main screen 3D right framebuffer address is set.
6 1 = main screen, 0 = sub screen. However if bit5 is set, this bit is cleared.
7 ?
9-8 Value 1 = unknown, 3 = unknown: black screen.
15-10 Unused?

GSP module only allows the LCD stereoscopy to be enabled when bit5=1 and bit6=0 here. When GSP module updates this register, GSP module will automatically disable the stereoscopy if those bits are not set for enabling stereoscopy.

Framebuffer color formats

Value Description Actual color components ordering
0 GL_RGBA8_OES
1 GL_RGB8_OES BGR
2 GL_RGB565_OES RGB
3 GL_RGB5_A1_OES
4 GL_RGBA4_OES

0x1EF00X78

Bit Description
0 LCD framebuffer to display (0=first, 1=second)
7-1 ?
31-8 Unused

0x1EF00X90

Bit Description
31-0 Framebuffer width * pixel byte-size.

Framebuffers

Process Virtual Address Kernel Virtual Address Physical Address Description
0x1EF00468 0xFFFCE468 0x10400468 Main LCD, first framebuffer for 3D left
0x1EF0046C 0xFFFCE46C 0x1040046C Main LCD, second framebuffer for 3D left
0x1EF00494 0xFFFCE494 0x10400494 Main LCD, first framebuffer for 3D right
0x1EF00498 0xFFFCE498 0x10400498 Main LCD, second framebuffer for 3D right
0x1EF00568 0xFFFCE568 0x10400568 Sub LCD, first framebuffer
0x1EF0056C 0xFFFCE56C 0x1040056C Sub LCD, second framebuffer
0x1EF00594 0xFFFCE594 0x10400594 Sub LCD, unused first framebuffer
0x1EF00598 0xFFFCE598 0x10400598 Sub LCD, unused second framebuffer

The above framebuffer registers contains the physical address for each framebuffer, normally located in FCRAM in the application's GSP heap. When other processes use GSP as well, the framebuffers for the process is stored in VRAM instead.

These LCD framebuffers normally contain the last rendered frames from the GPU. The framebuffers are drawn from left-to-right, instead of top-to-bottom.(Thus the beginning of the framebuffer is drawn starting at the left side of the screen)

Both of the 3D screen left/right framebuffers are displayed regardless of the 3D slider's state, however when the 3D slider is set to "off" the 3D effect is disabled. Normally when the 3D slider's state is set to "off" the left/right framebuffer addresses are set to the same physical address. When the 3D effect is disabled and the left/right framebuffers are set to separate addresses, the LCD seems to alternate between displaying the left/right framebuffer each frame.