- •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
Warning: terms may not be accurate. In fact, they almost definitely aren’t accurate, as you’ve probably figured out by now.
A is the assembly window, it has all the codes and will update to whatever offset it is running if you play the game and then pause and check it out. More specifically, A is actually referencing the offsets here, but it’s in the assembly window, so yeah…
B is the opcode column. Right now it’s set to arm, so… yeah…
To the left of C is the column of parameters. Again, it’ll be more obvious once we go into Thumb mode, hopefully.
D is no$GBA’s version of the memory viewer. It works practically the same—you can edit values as you like. If you right-click it you can switch between the “data window” (memory viewer) and the break/watch window (contains a list of breakpoints, which shall be explained later).
E is the stack. If you remember the push/pop explanation, it like, stores stuff here… yeah, it’s another one of those things I really don't understand it all too well but it IS useful sometimes. Essentially, code sometimes pushes offsets while going through routines, so if you check the stack, you can sometimes find useful offsets of pointers, and thus "trace" the routine to find out where it loaded from (real hackers will probably say this is complete and utter bogus and nothing like true “tracing”.)
F contains all the registers and their values. Sadly, I don’t know what cpsr and spsr are though, since I never had to learn… XP
I don’t know what the flags do either, but they’re there, right next to the window. That’s g.
H is the game window. The game can also pop-up on a separate window.
For the buttons above I, the only ones I feel like explaining are Trace, Run Next, and Reload. The rest are either self-explanatory, not very useful, you can figre out on your own, or a combination of the above, AFAIK. Trace is very useful in that it lets you trace the routine. To me knowledge, it’s almost exactly like Run Next, except if you encounter a “sub-routine” (a bl opcode which branches elsewhere) it will actually follow to that code and keep going, whereas “run next” will just run through the entire sub-routine automatically and then keep going from there, without actually seeing what the sub-routine does. “Reload” just reloads the ROM, which is useful, and can also be done with Ctrl+R.
Next, for the main menus to the top:
Files – you can open files via filename or a special list file that I don’t bother to use, and also reload recent ROMs. Snapshots are no$GBA’s versions of savestates, they’re slightly less convenient I think, but they work alright. There’s a couple other things near the bottom idk about and you can also quit (lulz).
The search menu lets you search for strings, set bookmarks, find the next breakpoint, and some other stuff, but the only thing I use and thus the only thing I can really tell you about is the Goto option—click on the assembly window or memory viewer/data window and hit ctrl+G, then type in an offset in hex (remembering the “+0x08000000” if you’re trying to access the ROM!) and hit “Ok” (or enter) to go there.
Run – it’ll let you run around the code. Seriously I don’t know much about it except that there are some shortcuts for the buttons. Maybe you can play around and update this tutorial once you figure out what everything does.
The debug menu is pretty useful, it’ll let you make, clear, and toggle breakpoints, and some other stuff. I only ever really use it to clear all breakpoints though.
The “window” menu has a lot of stuff like the VBA “tools” menu—it’s too much to go into but if you’re familiar with VBA you should be able to figure most of it out on your own.
“Utility” has more things I don’t use though taking screenshots is useful. I’m sure it CAN be useful, I just don’t use it…
“Options” menu has way too many options—fiddle around and get it to how you like. You may want to turn the brightness up and check out some other stuff like the controls to start with. Be sure to hit “Save Options” after your changes so that they save for the next time.
“Help” menu just contains some basic help stuff, the typical stuff you’d expect from a help menu in a program like this. XP
Okay. Now, the basic idea behind debugging is that you say “this area is suspicious: let’s stop the game in this code and see what it does”. To stop it, you make a breakpoint: what I do is just click on the code I want to set a breakpoint on and it turns red. To get rid of it, click on it again or use the debug menu to clear all breakpoints.
As for where to set breakpoints—suspicious places, of course! I covered some tips on how to find routines before.
Now, once you stop the game, you need to figure out what the heck it’s doing. If there are notes on the routine already, it’s pretty helpful, but otherwise you need to use all your knowledge thus far on figuring out what the numbers might mean. Knowing offsets and other such values can be REALLY useful—just recognizing one byte can help you identify what one register holds, e.g. a character ID, and then you can be like “oh, it’s multiplying the character ID by this to get this offset, and… oh!!!” or something like that.
Yeah, it’s very… difficult to explain as a science. It takes intuition. Thought. Trial and error. Playing around. Research. Such skills are important to have and if you have them, you’ll get pretty far.
Anyhow, what you want to do once you find a routine is go through each code and see how each opcode affects the registers. See what the heck it’s doing to not only the registers, but also the values in the memory. If you see some offset in the memory that you don’t know about, try changing its values—it might break the game, but you might also find out something interesting.
Of course, don’t neglect to use this on your own codes. I taught you the hard way first, but now that you can debug your own code by going to the offset you put it at, you can check to see exactly what it’s doing—and when it does something you don’t expect, you know exactly what opcode to blame. Check it out, see how to fix it, fix it, re-insert it, and try again. Then you’ll really be using a “debugger” by, well, getting rid of the bugs in your codes. It’s a pretty fitting name to call this thing a debugger, huh?
…
Wooh.
This may be my longest section in the tutorial.
With that, the ASM hacking tutorial is done.
I’ve more or less taught you everything I know. Okay, I haven’t taught you every little offset, every little doc, or every little code. But that’s where YOUR work, YOUR effort comes in. If you’ve gotten this far, you have the potential to succeed and do great things. Surpass me, to start—it’s not hard. I am not very smart and I managed to get this far. Someone who IS smart can do much better. Hey, you can even write a better tutorial than this long, confusing, vague one when you’re done.
Lastly, I have a little special request of you. I can’t force you to do anything, but I’d appreciate if you shared the ASM hacks you made and any documentation you have. Sharing information and knowledge with others, including hacks, will help the community grow. It will help other people learn and prevent people from having to do the same work. Would you be able to make ASM hacks if others hadn’t shared their doc? I learned almost purely by looking at others’ works and trial & error, so I know I almost definitely wouldn’t. That’s why I took the time out to write this huge tutorial—so that the information is out there for people to take and make their own.
Again, it’s just a request—you don’t have to, but it’s nice. It’d be nice to have a chain of sharing, where I share my knowledge with some people, and they share their knowledge with some people, etc., because if nothing else, some day it might come back that someone shares something with you again. =)
You have learned the most obscure and feared aspect of ROM Hacking for many people—something many people wish they could learn, and something many others shudder to even think about or discuss. You have something to be proud of, if nothing else.
Congratulations and best of luck in all your hacking endeavors, especially ASM hacking!
