View Full Version : [Tutorial] [Hacking Library] Introduction to ROM Hacking

December 30th, 2008, 9:36 AM
[css-div="text-align: justify; padding-left: 25px; padding-right: 25px; width: 60%; padding-top: 25px; padding-bottom: 25px; background-color: #ffffe0; color: #220000; font-family: Candara, Calibri, Tahoma, Sans-serif; font-size: 9pt; border: 1px solid olive;"][css-div="font-family: Cambria, Georgia, serif; font-weight: normal;"]Introduction to ROM Hacking[/css-div][css-div="font-family: Cambria, Georgia, serif; font-weight: normal;"][/css-div]
Part of Hacking Library

Welcome to this document. I'm Quacker, and I doubt you know me. I'm here to help beginners with basic aspects of hacking and show them ways to creative development. In this series, called Hacking Library, I will encompass basics and also some more advanced areas. Don't worry, it won't be that hard to get over those parts ;) For convenience, I bolded the keywords so when you don't want to mess with whole text, you can read the parts that

ROM hacking is altering the game's code to change appearance of game's elements, altering the areas of gameplay (maps), background music, the events happening in game (scripts) and overall plot. Everything mentioned can be altered using one or two (maybe even more) methods. We will speak about the first two - hex editing and tools usage.

Hex editing is a process of editing hexadecimal numbers that represent the actual ROM. This ROM stores important data in header for making it possible to launch the game, graphics, scripts and more, what makes the game code. By changing right values at right places, hex editing may become an ultimate hacking technique. By hex editing, it's possible to change basically every aspect of the game. Coolboyman's Pokémon Prism is a perfect representation of such radical changes.

And although hex editing may be great help, it is not easy to master. Some tasks are repetitive and may become boring. That's where the tools come into the play. The tools actually edit the data by editing hex in a same manner we would do, but they offer you a more friendly interface and visual representation of the numbers. Take a map as an example. When you open it in a map editor, it looks like a town or a route. But when you see it in a hex editor as a bunch of repeating hex numbers, it may get annoying to change each and every tile by rewriting the value. Therefore it's quite convenient to use the tools. Sometimes, hex editing is really needed. For example, before palette editing tools, people used to change palettes ussing VBA's palette viewer plus a hex editor. I am still used to change my palettes this way, when I don't want to mess with APE.

We won't go much deeper because now you know what is ROM hacking and how the games are hacked. More detailed guides can be found all over this forum.

This document shows the pros and cons of tools. Tools are really convenient, but you see, it all comes from hex editing. Therefore you should know a bit about hex editing so you don't get scared by numbers when there isn't any tool for desired task.

The tools are also a bit "addictive" so you must be sure you don't rely on them completely. For example, how would you write scripts with tools? It's hardly possible, even with so-called helpers. You must believe in your own skills and imagination, don't be shy, use "trial and error" technique and don't forget to make a backup ;)

So, I hope you enjoyed reading this document/artice and you will read more from Hacking Library ;)

Document and layout ©2008 Quacker. To be used only with permission.

December 30th, 2008, 2:25 PM
Heh, nice! I hope people who are new to ROM hacking will finally understand that hacking isn't just using the available tools!
They should know how it all started; more people should explain how there tools works when they release one (Oh darn.. that includes myself too..);
people should learn understand what they're changing.
I hope your Hacking Library helps them to.. well; what I said on the previous lines.

Oh, and welcome to The PokéCommunity!

December 31st, 2008, 12:49 AM
Thank you very much ^^ You see, people may know a bit more now about how the tools work in backend. It is indeed a really general explanation, nothing specific, but for a beginner it's enough. Now it depends on the beginner if he/she wants to read the document.

And I am not really that new :P

Imposter Oak
December 31st, 2008, 10:53 AM
Since when do ROMs contain a BIOS?

January 1st, 2009, 4:15 AM
Well, they do contain parts of BIOS. Maybe I have mistaken. But the data at first X bytes along with ROM header contain snippets of BIOS, or not?

January 1st, 2009, 5:31 AM
Well, they do contain parts of BIOS. Maybe I have mistaken. But the data at first X bytes along with ROM header contain snippets of BIOS, or not?

Kinda. http://nocash.emubase.de/gbatek.htm#gbacartridgeheader

January 1st, 2009, 6:51 AM
Yes, that was my source. But well, seems like I misinterpreted it. If I understood well, it does contain snippets of BIOS for comparison and also instructions for it. I will fix this par ;)

Oh, if you have any questions that could be answered by me, feel free to post them here.

Imposter Oak
January 1st, 2009, 7:19 AM
Game ROMs don't seem to contain portions of the actual BIOS, the BIOS is stored elsewhere in the GBA hardware so you wouldn't need to replicate any part of it. From that source that you're talking about, it doesn't provide instructions for the BIOS, it seems the BIOS is the one making all the decisions. The instructions are for the processor only.

January 1st, 2009, 7:54 AM
Everything's fixed so I won't have inaccurate information in there and you won't have any complaints :P

January 1st, 2009, 8:39 AM
can someone give me fulfledge guide about scripting because i want to learn it.
and quacker thanks for the document i read it and i never did no that it was actualy the hex thing that let you change tings not the tools the tool only makes it easyir

and sorry if i post this in the wrong section!!

January 2nd, 2009, 12:24 PM
You should have posted your request in a different thread. But other than that, thanks for the comment.