Depends on what exactly you're trying to display.
Twiddling is a method of scrambling the pixel data in a texture so that it renders faster when you enable texture filtering. It's also known as swizzling. The colour data is the same, but the order of the data is all weird.
If your emulator outputs in 16-bit colour (or you can modify it to output in 16-bit colour), rendering to a texture is definitely your best bet. You don't need to twiddle 16-bit textures. The hardware will draw a non-twiddled texture slower if you're using filtering, but for just one polygon you're going to spend more time copying the texture over than it takes the hardware to render it, and the hardware will render it while you're off working on the next frame.
There are two good ways to get the texture over to vram - DMA and store queues.
If your emulator is rendering the display strictly from left to right, top to bottom, and you can break the rendering loop up into 16 pixel blocks, store queues will be much, much faster than DMA. A store queue is basically a small buffer inside the CPU which you write the data out to, and then tell it to write to VRAM. It'll then dump the data out to VRAM while you're busy filling up the next store queue with the next set of pixels.
If the rendering code is rendering things all over the place, DMA will be your best bet. Basically, if you've got a large block of data already in main memory that you want to transfer, use DMA. If you're generating a block of data in the correct order, store queues are faster.
If it outputs in 8-bit colour, you'll need to convert it to 16-bit colour, or twidde it in real time, because 8-bit textures have to be twiddled. Store queues are probably best for this.
The ultimate way is to directly use the PVR hardware for all rendering. Depending on the hardware you're emulating, this can be trivial (like really early arcade games, Sega Master System), difficult (like a MegaDrive), or nearly impossible (like anything that doesn't use tile-based displays).
It might help if we knew what kind of hardware this is. Just a clue, like what kind of graphics system it has, or basically how the renderer works.
Bookmarks