but the GBA was the last final system where it was super common to have all your text messages encoded in BS-8, the text encoding you just pulled out of your ass
okay I found a function at 08002498 which is definitely "get string from table by index". It's called twice for each dialogue, since the title of the person talking is stored separately from their line.
BINGO. The function at FUN_0800dce0 is called with the ID of the portrait to display. Change the value in r0 when it's called, and you change what portrait loads!
@theryusui yup. SQ4