> The PSX devkits came with a library called LIBGPU, which handled the rendering. Since the PSX GPU didn't have a z-buffer, all primitives you wanted to draw (triangles, quads and sprites) needed to be submitted into an “ordering table” or OT for short. This table had (typically) 8192 slots allowing for 8192 different z-levels. The GPU would then rasterize the list back to front. The result would not be perfect (in some situations neither of two polygons will have all pixels in front of the other one), but close enough.<p>This is actually implemented in a slightly funky way on the PS1. The DMA unit responsible for sending commands to the GPU allows for a display list to be built in memory as a linked list of variable-length packets, each of which can hold zero or more commands. What Sony's libraries do is essentially generating the ordering table as an array of 8192 empty packets linked to each other, then allowing actual command packets to be allocated elsewhere (typically using a simple bump allocator) and "spliced" into the link from one empty packet to the next one. The PS1's vertex transformation coprocessor, the GTE, also keeps track of the Z coordinates of the last 4 vertices processed and has an instruction to quickly average them out so that the resulting value can be used as an index into the ordering table.<p>I wrote a few SDK-less bare metal C examples showing how to build an ordering table [1] and leverage it for 3D polygon sorting [2], should anybody want to check those out.<p>[1] <a href="https://github.com/spicyjpeg/ps1-bare-metal/blob/main/src/07_orderingTable/main.c">https://github.com/spicyjpeg/ps1-bare-metal/blob/main/src/07...</a><p>[2] <a href="https://github.com/spicyjpeg/ps1-bare-metal/blob/main/src/08_spinningCube/main.c">https://github.com/spicyjpeg/ps1-bare-metal/blob/main/src/08...</a>