Roster palettes - Printable Version +- FF6 Hacking (https://www.ff6hacking.com/forums) +-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html) +--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html) +--- Thread: Roster palettes (/thread-2430.html) |
Roster palettes - HatZen08 - 12-03-2013 Greetings. I wanted to change the palettes for the roster characters. I found two interesting addresses, related to OAM: D8/E945 Sprite animation D8/EA5C Sprite The data format for Terra (only the roster character) is: Code: Terra sprite (idle) All other characters follow the same pattern. D8/EA5C is Terra, D8/EA6E is locke, etc... The format of the tiles is four bytes: X position, Y position, tile index and the miscellaneous byte. The miscellaneous byte has many flags, including the palette for the tiles. The formated miscellaneous bytes with the palettes is: Code: misc. byte palette default character As example, Terra has four tiles with the miscellaneous byte #$39. Hers palette is 04. If you change the value of the miscellaneous byte, it change hers palette as well. Please, note that the roster palette ID is different from the NPC palette ID. Does anyone know a better way to change the palettes for the roster? I believe the data is OAM related and I may not be able to change the palette only by code. I can surely change the palette for all tiles for all characters, but I prefer something more optimized. RE: Roster palettes - madsiur - 12-03-2013 The OAM data applies to shop, loading screen and saving screen only. For those case, I think you are stuck with the OAM data you've found. I'm not quite sure to understand your question... You would like to have a table of 14 palettes numbers and use this instead of the OAM data (as for palette)? I'm not sure exactly where in bank C3 the palette number is extracted from the misc byte... All I know is that there's a pointer table for OAM data (see here) and then the OAM pointer is stored in $32C9. You can see an example of this in the C3/1903 routine. From there, I don't know what happens as I have never traced the code... Again, I'm not sure what you mean and I feel a bit like a guy who's trying to show a sailor how to sail... Edit: Good job on your patches! Amazing work. RE: Roster palettes - HatZen08 - 12-04-2013 I was pondering about a unified palette for specific graphics ID. As example, the C2/CE2B table has the palette for all characters, relative only to battle graphics: Code: Battle characters palette: As example, let's suppose I want to change Terra's sprite. With only one byte change (CE2B), I can change the palette for hers battle graphics. However, it won't change hers NPC palettes. For Terra's NPCs, their palettes are scattered in the events script. Generally, it is a combination of opcodes #$37 (set graphic) and #$43 (set palette). To synchronize Terra's battle palette with their NPC versions, it is necessary to track down the events script with their respective opcodes and change them. It can be really annoying. The main concept is to change the code of the #$43 opcode (events script – change palette). If the NPC graphic is Terra, it will ignore hers defined palette in the opcode and use CE2B instead. The same logic applies for all other characters with battle graphics. I did some experiments and I believe I have a good chance to implement the concept. I can also try to change the loading of NPC for the maps with the same logic. However, the roster code is being difficult. The palette, apparently, is hard coded with the OAM structure. If possible, I wish to synchronize the roster palettes with the battle palettes. If it isn't possible, I will forget about it and try to synchronize the palettes for battle characters and their NPC versions. In the worst scenario, the roster palettes must be managed manually by hex-editing. Thanks for the hints. I am busy now but I will check it later. RE: Roster palettes - madsiur - 12-04-2013 That would be really cool if you achieve synchronization. RE: Roster palettes - B-Run - 12-11-2013 Have you tried using a debugger to find out where the code is read from? It's most likely a block load instead of pulling from the specific byte. I know from my dabblings in OAM that there are several layers of pointers to even get to the OAM data so it's not going to be even a little straightforward. Also each screen that uses OAM has its own loading code so it will need to be changed in several places, though I imagine you ought to be able to have a single transforming subroutine. Here's the pointer list to the pointer list for OAM, so maybe searching for that address will help you find something. Code: D8/E917: Pointers to pointers! used to make calling simple since different characters have a different number of OAM instances And here are the actual pointers that point to the OAM: Code: OAM pointers for various things: (there are the various instances called, shop menues, save, etc...)(byte 3?) Happy Hacking! RE: Roster palettes - HatZen08 - 12-20-2013 I finished a beta version for this patch here: (click for link). The palettes are now synchronized with the C2/CE2B table of palettes. Everything looks fine for a new game, by now. However, specific sprites don't get along with different palettes instead of their own. Without sprite editing, the effective number of palettes available for these specific sprites will be too narrow. Unfortunately, for the party leader palettes, they won't be updated with a different saved game. After the event scripts set the palettes, it is never updated again except for another event script. The game loading won't update the already set palettes with different values. However, if the game was saved after a new game with the alterations, everything looks fine. I will check if I can update the party leader palettes, somehow, in the game save loading. RE: Roster palettes - SSJ Rick - 12-20-2013 very nice work RE: Roster palettes - Catone - 01-04-2016 I've read over this a few times but just now downloaded it. I liked the concept (hell who wouldn't) but I just started putting pieces together. If you can synchronize OAM palettes with battle palettes... what if there were 160 battle palettes? Could it still load and handle them? (Course some editing would be required, as I see it, it is only set up to handle the normal ranges.) Worst case, even if the game can't handle loading up this way on the map, hopefully I can get it to match OAM data palettes from the battle palette list. Best case, if adjusted to handle an extended list of battle palettes, this MIGHT allow for a palette per character everywhere, not just battle, for the time being I'm just shooting for OAM palettes to match up though. |