Skip to content

T3DUX ucode

olivieryuyu edited this page Jun 16, 2017 · 18 revisions

Introduction:

Last Legion UX, Shin Nihon Pro Wrestling Toukon Road - Brave Spirits and Shin Nihon Pro Wrestling Toukon Road 2 - The Next Generation uses a undocumented Nintendo ucode called T3DUX.

Shin Nihon Pro Wrestling Toukon Road - Brave Spirits uses the version 0.83 and the two other games 0.85.

It is an evolution of the turbo3d microcode which is used only by one game in its original format, Dark Rift.

The major change in T3DUX compared to turbo3d is what we can call a colors & texture coordinates state.

Description of the changes:

Here an example of a turbo display list in T3DUX:

There is two more 32 bits words than the standard turbo3d.

The global state works in the same way than turbo3d. The treatment of the RDP command list is nearly the same, however the last F5 command (Set Tile) processed in the list is send to the RDP but also saved in a place in memory, the second 32 bits word being ANDed by 0xFF0FFFFF. It will be used back when the textures are processed with the generation of the triangles.

The object state is a slightly different:

The simple matrix is downloaded from the object state memory address + 0x0018 (if the flag is 0x00).

The colors and textures coordinates state are downloaded from the memory with this 5th 32 bits words of the display list ( in our example 0x802FB148). Such a list has a number of bytes as follow: ("number as per the object state" shift left by 2).

The treatment of the RDP command list nearly the same, however the last F5 command processed in the list is send to the RDP but also saved in a place in memory, the second word being ANDed by 0xFF0FFFFF. It will be used back when the textures are processed with the generation of the triangles (Note: it will be the very last F5 amongst the global state and the object state that will be used, so usually the one from the object state except if there is no F5 in its object state RDP command list or if there is no RDP command list address).

The vertex in this ucode is very very simple: it does have only x, y and z information (2 32 bit words only!).

The colors and textures coordinates are processed when running the "tri, colors and textures coordinates pointer list."

Here what you do have in this list as an example (the list contains many of those):

The first line ( 0x740) from this list are, as for turbo3d, are the pointers to 3 vertex of the triangles (so here v0 = 00, v1 = 01, v2 = 02, flat shading flag = 00) as you can find in the vertex state but also the pointers to the 3 colors of those triangles in the textures coordinates and colors state. If you have vertex 00, you pick up the very first color in textures coordinates and colors state. When the flag for flating shading is not 2 but 0, flat shading is used and the 3 vertex composing the triangle uses the same color, located in the colors and texture coordinates state thanks to the last byte of this line.

The second line ( 0x744) provides 3 pointers to the textures coordinates for each vertex. You need to shift left them by 2 to get the right place in memory of the textures coordinates and colors state. So for instance you have 4a, you shift left by 2, you get 296 in decimal (0x128 in hex), this is the number of bytes you need to calculate to reach the right place in memory. The last byte is uses only when it is different than zero. This byte is shifted left by 20 (0x14) and then the results is ORed to the second 32 bits word of F5 command that we saved earlier. So for instance if it would be 0x80 (being a negative byte), then it would be 0x08. We would have then for instance:

F5400800 08000000

At this place the 8 would mean tile 0 and palette 0.

However you may have 0x81, you may have F5000000 08100000. It would mean tile 0 and palette 1.

Comments & Conclusion:

The modification of the turbo3d code is not very well written and it is doubtful that it broughts real advantages compared to the F3DEX. It is not surprising that this ucode was not provided and/or used by other company than Yuke's Media Creation. For instance would you play on real N64 Last Legion UX, you can suffer some drop of performances when explosions occurs.

You can’t perform that action at this time.