[FE8U] Editing Menu & Dialogue Font Glyphs - DRAFT

(Apologies this tutorial is rushed. Hopefully I will be able to streamline, simplify this, and provide more glyphs in the future, but for now, please accept this draft and hopefully it proves some use. Or here’s the event and supporting files, they should be easy enough to understand on their own.)

A screenshot of inserted glyphs for demonstration.
(TBD Menu font example)

This tutorial covers formatting and inserting custom dialogue and menu glyphs (both are similarly formatted) into an FE8U rom through the buildfile method, and how to use them with the text processor. This also utilizes the simpler ASCII / pointer table and no shift-JIS functionality.

Start with a 16x16px, 4 color image (or export one from FEBuilder).

Hop on over to usenti and export that bad boy as a bin (Image->Export, save as .bin (?), then under GFX: bitmap(GBA) from the dropdown, 2 bpp, deselect Pal checkbox, under File: deselect ‘h file’, click OK)

Your resulting .img.bin file should be 0x40 (64) bytes long. (Why did it add .img? Don’t know.)

Now we have the bitmap data of the glyph, we can make the full glyph struct (which includes character width data), write that glyph into our working file and update the pointer table to include our new glyph. Create a new .event file with the following and (oh heck how do I explain this… use the given glyph_tQuarterNote and _mQuarterNote examples, edit in your own pointer labels and .bin information)

//ASCII / straight-lookup only (FE8U)
//Don't use 0x00-0x1F slots, used for dialogue functions
//[0x80] is also unusable (forced - character), might be more

#ifdef _FE8_
	#ifndef menuGlyphTable //ASCII Pointer Table start point
		#define menuGlyphTable 0x58C7EC
	#endif
	#ifndef tGlyphTable
		#define tGlyphTable 0x58F6F4
	#endif
#endif

ALIGN 4
#define mGlyphEntry(mGlyphEntry,mGlyphLoc) "PUSH; ORG menuGlyphTable+mGlyphEntry*0x04; POIN mGlyphLoc; POP"
#define tGlyphEntry(tGlyphEntry,tGlyphLoc) "PUSH; ORG tGlyphTable+tGlyphEntry*0x04; POIN tGlyphLoc; POP"

glyph_mQuarterNote:
WORD 0x00000000 //empty pointer (no Shift-JIS)
BYTE 0x00 //empty code-page # (no Shift-JIS)
BYTE 5 //character width
BYTE 0x00 //always zero
BYTE 0x00
#incbin "mglyph_musicQuarterNote.img.bin"

glyph_tQuarterNote:
WORD 0x00000000 //empty pointer (no Shift-JIS)
BYTE 0x00 //empty code-page # (no Shift-JIS)
BYTE 5 //character width
BYTE 0x00 //always zero
BYTE 0x00
#incbin "tglyph_musicQuarterNote.img.bin"

mGlyphEntry(0x81, glyph_mQuarterNote)
tGlyphEntry(0x81, glyph_tQuarterNote)

What is “GlyphEntry”?:
TBD (Slots 0x00-0x1F aren’t shown although they do exist, they, along with slot 0x80, have additional functionality inbuilt and shouldn’t be used/overwritten.)

To use in your text:
Example given. [0x81] in this case is the same GlyphEntry referenced earlier, or you can assign it a parse definition of your own.

##DEBUG_GLYPHTEST
[OpenMidRight][LoadArcturo][ToggleSmile]
[0x81][0x82] I want to sing![N]
I want to dance~[0x83][A]
[X]

REFERENCES:
Emblem Magic, FEBuilder font tools

9 Likes

Could this be used to insert effectiveness icons like the ones Maiden of Darkness has for weapon descriptions?

I haven’t seen the particular icons you’re asking about, but as long as it uses normal font colors and doesn’t exceed 16 pixel height, you should still be able to, yes. If it uses the standard effectiveness icons in full color I think that’s a different mechanism altogether.

1 Like

Oh this is nice!
I didn’t know you could do this but this could be interesting.

Did you mean 0x40 (64)? (16 * 16 pixels * 2 bpp) / (8 bits per byte) for the raw bitmap data.

Also TIL Usenti has a specific exporter dialog for GBA.

Do not attempt to put glyphs here. These byte values are used by the code system, yes - they’re what the formatting codes get translated into when you use the TextProcessor tools for EA (or, heaven help you, if you use FEditor; and I assume Builder has some equivalent as well that actually works properly). Don’t use 0x80 either; that’s for “extended” text codes. 0x81-0xFF are not used in the North American FE7 ROM, but should be totally fine to use (and are used in FE8 for characters with accents).

Some time in the future I intend to do a hack that allows you to use multi-byte encodings here in a sane way. (The ROM is hard-coded to support SJIS, and does so awkwardly.)

Not unless you can make them work in 4 colours (2bpp), no. I also have in mind a hack to use 4bpp font data directly (taking up double the space per glyph in the ROM obviously), but you would lose access to font colour codes when doing this (you could of course work around this with “pre-composed” coloured glyphs, at the cost of even more space).

1 Like