Skip to content
olivieryuyu edited this page Jun 10, 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 called 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 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) -1.

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, flag = 00) as you can find in the the vertex state but also the pointer 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.

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 a bit less clear for the time being. It is done only when the last byte is different than zero. Currently what I understand is that 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 0xF8. We would have then for instance:

F5400800 F8000000

However with the ORed, you may have F5000000 F8100000. It would mean tile 1.

Note that usually this last byte in this second line is not nil at the very beginning of the list, the rest being nil. It would mean that the same tile is used for the entire list.

Comments & Conclusion:

The code does also some weird comparison between the information contained in the vertex to skip their drawing. The first half of the 32 bits word of the object stated is used for this purpose. It would be most likely to avoid drawing triangles which are actually not visible.

The 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. Would you play on real N64 Last Legion UX, you can suffer some drop of performances when explosions occurs.