Inserting Conversation Backgrounds

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!

11 Likes

oh hey would you look at that, my favourite cutie makes a good tutorial off of something i requested owo

edit: the buildfile method do works

1 Like

Uhh, I am very sure Circles did post a CG Editor Nightmare Module some time ago, and FEditor has a CG Maker that creates the three files for it already.

Not sure if that bit of a hint helps for the buildfiles, but… just a comment.

*Decides to test Kirb's method in secret*

FEditor

:angry:

2 Likes

And the CG Maker, I’m pretty sure, only works with CGs. If I’m wrong, though, I’ll add that method to the tut.

The “CG Maker” does indeed work with backgrounds. It’s all the same image format. Sometimes it doesn’t quite always get the tile conversion right, though. Still, that’s what I used with EN.

:angry: Baaaaanned

p.s. didn’t realize inserting TSA images was so complex. I might look at febuilder/feditor source to see how it’s formatted to write an appropriate tool.

3 Likes

Can I use that example background, Kirb?

Yes, please do this.

1 Like

yeah sure go ahead

Just a PSA: if you’re expanding/repointing the background table, don’t use background ID 0x37, this loads a randomized one (used by the support viewer)

(or do, the hardcoded check for that ID is at 0xED88 if you really want to mess with it and/or make the support viewer no longer be random)

EDIT: I made a NMM for the background table in case someone needs it https://www.dropbox.com/s/08c97kqx3eq2lps/BackgroundEditor.nmm?dl=0

6 Likes