1
1
# 3D Display Control
2
2
3
- <style >
4
- tt {
5
- white-space : pre ;
6
- }
7
- </style >
8
-
9
3
This chapter talks about the registers used to control the 3D display.
10
4
11
5
<a id =" DISP3DCNT " ></a >
12
-
13
6
## DISP3DCNT: 3D display control (0x4000060, R/W)
14
7
15
- | Bits | Description |
16
- | --------- | ---------------------------------------------------------|
17
- | < tt >0</ tt > | Texture mapping enable (0=Disable, 1=Enable)
18
- | < tt >1</ tt > | Shading polygon attribute (0=Toon Shading, 1=Highlight Shading)
19
- | < tt >2</ tt > | Alpha test (0=Disable, 1=Enable) (see [ ALPHA\_ TEST\_ REF] ( 3d_disp_cnt.md#ALPHA_TEST_REF ) )
20
- | < tt >3</ tt > | Alpha blending (0=Disable, 1=Enable)
21
- | < tt >4</ tt > | Anti-aliasing (0=Disable, 1=Enable)
22
- | < tt >5</ tt > | Edge marking (0=Disable, 1=Enable) (see EDGE_COLOR)
23
- | < tt >6</ tt > | Fog color alpha mode (0=Alpha and color, 1=Only alpha) (see FOG_COLOR)
24
- | < tt >7</ tt > | Fog enable (0=Disable, 1=Enable)
25
- | < tt > 8-11</ tt > | Fog depth shift (< tt > FOG_STEP = 0x400 >> FOG_SHIFT</ tt > ) (see FOG_OFFSET)
26
- | < tt >12</ tt > | Framebuffer RDLINES underflow (0=None, 1=Underflow)
27
- | < tt >13</ tt > | Polygon/vertex RAM overflow (0=None, 1=Overflow)
28
- | < tt >14</ tt > | Rear plane mode (0=Use clear color, 1=Bitmap)
29
- | < tt > 15-31</ tt > | Unused
8
+ | Bit(s) | Description |
9
+ | --------| ---------------------------------------------------------|
10
+ | 0 | Texture mapping enable (0=Disable, 1=Enable)
11
+ | 1 | Shading polygon attribute (0=Toon Shading, 1=Highlight Shading)
12
+ | 2 | Alpha test (0=Disable, 1=Enable) (see [ ALPHA\_ TEST\_ REF] ( 3d_disp_cnt.md#ALPHA_TEST_REF ) )
13
+ | 3 | Alpha blending (0=Disable, 1=Enable)
14
+ | 4 | Anti-aliasing (0=Disable, 1=Enable)
15
+ | 5 | Edge marking (0=Disable, 1=Enable) (see ` EDGE_COLOR ` )
16
+ | 6 | Fog color alpha mode (0=Alpha and color, 1=Only alpha) (see ` FOG_COLOR ` )
17
+ | 7 | Fog enable (0=Disable, 1=Enable)
18
+ | 8-11 | Fog depth shift (` FOG_STEP = 0x400 >> FOG_SHIFT ` ) (see ` FOG_OFFSET ` )
19
+ | 12 | Framebuffer RDLINES underflow (0=None, 1=Underflow)
20
+ | 13 | Polygon/vertex RAM overflow (0=None, 1=Overflow)
21
+ | 14 | Rear plane mode (0=Use clear color, 1=Bitmap)
22
+ | 15-31 | Unused
30
23
31
24
<a id =" VIEWPORT " ></a >
32
-
33
25
## VIEWPORT: Set 3D viewport (0x4000580, W)
34
26
35
- | Bits | Description |
36
- | --------- | ---------------------------------------------------------|
37
- | < tt > 0-7</ tt > | X1: Left-most X coordinate (0...255)
38
- | < tt > 8-15</ tt > | Y1: Bottom-most Y coordinate (0...191)
39
- | < tt > 16-23</ tt > | X2: Right-most X coordinate (0...255)
40
- | < tt > 24-31</ tt > | Y2: Top-most Y coordinate (0...191)
27
+ | Bit(s) | Description |
28
+ | --------| ---------------------------------------------------------|
29
+ | 0-7 | X1: Left-most X coordinate (0...255)
30
+ | 8-15 | Y1: Bottom-most Y coordinate (0...191)
31
+ | 16-23 | X2: Right-most X coordinate (0...255)
32
+ | 24-31 | Y2: Top-most Y coordinate (0...191)
41
33
42
34
To fill the screen: X1=0, Y1=0, X2=255, Y2=191
43
35
44
36
Note that coordinate (0, 0) is the bottom-left corner of the screen, while ht is
45
37
the upper-left corner of the screen in the 2D graphics engine.
46
38
47
39
<a id =" DISP_1DOT_DEPTH " ></a >
48
-
49
- ## DISP\_ 1DOT\_ DEPTH: Max depth to render 1-dot polygon (0x4000610, W)
40
+ ## DISP\_ 1DOT\_ DEPTH: Max depth for 1-dot polygons (0x4000610, W)
50
41
51
42
When a polygon is too small or too far away it is reduced to a single pixel on
52
43
the screen. This register will determine the cutoff distance that the 3D engine
53
44
will use to determine whether to render them or not.
54
45
55
- | Bits | Description |
56
- | --------- | ---------------------------------------------------------|
57
- | < tt > 0-14</ tt > | Max W value (12.3 unsigned fixed point)
58
- | < tt > 15-31</ tt > | Unused
46
+ | Bit(s) | Description |
47
+ | --------| ---------------------------------------------------------|
48
+ | 0-14 | Max W value (12.3 unsigned fixed point)
49
+ | 15-31 | Unused
59
50
60
- This check can be enabled on a per-polygon basis with bit 13 of POLYGON_ATTR.
51
+ This check can be enabled on a per-polygon basis with bit 13 of ` POLYGON_ATTR ` .
61
52
62
53
The comparison always uses the W coordinate regardless of the buffering mode.
63
54
64
55
<a id =" ALPHA_TEST_REF " ></a >
65
-
66
56
## ALPHA\_ TEST\_ REF: Alpha test reference value (0x4000340, W)
67
57
68
58
When alpha test mode is enabled in [ DISP3DCNT] ( 3d_disp_cnt.md#DISP3DCNT ) ,
@@ -72,7 +62,7 @@ their alpha value is greater than zero. A value of 31 will hide all polygons.
72
62
73
63
This test is done after applying texture and polygon transparency.
74
64
75
- | Bits | Description |
76
- | --------- | ---------------------------------------------------------|
77
- | < tt > 0-4</ tt > | Alpha test reference (0..31)
78
- | < tt > 5-31</ tt > | Unused
65
+ | Bit(s) | Description |
66
+ | --------| ---------------------------------------------------------|
67
+ | 0-4 | Alpha test reference (0..31)
68
+ | 5-31 | Unused
0 commit comments