[BETA] Emblem Magic

Emblem Magic is an all-in-one ROMhacking/editing tool for the GBA Fire Emblem games, that I’ve been making this past year.
I wanted it to be more complete than it is now before releasing it, but i’m going to be extremely busy this next month, and i had set this deadline for myself beforehand.
As such, there isn’t much in the way of guides as to how to use the program, so i hope that it won’t be too confusing for users.
In any case, you can think of this of more of a public beta than an actual release: so bug reports are rather welcome, and so are feature suggestions.

So, Emblem Magic includes a set of different editors, as well as some core functionalities to better allow the user to manage the changes made to the ROM.
These core tools include:

  • a history of writes done to the ROM (thanks to which the user can use Ctrl+Z/Ctrl+Y to undo/redo changes)
  • an editor to manage which areas of the ROM are marked (by default the markings “FREE” and “USED” exist, but the user can create their own marking types)
  • tools for easier repointing (the user can choose whether the program should prompt them to repoint upon insertion or not, for instance)
    All this information can be stored by the user in an FEH file (FEH stands for Fire Emblem Hack); also note that with this file, the ROMhack can be recreated from an approriate clean ROM.
    Also, Emblem Magic reads external text files to associate names to array entries in the ROM (kinda like the dropdowns from Nightmare, and the user can have their own set of text files, seperate from

the ones for the vanilla ROMs).

The Editors range from the most fundamental ROMhacking tools to more specific ones intended for the GBA FE games:
The ones that have an “X” instead of a “-” are the more incomplete ones (I say this, but in fact almost all of them are incomplete in some way).

  • Basic ROM Editor (read/write bytes, potentially with LZ77 compression)
  • Hex Editor (like any hex editor, really)
  • Patch Editor (for applying various patches to the ROM through FEH files in the “Patches” folder)
  • ASM Editor (dissassemble/assemble ASM code, and can somewhat “test run” code line-per-line)
    X Event Editor
  • Module Editor (basically Nightmare, uses “EMM” text files to load GUI to edit arrays or other data in the ROM)
  • World Map Editor (pretty simple image inserting for the large/small world maps for the game)
    X Map Tileset Editor (to change the tilesets of 16x16 tiles used for maps, their animations, their terrain associations)
  • Map Editor (to edit the maps for each chapter of the game, as well as the triggerable tile changes for these maps)
  • Graphics Editor (basically GBAGE, to view and edit images in the ROM)
  • Portrait Editor (to view and edit the different portraits in the game)
  • Map Sprite Editor (to view and change the sprites of units on the map)
  • Battle Screen Editor (to change the screen frame during battle, or the platforms under the characters’ feet)
  • Battle Animation Editor (to view and change the various battle animations in the game, and the palettes for them)
    X Spell Animation Editor
  • Backgrounds Editor (to change dialogue scene backgrounds, battle backgrounds, and cutscene CG screens)
  • Text Editor (to change the text in the game, as well as the fonts used to display text)
    X Music Editor (to change the music and sound-effect tracks used in the game)
    Some other editors are accessible from within the other editors, under the ‘Tools’ menu:
  • Palette Editor (you can also open this by clicking on a palette in an editor)
  • TSA Editor (to change TSA arrays, these indicate tile layout and associate 16-color palettes to each tile, for more complex images)
  • OAM Editor (accessed from the Battle Animation Editor, to change the sprite layout information for a given frame of animation)

Download the program here: (also i suggest reading the readme.txt before doing anything)
http://www.mediafire.com/file/8lv5xfzst1055cd/Emblem+Magic+BETA.zip

UPDATE: Second version of the beta is here, adding quite a few new features

  • Event Editor (calls EA from a bundled dll file, the code editor has syntax coloring, mousehover documentation and some more cool functions)
  • Item Editor (to edit anything pertaining to items, including their stat bonuses or the classes they’re effective against)
    X Title Screen Editor (very unfinished, really just has shortcuts to the Graphics Editor for the 3 sub-images that make up the title screen)
  • And plenty of other stuff (many bugfixes of course), including pretty much all the things said in this thread (like having more shortcuts) and some other things, like the ability to modify batte anim structs within the battle anim editor
    http://www.mediafire.com/file/al2kt7s7ckn2932/Emblem+Magic+BETA+2.zip
27 Likes

HYPE! Love it!
Kind of wish I wasn’t too far into my current project now. :disappointed:

This is so hype, thanks Lexou.

1 Like

I’d be hyped but 75% of the hacking i’ve been doing is on other FEs

I downloaded this and got a virus wtf
This is fucking revolutionary. I love you

Nice job! Lexou keep up the great work…

noice mate, the music editor is a little laggy but it’s kinda cool


When I try to change the tileset for a map with the dropbox here I get this error

Now I want to know if I’m the one doing something wrong or not.

1 Like

Bit of feedback: More “Shortcut” features, would make this tool a lot more streamlined and convenient to use which I think is the main point of this tool. Also, there are a lot of other programs that are a bit more useful and not as “laggy” than some of the editors in emblem magic and while I do love the swiss army knife usability of emblem magic, if it’s not as good as some other tools then people will just continue to use multiple different programs. So I’ll be expecting a lot more polish for the finished version. Really looking forward to it and keep up the great work!

1 Like

So, when I click the “Insert MIDI” button on the music editor, it just flat doesn’t work. Any reason why?

He’s probably going to need to go into more detail.

Music editor isn’t finished yet.

This looks really great :smiley:

I’m playing around with it and testing things, and I’m having issues inserting an animation. This is one that I’ve already put into the game via FEditor Adv, I’m just doing it with EM to put it through its paces. I’ve converted all the frames to 240x160 (from 248x160 as FEAdv uses) and converted the script over to EM format, but it’s encountering an error on a particular frame (59) while going through; and possibly later frames too though I can’t check since I can’t make it past frame 59. Something about a tile being out of bounds.

I’ve attached the frames and script here:
https://mega.nz/#!TUMiXCoL!ttdWLvkyEEnHmqfBOZ9ZdKBRaie-TVipOPiu1TFMsiQ

Here is the error:

On a side note, when exporting animations out of EM, I would really prefer if the frames were numbered in decimal instead of hex. In hex, the frames are totally out of order when listed in Windows, which makes it annoying to scroll through the frames on an image previewer to see a few frames in sequence quickly:

http://puu.sh/xNSsD/29ff13d87c.png

Decimal is more readable for most people, hex numbering should not be used unless there is a specific reason to do so (i.e. the numbers correspond with offsets in the ROM or something like that). In this case I don’t see any relation that requires the image names to use hex. I assume you’re just numbering them in hex to keep consistency throughout the program rather than having some things in hex and some in decimal, but I don’t think it’s doing anyone any service in this case.

Great work though <3

1 Like

This is done because the animations are listed in Hexidecimal order in the rom, and until he can sort out something to change that upon export, it’ll continue to be an issue.

Could always do something like 15 - 0F.png

1 Like

Alright, so the patch folder uses .feh files. Would there happen to be a .ups to .feh converter on hand? Manually converting the files breaks Emblem Magic more
Unless I’m just behind on the new hip trends

Second version of the beta is here, adding quite a few new features

  • Event Editor (calls EA from a bundled dll file, the code editor has syntax coloring, mousehover documentation and some more cool functions)
  • Item Editor (to edit anything pertaining to items, including their stat bonuses or the classes they’re effective against)
  • X Title Screen Editor (very unfinished, really just has shortcuts to the Graphics Editor for the 3 sub-images that make up the title screen)
  • And plenty of other stuff (many bugfixes of course), including pretty much all the things said in this thread (like having more shortcuts) and some other things, like the ability to modify batte anim structs within the battle anim editor

http://www.mediafire.com/file/al2kt7s7ckn2932/Emblem+Magic+BETA+2.zip

And yeah i recognize i haven’t been super productive these past few months, but everybody has moments when real life gets in the way (i entered a pretty competitive programming school). In any case, here’s to hoping this update brings some people to this thread :slight_smile:

(also, @MattCustov, if you wanna make an FEH patch from a UPS file, just apply that patch to a clean ROM, open the newly patched ROM with EM - then go in Tools -> Manage Write History, and tidy up the writes there, by merging together ones that are near each other and adding descriptions. Then go to Edit -> Hack Properties and set the name, author, and description for your patch. And finally, simply do File -> Save FEH and you got your patch - put that in the ‘Patches’ folder, and you’re good to go)

8 Likes

Hey :slight_smile: Thanks again for all your work.

Just some comments/feedback with the battle animation editor.

I noticed when animations are exported from EM, the colors are a little off compared to the originals, and compared to animations exported from FEditor Adv. You appear to be using the wrong formula for converting the 5-bit GBA color values to 8-bit standard color.

Although you are dealing with 32 colors per channel vs 256 colors per channel, you cannot simply multiply the values by 8, because the values go from 0–31, not 1–32. The maximum 5-bit value (31) should correspond to the maximum 8-bit value (255), whereas if you simply multiply by 8 you’ll get 31 -> 248 instead of 31 -> 255.

The correct formula is to multiply all values by (255 / 31) and round to the nearest integer. For example, the standard green background GBA(21, 26, 20) is converted to RGB(173, 214, 165):
21 × (255 / 31) = 172.74 -> 173 (rounded up)
26 × (255 / 31) = 213.87 -> 214 (rounded up)
20 × (255 / 31) = 164.52 -> 165 (rounded up)

Or the FE8 standard black color GBA(5,5,5) is converted to RGB(41, 41, 41):
5 × (255 / 31) = 41.13 -> 41 (rounded down)

And if we examine the background of an FEditor Adv image we will see that those are the values used:

Whereas the same color on an EM frames is RGB(168, 208, 160)

Not sure if this would actually cause issues (haven’t tested things extensively yet), but I know some things (like FEA) are sensitive to having only 16 unique colors, and this could potentially be problematic if trying to use frames exported from EM mixed with frames exported from FEA.

In addition, it would be good to have detection for repeated frames (beyond just the consecutive repeats). When exporting simple dodge animations for example, I noticed when the original script calls for something like
1 Frame 0.png
1 Frame 1.png
1 Frame 2.png
C01
1 Frame 2.png
1 Frame 1.png
1 Frame 0.png

But when exported with EM, the second sequence are exported as unique frames, so you get frame 0, 1, 2, 3, 4, and 5.png, even though 3, 4, and 5 are duplicates. When editing animations frame by frame for things like re-paletting certain parts of the animation, hair or capes or whatever, every frame can be painstaking, so keeping track of all previous frames and detecting when a new frame is the same as a previously encountered frame and not making another unique frame out of it would be ideal.

3 Likes

In addition, I would suggest that all images should be output in indexed format. The primary image editing utility for GBA editors (Usenti) can have issues with disappearing colors when opening images that are formatted with directly-specified RGB colors.

As you can see, if I open this image (exported from EM) in MS Paint, you can see it all appears correct:

(above: original EM export, opened in MS Paint)

However, when opened with Usenti, there are some colors mysteriously missing, because the image is formatted as 32-bit RGB which Usenti has issues with:

(above: original EM export, opened in Usenti)

You can see that one of the shades (in this case, a gray) is simply gone, replaced with background color (for example in the horse’s legs).

I converted all the frames from RGB to indexed format with a MATLAB script, and voila:

(above: Indexed version of image, opened in Usenti)

Everything is good again. So, I would recommend exporting images in this format to begin with, for maximum compatibility with the other tools in common use :slight_smile:

(EDIT: I just noticed actually that the Paladin animation’s default palette has two copies of the color white at two different indices in the color map (one used for the horse, one used for the shield). Although they are both white (255, 255, 255) in the default palette, if other palettes are applied then certain white pixels will be changed to one color and other white pixels will be changed to another, depending on which “white” index they belong to. If the images are converted to RGB and then back to indexed format again, this distinction won’t be preserved, so… it’s situations like this that make preserving the original indexed format even more important. Since FEA and EM both export in RGB I won’t be able to edit this animation without some pretty intensive manual efforts :c EDIT 2: Actually I forgot EM lets me export with a different palette applied, so I guess I can just use that :3 EDIT 3: Actually not, since inserting animations with EM breaks things every time at least for me, EM’s sheet format is not compatible with FEA, and I can’t do it by exporting the frames from EM and building an FEA animation sheet out of those, because the paladin animation is too complex for FEA to build an animation out of (OAM data overflow or something like that) but oh well, such is the life of FE editing… Intensive manual efforts it is :slight_smile: )

1 Like

Lexou so much thanks , I hope to make true one of my dreams of create a fire emblem like game but when I open the item editor it say me that item editor.core loadentry listbox it’s out of the matrix limits … what I need to do for fix that error? Thanks for reading