Skip to content

Commit c33b5a3

Browse files
committed
3d: Simplify some formatting
1 parent bc95f0d commit c33b5a3

File tree

1 file changed

+31
-41
lines changed

1 file changed

+31
-41
lines changed

content/3d_disp_cnt.md

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,58 @@
11
# 3D Display Control
22

3-
<style>
4-
tt {
5-
white-space: pre;
6-
}
7-
</style>
8-
93
This chapter talks about the registers used to control the 3D display.
104

115
<a id="DISP3DCNT"></a>
12-
136
## DISP3DCNT: 3D display control (0x4000060, R/W)
147

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
3023

3124
<a id="VIEWPORT"></a>
32-
3325
## VIEWPORT: Set 3D viewport (0x4000580, W)
3426

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)
4133

4234
To fill the screen: X1=0, Y1=0, X2=255, Y2=191
4335

4436
Note that coordinate (0, 0) is the bottom-left corner of the screen, while ht is
4537
the upper-left corner of the screen in the 2D graphics engine.
4638

4739
<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)
5041

5142
When a polygon is too small or too far away it is reduced to a single pixel on
5243
the screen. This register will determine the cutoff distance that the 3D engine
5344
will use to determine whether to render them or not.
5445

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
5950

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`.
6152

6253
The comparison always uses the W coordinate regardless of the buffering mode.
6354

6455
<a id="ALPHA_TEST_REF"></a>
65-
6656
## ALPHA\_TEST\_REF: Alpha test reference value (0x4000340, W)
6757

6858
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.
7262

7363
This test is done after applying texture and polygon transparency.
7464

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

Comments
 (0)