[FE7] World Map! + TSA Tips

Prompts from some people made me realize I should share my notes/documentation on the FE7 World Map. If you knew everything below already, then you’re a star. :D: Of course, to some people, it’s simply just another image. But I’ve got time on my hands, sooo…

Just to show it’s possible, I inserted FE4’s world map. However, I reduced all the colours to 1 palette just to save myself some work (but you could very well use all 4 palettes).

The world map is divided into 12 segments, one after another. The first 8 are 32 x 32 tiles but the last 4 are 32 x 22 (width x height) tiles. Each segment has their own TSA. Annoyingly/funnily the TSA are all the same size though.

There are 4 palettes, located at 574990. Image starts at 574A10 and TSA starts formally at 5CAA10.
Below are the addresses for the image segments and their respective TSA’s.

Image segment - TSA
574A10 - 5CAA12
57CA10 - 5CB216
584A10 - 5CBA1A
58CA10 - 5CC21E
594A10 - 5CCA22
59CA10 - 5CD226
5A4A10 - 5CDA2A
5ACA10 - 5CE22E
5B4A10 - 5CEA32
5BA210 - 5CF236
5BFA10 - 5CFA3A
5C5210 - 5D023E

(The TSA actually starts at 2 bytes less- I ignored the first 2 bytes (1F 1F). Those tell you the size of the TSA.)

And as with a lot of GBA data, the TSA is backwards. So the TSA starts with the 32nd row of tiles, then 31st… then all the way to the 1st.
[ Of course, I heard that uncompressed TSA is backwards, but compressed TSA is not! ]

And a bonus: here’s some TSA tips. (These tips apply for all TSA, not just this world map.)

Here I loaded the 9th segment’s TSA (5CEA32) in Windhex. The underlined (green) lines represent the last (32nd) row. That 1F 1F represents the size of the TSA (I believe it’s the max size).

http://img.photobucket.com/albums/v220/NomadicTrooperGirl/tsa-1.png

A tile is represented by 2 bytes. I highlighted one of them in orange:

E0 13

Read it reversed- 13E0
This calls up the tile 3E0 and uses palette number 1.

When working with TSA, I like to make a grid so I can identify every tile.
Here’s the 1st image segment. I wrote down the "ID"s (or index) on top of some of the tiles just to illustrate how the grid works. The tiles run from 00 to 3FF. (Sorry if it’s hard to read!)

http://img.photobucket.com/albums/v220/NomadicTrooperGirl/tsa-2B.png

v don’t have to read this v
Now, I’ve been out of the hacking-loop for quite a long time really. My latest activity involves the FE12 translation project. It’s a DS game, but a lot of things are still very much the same, including TSA. I don’t know to what extent people know about things, and what programs are available now. Do you think tile editors are old-fashioned? I’ve messed with TSA before, but only recently did I fully understand it, including how tiles are flipped. I even read about looking at the TSA binary-wise, which makes a lot of sense for the tile flipping. However, the notes I read were old and didn’t seem to match with what I knew. Also, I don’t know if people understand it already, but I’m just going to summarize what I know now:
^ don’t have to read this ^

Summary
Each tile is represented by 2 bytes, stored in reverse order. Now, I’m going to refer to the bytes in the “correct order”: The first digit tells you the palette (can range from 0 to F) and the last 3 digits tells you the tile id, with any flipping effects included (can range from 0 to FFF).
Regarding flipping effects, a certain value is added to the tile id (or you could say the 2nd digit is altered). Note this is in hexadecimal. I’m not going to bother talking about it binary-wise here (unless clarification is wanted).

+ 400   horizontal flip
+ 800   vertical flip
+ C00   both flips, aka 180 rotation

So you can tell if flips are involved if the tile id exceeds 3FF. Otherwise, if it’s within 0-3FF then it’s not flipped.

An example: 3A10
Palette 3 is used. The tile id is A10, which exceeds 3FF, so it’s been flipped. Now, if you try to subtract 400 you get 610 which is still over 3FF, so you know it’s not a horizontal flip. But if you subtract 800 you get 210, which is within 0-3FF. So you know it’s the 210th tile being called up, with a vertical flip.

Credit goes to Serenes Forest’s NomadicTrooperGirl.

4 Likes

As expected from Vincent’s sister. She’s very much the graphics hacker Math Girl.

Go Jenni!

As I said in the Undertroll chat, this tutorial is great except that it could be worded a lot better to make things simpler.

This is my plain-language translation of this tutorial:

The world map is divided into 12 segments, each 256 x 256 px except the last 4 which are 256 x 176

Therefore, the entire image is 1024 x 688 px

The following addresses are the addresses of each segment, from left to right, and top to bottom:

574A10
57CA10
584A10
58CA10
594A10
59CA10
5A4A10
5ACA10
5B4A10
5BA210
5BFA10
5C5210

The default world map uses 60 colours by using 4 palettes; however, things are much simpler for you if you use 15 colours (+1 transparent colour) so don’t worry about the “TSA”. If you are indeed using the same palette for this, then I would recommend simply copying and pasting the same palette for each one so that there are four of the same palette. If you don’t know how the change the palette of the image, then I would recommend reading one of these fantastic tutorials to learn. [TUTORIAL CURRENTLY UNAVAILABLE ON FEU2 @CT075 please post it at some point]

To ensure that your palette is the same for each image segment, I would personally recommend copying just the one BIG image and making 12 copies out of it, and then cropping each one individually in Usenti (ensures that the palette is always in the same order)

The pointers (what’s a pointer?) for each image are at 0xCE7818 and there are 12. After that there are another 12 pointers for the “TSA” (once again, unimportant). Once you’ve inserted your pieces of the world map you can head over to that address and write them in. Once again, they are ordered from left to right, top to bottom.

Edit: I posted this topic on what might potentially happen to the palette, and @Jubby very graciously posted an easy fix for it. Thanks Jubby!

On second thought, I was wondering if anyone knew what the offsets of the other world maps (the full version and the Nabata desert version) were, and if it’s at all possible to expand the table that they’re all in. I just now had a thought that one could probably call CGs on the world map which would be kind of nice.

World Map Full View
0x005D0AC0
Uses 4 palettes starting at 5D0A40
240X176 Image
image 1095 in GBAGE (Width: 30 Height: 32)

I don’t have any notes on the Nabata one unfortunately.