More GPU changes
.
This topic is probably the most hated by all NDS emu coders, and to be honest, it also happens to be my personal nightmare as well. Either way, it needs to be understood for the emulator to work properly, so i've been working around this lately, and made some progress.
Basically, the DS submits vertexes, sending in fixed points, arranged in groups of 16bit vertexes and 10bit ones. Meaning that, if numbers have been submitted, they're either with an integer range equal to 0, a fractional part of 16bit vertexes, or the whole 10bit vertexes.
This means that in order to define objects or sprites that do not fit in the 16 cubic dimension (meaning that either depth, width and/or lenght don't fit in this x16 range), a transformation is needed in the GPU. For the transformation to be done, it is needed that before sending the vertex, a change has to be sent to the function "DS transform U", which increases the positions in the number it needs to (For instance, it'll double depth). It's no news that this isn't the best way to do this, but i'm working on finding another way.
Another complication this transforms have is the fact that those changes need to be sent to be vertex submit list, meaning it actually requires a buckload of emulation power to do this, though fortunately, display lists games don't seem to be affected much after these changes.
So, here's a pick that shows the implementation of these changes (I still need to fix the texture positioning, and i also had to hack the register to emulate the pixels next to the borders)

I'm going to try and fix the positioning asap. Today's thread seems to be complicated, so i'll leave it for now. Until then
Basically, the DS submits vertexes, sending in fixed points, arranged in groups of 16bit vertexes and 10bit ones. Meaning that, if numbers have been submitted, they're either with an integer range equal to 0, a fractional part of 16bit vertexes, or the whole 10bit vertexes.
This means that in order to define objects or sprites that do not fit in the 16 cubic dimension (meaning that either depth, width and/or lenght don't fit in this x16 range), a transformation is needed in the GPU. For the transformation to be done, it is needed that before sending the vertex, a change has to be sent to the function "DS transform U", which increases the positions in the number it needs to (For instance, it'll double depth). It's no news that this isn't the best way to do this, but i'm working on finding another way.
Another complication this transforms have is the fact that those changes need to be sent to be vertex submit list, meaning it actually requires a buckload of emulation power to do this, though fortunately, display lists games don't seem to be affected much after these changes.
So, here's a pick that shows the implementation of these changes (I still need to fix the texture positioning, and i also had to hack the register to emulate the pixels next to the borders)

I'm going to try and fix the positioning asap. Today's thread seems to be complicated, so i'll leave it for now. Until then


<< Home