
- •Downloads:
- •Update Log:
- •Table of Contents:
- •Prologue: Bare Basics
- •Chapter 1: Key Terminology & Abbreviations
- •7Zip Archive – Supposedly the best file archiver there is, but not used as much, and thus less convenient. Requires 7zip or winRar to use.
- •VisualBoyAdvance – most people’s emulator of choice, almost always referred to as “vba” for short.
- •Chapter 2: Using Nightmare Modules
- •I upload anything that I think might be useful to someone on that site. Just use the menus and search until you find it.
- •Chapter 3: File Management
- •In order to be a successful hacker you need to have a lot of good management.
- •Chapter 4: Pointer Tables
- •Chapter 5: Battle Animation Editor
- •Chapter 6: Character Editor
- •Chapter 7: Class Editor
- •Chapter 8: Item Editor
- •Item icon – obvious
- •Chapter 9: Spell Association Editor
- •Chapter 13: Movement Cost Editor
- •If the value next to a type of terrain is ‘255’ then it is uncrossable because a unit won’t have 255 movement points.
- •Chapter 16: Battle Palette Reference Editor
- •If you want to know how to actually edit battle palettes’ colors, you can find that in a later chapter that I will make.
- •Chapter 17: Arena Class Editor
- •It’s a bit of work, but making cGs is quite rewarding, and it’s easier than some stuff, that’s for sure! Good luck with your cg making!
- •Chapter 20: Lyn’s Ending Editor
- •Chapter 21: Tutorial Editing/Getting Rid of the Tutorial
- •Part 2: Downloading the Programs
- •Part 3: Preparing Your midi
- •If you still have more than 10 tracks, you should find another midi. Sorry but, there are limits in life.
- •Part 4: Applying Blazer’s Beta Music Insertion/Instrument Patch
- •Part 5: Converting Your midi
- •Part 6: Making Your midi Repeat and Transferring it to Your rom
- •If the b1 and bc are next to each other then I can almost guarantee you want to replace it, so hit “replace” and do that with every instance and once you’re finished you’re good to go.
- •Part 7: Track Pointers & Repointing
- •Part 8: Finale- Assembling Your Song & Profit
- •If you don’t have this module, you’ll have to use this outdated way of doing it. Do check to see if you have the latest Nightmare Modules in general, but otherwise… well, sorry I guess. Xp
- •Part 9: Possible Errors & Wrap-up
- •Part 10: Documentation and Stuff
- •Atrius’ Notes:
- •Charon’s Notes:
- •Part 11: The Music Hacking Run-Down (Shorter Version of Tutorial & Walls of Text)
- •Part 12: Credits & Thanks
- •Chapter 25: Music Editing with Zahlman’s Song Editor
- •If you actually do type in help and press ‘enter’ on your keyboard, it’ll give you a list of commands, and tell you some stuff. Here’s the important stuff:
- •It worked! Great! I know how to import a song!
- •Chapter 26: Exporting Music with gba2midi
- •Chapter 27: Battle Background Graphics
- •If it doesn’t, I suggest double-checking all your settings (everything should be compressed) and make sure your width is set to 30 and your height is set to 32.
- •Chapter 28: Music Array Module
- •Chapter 29: Sound Room Editing
- •Chapter 30: Chapter Unit Editing with Nightmare
- •Chapter 31: Death Quotes
- •Chapter 32: Event iDs
- •Chapter 33: Battle Conversations
- •Chapter 34: Triangle Attacks
- •Chapter 35-36: The Animation Modules & Repointing Tutorial
- •It should look like this:
- •Chapter 37: Support Editing
- •Chapter 38: Miscellaneous Nightmare Modules
- •In this chapter I’m going to quickly run through what some other nightmare modules do.
- •Vendor/Armory Editors – edits the contents of vendors and armories.
- •Vulnerary Editor – edits the amount of hp restored by a vulnerary. (Default: 10)
- •Vulnerary Editor – edits the amount of hp restored by a vulnerary.
- •Chapter 40: Text Editing with fEditor Adv
- •Chapter 41: Portrait Formatting & Preparation
- •Chapter 42: Portrait Insertion with fEditor Adv
- •I wouldn’t mess with the palette editor (the colorful boxes).
- •Chapter 43: Locating Palettes
- •Chapter 44: Editing Palettes
- •I don’t exactly have a color I want to use for this title screen background, so I’m just going to show you how to get the rgb of some random color on a portrait.
- •If something didn’t work right, make sure you:
- •Chapter 45: Working with gbage
- •Chapter 46: Chapter Data Editor
- •Vision Distance is for Fog of War (fow). If it’s ‘0’, it’s assumed there is no fog of war.
- •Hold it! (Unless you aren’t hacking fe7!)
- •Chapter 47: Map Creation
- •I’m tired of writing this tutorial. Honestly. So from now on, I’m going to stop making so many wasteful comments like the one I am typing right now.
- •Chapter 48: Map Insertion
- •If you’re looking to make a totally new chapter (instead of being limited to the old game’s exact same scenes with exact same events) then read on, because I’m going to hack events next!
- •Chapter 49: Event Assembler Basics
- •I would just always add end guards since it’s not something you need to worry about too much.
- •Chapter 50: Events – The Layout
- •Including the stlb
- •Chapter 51: Events – The Event Codes
- •Items is just a list of items with a max of 4 starting items. I prefer to use the 3rd method of writing them, with the brackets and all. Each item is separated by a comma.
- •Chapter 52: Event Construction
- •VillageGate: // name of tile data group
- •Chapter 54: Chapter Creation Finishing Touches
- •Chapter 55: Importing Tilesets
- •Part 2: The First Frame
- •Part 1b: Palette Preparing
- •Part 2: Testing the Foundation to Your Animation
- •If all goes well, your guy should be standing, kinda like this.
- •Part 3: Making the Rest of Your Frames
- •Chapter 58: Custom Battle Animations – Scripts
- •I just pulled a Xeld. Had to do that at least once in this tutorial.
- •If you don’t know what a sound sounds like, just test it out with your animation and find out. Experiment with the codes if you need to.
- •Chapter 59: Custom Spell Animations
- •0X85 command count for this spell: 10
- •It’s true! It did work! It’s still very much a work in progress, as you can see, but the point is we got he test frame working. The rest just takes time, patience, and the attitude that you can do it!
- •Chapter 60: Weapon Icons
- •If you did, you are successful. Despite the odd format of the icons, you have spotted them, and that is what is most important, in my honest opinion.
- •I have this show up:
- •Chapter 61: Map Sprites
- •Chapter 62: Proper Betatesting
- •Chapter 63: vba’s Tools
- •Chapter 64: Other vba Options
- •In this chapter I’m going to detail some of vba’s semi-obscure but not totally obscure options. Knowing how to use vba will help you test your game in various ways.
- •Chapter 65: Recording Videos & Sound
- •Chapter 66: Fixing the Desync with VirtualDubMod & Video Rendering
- •Chapter 67: ips Patching & General Patching Information
- •Chapter 68: ups Patching
- •I suggest you read the ips patching tutorial (at least the beginning) if you haven’t done so as I will not be as thorough with this chapter as I was the previous.
- •In an extremely similar manner you can apply patches. Take a look.
- •Chapter 69: jfp Patching
- •Chapter 70: xDelta Patching
- •Chapter 71: Nightmare Module Format
- •It is recommended (for reasons of readability by humans) that a newline
- •Is unused ("null") for editboxes.
- •Chapter 72: Miscellaneous Information Archive
- •Chapter 73: Useful Links & Websites
- •Chapter 74: Bonus – Assembly Hacking
- •Preparations:
- •Part 1: Background Info
- •Part 2: Inserting an Assembly Hack
- •Part 2: Breaking Down Your First asm Hack
- •I digressed a lot, but back to the point:
- •Part 3: Second Example – More Codes, More Fun
- •Read other people’s doc.
- •Part 4: More Examples – “Speed-Analyzing”
- •It’s thumb. Write to offset 0. Start with label “Initial”. Push 5 registers and the last register, then start a loop counter in r2 with starting value 0x00.
- •Ifat *Conditional id* *asm routine pointer*
- •I may have mentioned this before, but finding where to hack routines is difficult. And I’m sure I mentioned that finding space for them is difficult.
- •It’s not super long, but it’s got some new things we need to learn. Let’s get started.
- •Part 5: Finding asm Routines & Basics of Using a Debugger
- •Warning: terms may not be accurate. In fact, they almost definitely aren’t accurate, as you’ve probably figured out by now.
- •I don’t know what the flags do either, but they’re there, right next to the window. That’s g.
- •I hope to hear of your achievements in the near future!
- •Final Chapter: Credits, Thanks, and the Epilogue
Part 1: Background Info
Assembly, ASM hacking, whatever: I’ll likely just use terms loosely and call what we’re doing “ASM hacking”, meaning hacking assembly. We might sometimes actually write our own routines, in which case we’re doing less modding and more creating, but I’ll still call it an ASM hack, because whatever, proper terminology isn’t a huge deal to me.
Assembly can be viewed in a hex editor, like anything else. In fact, certain nightmare modules, like the vulnerary editor, actually edit assembly itself. Also, assembly can be found in various parts through the game, but the core of it is found in the first… roughly a megabyte, though I think it’d be more accurate to say it goes around to somewhere in the 0x080C0000 section.
Assembly codes, known as opcodes, usually take up 2 bytes. However, what it does is more dependent on the bits (review binary if you need to: I won’t explain it here). There are several exceptions in which case opcodes may take more than 2 bits or in the case of the ldr function, may have values stored at the end of a routine, as opposed to in the middle. This will make more sense later. (Also, function/code/opcode, it’s all the same to me, FYI.)
There are multiple ways to “hack the ASM”. You can edit it through a hex editor directly, but this is often too difficult because you would have to know what the hex for various opcodes are, and figuring them out can be a pain, to say the least. However, if you’re just editing a parameter, which may be one byte (e.g. 0x14, or 20, the level cap) then it’s probably much easier to just edit that parameter directly.
You can also write a text file that is usually saved as a .asm file and contains code for an assembly routine. FYI, an assembly routine is the generic term I use for any code of assembly that does something. It’s sort of like a script, except I might reference “the damage calculating routine”, which might in fact be part of many other routines, because the game WILL reuse code where relevant (for instance, the Random Number Generator code is used a lot).
Part 2: Inserting an Assembly Hack
Before you go making your own, let’s get you familiar with how to insert some pre-existing ones.
https://dl.dropbox.com/u/8875056/hacking/asm/Hector%20Hard%20Mode%20Hack.zip – Here is a hack I made that forces the game mode to be Hector Hard Mode. It’s very simple and we’ll use it as an example.
First, put the Assemble ARM batch file in a folder where you’ll stick your ASM hacks. It’s good to be organized so I suggest making a folder for every ASM hack you make once you’re done with it, naming it appropriately and taking notes ALL THE TIME. Taking notes is super important, especially in finding bugs in your own code—and if you ever have to go back to edit code, you’ll be happy you took notes because it can be a serious pain to figure out what the heck you wrote a few months or even weeks ago.
Extract it and take the .asm file and drag it onto the “Assemble ARM”. If devkitPro was installed successfully and everything, it should work fine. If not… well, we have a problem. Try restarting and changing your installation method or other random stuff. I’m really not too sure how it works but people tend to have problems with this. Sadly, I’m really no help here—hey, I warned you earlier.
It should give you a dialog message in a command window like so:
It may occasionally mention something about a “pipe”… I really don’t know what it means, but it doesn’t really affect anything, so don’t worry.
Two files should be outputted once it’s done: a .dmp file and .symbols file of the same name. The .symbols file is, as far as I know, useless. I don’t know what it does because I didn’t learn the programming language properly but I never needed it and I got pretty far.
The .dmp file is super important though. It contains the raw hex/binary (remember, it just depends on whether you look at it through a hex, binary, or even text editor—utlimately, the file is still the same).
To insert this ASM hack into your ROM, find some free space, copy all the data from the .dmp file, and paste it there. Note the offset.
Now the way this ASM hack works is that you have to call it somehow. Sometimes you can call ASM routines through events and other times you’ll want to insert your ASM into an already existing routine meaning you have to find the routine first and then insert over that routine or even expand the routine to branch elsewhere, put your code there, and then tell the game to go back to after you branched at the original point (meaning, where you were before you branched, but after the branch code itself, or else you’d infinitely branch: we’ll get to this later).
This one is easy because you can just write an event using the event assembler to activate it. You should know the code already, but if not, it’s:
ASMC 0xOFFSET
There’s a catch here though. 0xOFFSET is the offset in hex, okay. You know this. But if you insert it to say, 0xD50000, it won’t work. This is because the routine is written in THUMB and there’s a difference in how things work between THUMB and ARM.
What the hell are THUMB and ARM? Don’t ask me, I don’t really know. But we can use either THUMB or ARM to write our programs and we’re going to use THUMB. To let the game know we’re using THUMB, we’re going to make it start at an odd offset—meaning we add +1 to the offset we inserted the routine at. Yes, that’s right—you would actually type “ASMC 0xOFFSET+1”, or in our example, “ASMC 0xD50001” for it to load the routine at 0xD50000.
Go ahead and test the event: you probably won’t see anything happen because it’s such a simple event. However, secretly, it forced the game to be hector hard mode. In fact, if you beat the chapter you were on and save, you should be able to tell because in FE7, Hector Hard Mode playthroughs have grey-colored chapter titles. Granted you might have changed that in your hack, but that’s the default in vanilla (non-edited) Fire Emblem 7.
If you’re not convinced/don’t want to beat the chapter though, you can check the memory. Go to 0x0202BC13 in VBA’s memory viewer and you should see “0x03” there. 0x01 = Lyn’s mode, 0x02 = Eliwood’s mode, 0x03 = Hector’s mode. At 0x0202BC0C, you should see “0x40”. 0x40 is the value for hard mode (it’s likely a bit map though, meaning what actually matters is the bits in the ‘4’ that act as the flag for hard mode… anyhow, this hack FORCES it to be 0x40, so the other bits are set to 0 here).
Congratulations: you’ve now inserted your first ASM hack. A couple notes: using “ASMC” runs the code once. If you want to run it again, you use the code again. The program needs to… you know, end, or else it’ll go into an infinite loop and freeze, so you can’t “make the program loop” in that regards. Thus if you were trying to say, make sure someone’s HP was always at max all the time, using an ASM hack like this wouldn’t be a good idea because if it’s just constantly forcing that HP, it can’t do anything else… as in like, you couldn’t play the game, because the game runs on ASM. XP
Anyhow, next let’s figure out what the ASM hack actually did.