Inserting Conversation Backgrounds
Requested in the FEUniversity Tutorial Request Thread
Offsets are FE8 unless Specified otherwise.
Note: As the technical part of backgrounds is quite hard to understand if you are unexperienced, and won’t help you that much in the long run, I will simply explain what I think is the easiest way to insert conversation backgrounds with both FEBuilder and Buildfiles.
1: Format
The table at $95DD1C Contains 3 Pointer per entry: A pointer to the 4bpp base image, A pointer to its palette, and a pointer to its TSA. to put it simply, the TSA builds the image you actually want to see out of a compressed 4bpp base image. think of it like legos.
2: Converting an image
Conversation backgrounds are the size of the screen, so 240*160. HOWEVER, because of how the hardware work, there are two extra not showed tiles on the right, making our final image size 256x160.
For example, I will convert this background(taken from the FE9 Game Files, no ideas if it’s even used but it’s there) to insertable format.
First off, I will resize it to 240x160, and Scale it to that size.
Then, I will Resize it to 256x160, WITHOUT scaling it, this time.
This is what I end up with. Now, this step is optional, but if your image looks weird after inserting it, because it had too many colors, I’d advice to try to Requantize it to 16 Colors(including the right background color! else part of your bg will be transparent.). I like to use usenti for the convertion, it is a good image editor and even has gba exporting options.
3: Inserting
For FEBuilder Users:
Go to Image Editors->Backgrounds, Go to the background you want to replace, Click Insert image, choose your converted image, Click automatic conversion and import if another screen pops up, and voila! if your image looks weird inserted, try to requantize it like I said last step.
For Buildfiles Users:
It is a hell of a lot trickier to do it with Buildfiles, so I like to take the easy way out: Insert it with FEBuilder in a clean ROM, then extract the background from that rom.
I like to use HXD to extract the background for the clean rom. Create 3 empty bin files, and then rip the data accordingly to the FEBuilder offsets given.
For example, in the picture above, The image starts at $1000000(Remove $8000000 to get the rom offset from pointers), and we can deduce that it ends at $1003987, because the TSA starts right after. so we select all that data and copy it to the first file. Then, for the tsa, just select the offset from where the TSA starts, and go to the end of the rom, since this is a clean rom, and there will be nothing else after. copy that data to the second file.
Then there’s a problem. It seems like the Palette hasn’t been repointed! Thankfully, Palettes are always the same size for convo backgrounds, $100 bytes. so copy that data, and put it in the third file.
Now, we want to include these in our buildfiles. to do so, we first need to repoint an entry from the original entry. I have made a macro for that:
#define ConvoBackgroundTable $95DD1C
#define SetConvoBackground(Index, ImagePointer, TSAPointer, PalettePointer) "PUSH; ORG ConvoBackgroundTable + (Index * 0xC); POIN ImagePointer TSAPointer PalettePointer; POP"
After that’s done, incbin each of the ripped file at the labels you pointed at for the SetConvoBackground.
For example, with my background I did this:
SetConvoBackground(0x18, FE9BGImage, FE9GBTsa, FE9BGPalette)
FE9BGImage:
#incbin "FE9BGImage.bin"
FE9GBTsa:
#incbin "FE9GBTsa.bin"
FE9BGPalette:
#incbin "FE9BGPalette.bin"
And after assembling, you should have your background in! for a sanity check, open your rom in FEBuilder: if it shows correctly, you did everything right!
Feel free to correct me or ask questions, as this is quite a complex set of actions.
Hope this helped, and see ya!