Looked at this, but didn't find out much. I think I will go with face lookup like Zero suggested. It means for many dialogues in the game, we will not have a name in the dump.
Problem: Identification of character for FE00 (00FE?) sub-code in 55 and 5C opcodes.
We need an example. SSS HQ (night) is the first time in the game you can walk around and speak with various characters. That's file c011b. Function 9 at 0x1bf9 is for speaking with Sergei.
Have a look at
the dump of c011b. It was gotten by decompiling, but you only see the text-related opcodes there.
I also looked at NPC data in the header. It seems this function 9 is referenced in there. But I don't know how to tell what character is what.
When you approach a character, 0xBFFF470 gets set with the character ID.
Sergei's ID for c011b (does it change based on the file?) is 0011 (looks like 1100 in binaries because of little-endian). I'm just guessing this because the 55/5C opcodes that explicitly have this code all belong to Sergei.
Then, when you talk to that character and a FE00 dialogue opcode comes up, that character ID is used to generate the name in the dialog box.
The formula is character ID minus 7. Which is weird, I can't find that in the game code. But it seems to work. 0x11 - 7 = 10, and string 10 in the string table at the bottom is Sergei.
Sometimes, the character ID is specified in the opcode. If that's the case, the one specified in the opcode gets used.
0xBFFF470 is getting loaded from 0x8C5CA6C, for me anyway.
So 0xBFFF470 is like a default character ID that changes depending on the character you are near.
You can see it's looking specifically for this value of 0xFE at 0894EB0C. I found this by setting my breakpoint on a 0xFE in Sergei's dialogue at 0x08C90E07 (c011b offset 0x1c07). If you step through from there you will find the character code being read from 0x8C5CA6C and store at 0xBFFF470.
I spent some time on this, but I don't think I'll be able to solve it.
It doesn't apply to "story sequences" because I think the developers don't consider you to be especially near any characters during story sequences.
-------------------
Opcode 0xF is "Battle." The first relevant one happens in m0002 for a story battle sequence. That's important because the battle data has a pointer in it. The pointer is pointing at the battle map name data in the string table at the bottom.
You can see a 0xF opcode at m0002 0x1301. Right after that you have 0x3B0, which is a pointer to battle data. Battle data records are 0x20 long. At offset 0xC in the battle data record, you have a pointer to the battle map name in the string table.