dreamcast/notes/ta.txt
Zack Buhman 481a0cb0dc move maple definitions to a new maple/ directory
maple.cpp now uses the new maple_bus_commands.h
2023-12-09 16:38:57 +08:00

177 lines
4.9 KiB
Plaintext

======= KMYINIT.C ========
- ISP_FEED_CFG -- TRANSLUCENCY_CACHE_SIZE(0x200)
- FPU_SHAD_SCALE -- SCALE_FACTOR(1)
- FPU_CULL_VAL -- 1.0f
- FPU_PERP_VAL -- 0.0f
- SPAN_SORT_CFG -- SPAN_SORT_ENABLE | OFFSET_SORT_ENABLE
- FOG_COL_RAM -- RED(127) | GREEN(127) | BLUE(127)
- FOG_COL_VERT -- RED(127) | GREEN(127) | BLUE(127)
- FOG_CLAMP_MIN -- ALPHA(0) | RED(0) | GREEN(0) | BLUE(0)
- FOG_CLAMP_MAX -- ALPHA(255) | RED(255) | GREEN(255) | BLUE(255)
- HALF_OFFSET -- TSP_TEXEL_SAMPLE_POSITION_CENTER
| TSP_PIXEL_SAMPLE_POSITION_CENTER
| FPU_PIXEL_SAMPLE_POSITION_CENTER
- FPU_PARAM_CFG -- REGION_HEADER_TYPE__2
| TSP_PARAMETER_BURST_TRIGGER(31)
| ISP_PARAMETER_BURST_TRIGGER(31)
| POINTER_BURST_SIZE(7) // must be less than OPB size
| POINTER_FIRST_BURST_SIZE(7) // half of pointer burst size(?)
===========================
jargon:
OPB - Object Pointer Block (a list of pointers to objects in the object list)
OL - Object list
ISP - Image Synthesis Processor
TSP - Texture Shading Processor
====== KMYSETUPTA.C ======
The OPB initial area size that is needed for one TA input list is the
product of the total OPB size for all lists specified by the
TA_ALLOC_CTRL register before the input of that list, multiplied by
the number of Tiles in the Global Tile Clip area that is specified by
the TA_GLOB_TILE_CLIP register. The amount of memory that should be
reserved in texture memory as the OPB initial area is the sum of the
OPB initial area size for the one list added together for each of the
polygon lists that are input to the TA.
(OPB initial area size for one list) = {(Opaque list OPB size)} * (Number of Tiles in Global Tile Clip area) x 4 bytes
+ 4byte
- TA_GLOB_TILE_CLIP -- TILE_Y_NUM(480 / 32)
| TILE_X_NUM(640 / 32)
(removes polygons that are entirely outside the clip area)
- TA_ALLOC_CTRL -- TA_ALLOC_CTRL__OPB_MODE_INCREASING
| TA_ALLOC_CTRL__PT_OPB__NONE
| TA_ALLOC_CTRL__TM_OPB__NONE
| TA_ALLOC_CTRL__T_OPB__NONE
| TA_ALLOC_CTRL__OM_OPB__NONE
| TA_ALLOC_CTRL__O_OPB__16
- TA_ISP_BASE --
(Base address for ISP/TSP parameters (relative address from the start of texture memory) (read by PARAM_BASE))
- TA_OL_LIMIT - The last address of the object list (relative address from the start of texture memory)
- TA_PARAM_LIMIT aka TA_ISP_LIMIT - The last address of the ISP/TSP parameter list (relative address from the start of texture memory)
- TA_NEXT_OPB_INIT - the address for storing additional OPBs during list initialization (relative address from the start of texture memory)
The value in the TA_NEXT_OPB_INIT register, which should be set prior
to list initialization, is the sum starting address value of the
Object List that is stored in texture memory and the OPB initial area
size.
(TA_NEXT_OPB_INIT register value) = (TA_OL_BASE register value at list initialization) + (OPB initial area size at list initialization)
-- &object_list[0] + (sizeof (mem->object_list))
(end of object_list)
- SOFTRESET = SOFTRESET__TA_SOFT_RESET
- SOFTRESET = 0
- TA_GLOB_TILE_CLIP = TILE_Y_NUM(15)
| TILE_X_NUM(20) // 640x480
- TA_ISP_BASE = 0x00000000
- TA_ISP_LIMIT = 0x00100000
- TA_OL_BASE = 0x00100000
- TA_OL_LIMIT = 0x00200000
- TA_NEXT_OPB_INIT = 0x00100000
- TA_LIST_INIT
- dummy read on TA_LIST_INIT
==== BGPLANE ====
KMYSETPASSDEPTH.C
KMYINITIALIZEBGPLANE.C
[ 0] = DEPTH_COMPARE_MODE(GREATER)
[ 1] = SRC_ALPHA(One)
| FOG_CONTROL(NO_FOG)
[ 2] = 0
[ 3] = 0.0 // x
[ 4] = 0.0 // y
[ 5] = 1.f/100000 // 1/z
[ 6] = 0x0FF000000 // color
[ 7] = 0.0 // x
[ 8] = 0.0 // y
[ 9] = 1.f/100000 // 1/z
[10] = 0x0FF000000 // color
[11] = 0.0 // x
[12] = 0.0 // y
[13] = 1.f/100000 // 1/z
[14] = 0x0FF000000 // color
==== KMYSTARTRENDER.C ====
region array diagram on page 179
REGION_BASE the region array is not generated by the TA
PARAM_BASE -- equal to TA_ISP_BASE
FB_W_CTRL -- FB_PACKMODE__565_RGB
ISP_BACKGND_T // address of ISP/TSP parameters, without using TA
-- TAG_ADDRESS(0x00200000/4)
-- TAG_OFFSET(0)
-- SKIP(1)
ISP_BACKGND_D -- Z coordinate ; 0x03727c5ac (1.f/100000)
FB_W_LINESTRIDE -- 640 / 8;
FB_W_SOF1 -- framebuffer address
STARTRENDER
==== store queue ====
store queue write: 0xe000_0000 - 0xe3ff_fffc
write vertex list to: 0x10000000
TA:
"List of Input Parameters"
page 201 (TA) Parameter Format
control:
- End of List 0x0000_0000
- User Tile Clip 0x2000_0000
- Object List Set 0x4000_0000
page 196 Parameter Control Word
page 222 ISP/TSP Instruction Word
page 226 TSP Instruction Word
page 233 Texture Control Word
Volume 0
Col_Type
0 Packed (32-bit ARGB)
1 Floating (32-bit float * 4)
Textured 0
Offset 0
Gouraud 0
16bit_UV 0
Global: Polygon Type 0
Vertex: Polygon Type 0
- x y are 32-bit floating point in screen space
- z specified as reciprocal 1/z