Difference between revisions of "GSPGPU:SetBufferSwap"

From 3dbrew
Jump to navigation Jump to search
(Removed FBInfo)
 
(5 intermediate revisions by 4 users not shown)
Line 9: Line 9:
 
|-
 
|-
 
| 1
 
| 1
| Screen ID: 0=main, 1=sub
+
| Screen ID (0 = top, 1 = bottom)
 
|-
 
|-
| 2-7
+
| 2-8
| Framebuffer info structure
+
| [[GSP_Shared_Memory#Framebuffer_info_structure|Framebuffer info structure]]
 
|}
 
|}
  
Line 28: Line 28:
 
|}
 
|}
  
=Framebuffer info structure=
+
=Description=
{| class="wikitable" border="1"
+
This sets GSP state for the LCD framebuffers. When the value of [[GPU/External_Registers#LCD_Source_Framebuffer_Setup|VCount]] (offset 0x54) is greater than a certain constant, the GSP state for the specified screen is immediately written to the LCD registers. This constant is 0x52 on GSP for [[11.16.0-48|11.16.0-48]], though it used to be 0x54.
|-
 
!  Index Word
 
Description
 
|-
 
| 0
 
| Active framebuffer: 0=first, 1=second
 
|-
 
| 1
 
| [[LCD#Framebuffers|Framebuffer]] virtual address, for the main screen this is the 3D left framebuffer
 
|-
 
| 2
 
| For the main screen: 3D right framebuffer address
 
|-
 
| 3
 
| Value for [[LCD|0x1EF00X90]], controls framebuffer width
 
|-
 
| 4
 
| Framebuffer format, this u16 is written to the low u16 for [[LCD]] register 0x1EF00X70.
 
|-
 
| 5
 
| Value for [[LCD|0x1EF00X78]], controls which framebuffer is displayed
 
|-
 
| 6
 
| ?
 
|}
 
 
 
== Framebuffer format field ==
 
{| class="wikitable" border="1"
 
|-
 
!  Bit
 
!  Description
 
|-
 
| 3-0
 
| Color format
 
|-
 
| 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.
 
|-
 
| 15-10
 
| Unused?
 
|}
 
 
 
== Color formats ==
 
{| class="wikitable" border="1"
 
|-
 
!  Value
 
!  Description
 
|-
 
| 0
 
| GL_RGBA8_OES
 
|-
 
| 1
 
| GL_RGB8_OES
 
|-
 
| 2
 
| GL_RGB565_OES
 
|-
 
| 3
 
| GL_RGB5_A1_OES
 
|-
 
| 4
 
| GL_RGBA4_OES
 
|}
 
  
=Description=
+
This command should only be used when directly writing to the framebuffers; when using the GPU the framebuffer info stored in [[GSP_Shared_Memory#Framebuffer_info|GSP shared memory]] should be used instead.
This sets GSP state for the LCD framebuffers, and other state as well. When the value of [[LCD]] register 0x1EF00X54 is >0x54, the GSP state for the specified screenID is immediately written to the LCD registers. This command should only be used when directly writing to the framebuffers, otherwise when rendering to the framebuffers with the [[GPU]] the framebuffer info stored in [[GSP_Shared_Memory|GSP shared memory]] should be used instead.
 

Latest revision as of 21:35, 13 October 2023

Request[edit]

Index Word Description
0 Header code [0x00050200]
1 Screen ID (0 = top, 1 = bottom)
2-8 Framebuffer info structure

Response[edit]

Index Word Description
0 Header code
1 Result code

Description[edit]

This sets GSP state for the LCD framebuffers. When the value of VCount (offset 0x54) is greater than a certain constant, the GSP state for the specified screen is immediately written to the LCD registers. This constant is 0x52 on GSP for 11.16.0-48, though it used to be 0x54.

This command should only be used when directly writing to the framebuffers; when using the GPU the framebuffer info stored in GSP shared memory should be used instead.