SanguinettiMods Posted February 2, 2012 Share Posted February 2, 2012 Is there any documentation on how they work? I'd appreciate it greatly if anyone can help me on this. (And spinout, if you answer this, no offense, but please explain it in the simplest terms that you can. ) Link to comment Share on other sites More sharing options...
0 xdaniel Posted February 2, 2012 Share Posted February 2, 2012 What kinds of palettes do you mean? That is, those of CI-type textures? The coloration of ex. the A/B/C buttons on the interface? There's different things controlled by (or that appear to be controlled by) palettes... Link to comment Share on other sites More sharing options...
0 SanguinettiMods Posted February 2, 2012 Author Share Posted February 2, 2012 What kinds of palettes do you mean? That is, those of CI-type textures? The coloration of ex. the A/B/C buttons on the interface? There's different things controlled by (or that appear to be controlled by) palettes... Yes, those of CI-type textures, like Link's face textures for example. I found them in the file, but I don't know how to edit them, because I'm not sure how they work. Link to comment Share on other sites More sharing options...
0 xdaniel Posted February 2, 2012 Share Posted February 2, 2012 They're 16-bit RGBA5551 values, either 64 or 256 entries depending on the color depth, so it's 5 bits for red, 5 for green, 5 for blue and 1 (on or off) for alpha. Converting 8-bit RGBA values into 5551 or the other way round needs some bitwise operations, although maybe there's a tool for this, or some image editing software is capable of doing so, not sure. SO has some C# code to convert into RGBA5551, while libbadRDP has C code to convert from 5551 to 8-bit. To 5551: http://code.google.com/p/sharpocarina/source/browse/trunk/MapDev/NTexture.cs#131 From 5551: http://code.google.com/p/ozmav/source/browse/trunk/badrdp/gdp.c#265 Link to comment Share on other sites More sharing options...
0 SanguinettiMods Posted February 2, 2012 Author Share Posted February 2, 2012 Thanks for the help, xdan. I ended up using SO to convert my textures, rather than ZLE2, like I was going to. I want to know, though, if converting all of the textures in the same piece of geometry will keep the textures from being assigned different palettes? This is a problem for animating facial textures. Link to comment Share on other sites More sharing options...
0 xdaniel Posted February 2, 2012 Share Posted February 2, 2012 SO, at least, will always create a new palette for each new texture. With some more logic it should be possible to have it automatically reassign already created palettes to other textures, tho... ...like: Texture will be converted to CI -> create the palette -> compare palette colors with existing, converted palettes -> if an existing palette contains at least all the colors of the current palette, use the existing one. Good idea to implement, I suppose, I'll look into it when I get the chance. Link to comment Share on other sites More sharing options...
0 SanguinettiMods Posted February 2, 2012 Author Share Posted February 2, 2012 Is there a way to manually re-assign palettes in the meantime? Link to comment Share on other sites More sharing options...
0 xdaniel Posted February 2, 2012 Share Posted February 2, 2012 You can manually edit the Display List; if I recall, palettes are assigned via a SetTImg command before it's loaded by LoadTLUT. Change the address SetTImg points to to that of your other palette. Link to comment Share on other sites More sharing options...
0 SanguinettiMods Posted February 2, 2012 Author Share Posted February 2, 2012 You can manually edit the Display List; if I recall, palettes are assigned via a SetTImg command before it's loaded by LoadTLUT. Change the address SetTImg points to to that of your other palette. I'm not sure if that would work, see, I'm talking about animating textures, the only pointers to them are in code.zdata... Link to comment Share on other sites More sharing options...
0 xdaniel Posted February 2, 2012 Share Posted February 2, 2012 If the textures are CI-type as you say, there should be a pointer to their palette(s?) as well. You could try to search for the palette pointer inside the code file, it's probably near the texture pointers. Link to comment Share on other sites More sharing options...
0 SanguinettiMods Posted February 2, 2012 Author Share Posted February 2, 2012 The only "pointers" I can find to 0x5500 (Child Link's Face Palette) or 0x5C00 (Adult Link's Face Palette) are the FD commands within their files. I don't think that each of the eye or mouth textures are set up to be pointed to their own palette, just pointed to one in general. I guess I'll have to wait until you implement that addon into SharpOcaina. Link to comment Share on other sites More sharing options...
0 spinout Posted February 5, 2012 Share Posted February 5, 2012 The only "pointers" I can find to 0x5500 (Child Link's Face Palette) or 0x5C00 (Adult Link's Face Palette) are the FD commands within their files. I don't think that each of the eye or mouth textures are set up to be pointed to their own palette, just pointed to one in general.Those 0xFD commands are the pointers. The palette is loaded, then the image is changed to the pointers you mentioned in code.zdata. The colors in each of link's face textures are the same, therefore, only one palette is needed. It is the arrangement of the colors that is changed with the pointers in code.zdata. Link to comment Share on other sites More sharing options...
Question
SanguinettiModsIs there any documentation on how they work?
I'd appreciate it greatly if anyone can help me on this.
(And spinout, if you answer this, no offense, but please explain it in the simplest terms that you can. )
Link to comment
Share on other sites
11 answers to this question
Recommended Posts