Additional help is required I'm afraid.
While i can manage the basic hacking of the ROM (being a total noob), i have problems finding a specific piece of code.
And it is driving me up the wall for days.
The problem is this image:

All 7 items in the menu have a different start coordinate or left margin.
And to make matters worse, the text itself has a different margin.
I need that removed to add more text.
Ok for a bit of backstory on text formatting, for more see the links above.
The game uses 2 bytes for each character (Shift-JIS) see:
http://www.rikai.com/library/kanjitables/kanji_codes.sjis.shtml.
The translation also has to use the 2 byte variant for Latin text.
However it also has control characters to define the text formatting.
If the first byte is < 80 hex then the 2 single bytes become control characters (all lower ascii < 128 dec)
WP+xxx-yyy = Window Position, positive/negative xxx offset, positive/negative yyy offset from the center.
BL1616 = Character image size. The character image is 13x13 from a text image library, the rest margins that are defined by this tag. There is NO font, only images!
g0 = Margin-left for the following character.
Original Text : アイテム
Translated Text : Items
Original HEX : 83418343836583800000
Translated Hex : 826882948285828D8293
Max SJIS space : 5 characters!
Location in file: 7d3e0
Pointer in file: 7D478
Pointer data: E0EB0880
Offset: 11800
What i know:
- Location of the text.
- Pointer of the text.
- Location data of the box.
- Size data of the box.
- Borders of the box.
- Changing the text to include the above control characters works!
This means i can set the start position of the text at any place of the screen and i can set the margins of the text, no problem.
WP+xxx+yyyBL1216 = 16 bytes long and then the actual text has to get placed as well.
But this EATS valuable space i don't have.
So it is overriding previous set parameters.
- Moving the box position moves the text as well.
- Each menu item has it own dedicated line, if i add a newline control character "\\" it overflows on top of the next line.
- Changing the pointer data only changes the text, formatting remains unchanged.
So...
Somewhere in the main executable there is probably something like this.
<box 1 id>
<menu item 1><Box offset from the left><text margin like BL1616><pointer to text>
<menu item 2><Box offset from the left><text margin like BL1616><pointer to text>
etc
Due to my lack of knowledge i can't seem to find what is happening before the debugger hits the breakpoint of the text.
I can see it parsing WP, XP, BK, BL tags and finish, but i can't find what is causing the left margin and set the BLxxyy margin tag.
So what i would like is if someone could point to me what code is responsible and if/where in the main executable a value has to get changed to make it happen.
I'm sure the location/margin data has to be stored and referenced somewhere.
If anyone is willing to help that would be great!
^Ripper