@thellierMAME doesn't use Sprites and fonts like that - it builds up the display from dynamically created textures.
First it creates all the primitives in system memory (this would be very slow in graphics memory).
Then it renders the primitives in system memory (again, very slow in graphics memory).
Then I do a p96WritePixelArray to video memory, and then CompositeTags() it over to the display (unless it's an overlay surface).
I only get the data once the primitives have been created (in system memory) though. MAME does have some support for OpenGL textures, and these are all held in video memory, but I'm not aware of it being intelligent enough to cope when video memory runs out (I presume OpenGL does this transparently) - this would be very necessary on a system like the Sam440ep with only 32MB VRAM.
It is R5G5B5 - the bytes are correct. I tested by setting all red, all green and all blue - and all was correct. It really is just that white is pink and black is green!
The R5G5B5 overlay is first, the YUV422CGX overlay is second (using my own mapping code):
Thanks for the help though! It's all useful information!