Changes

Jump to navigation Jump to search

ROM hacking resources

1,772 bytes removed, 15:31, 17 March 2019
m
Reverted edits by 71.95.119.28 (talk) to last revision by Bot
* IDA Pro with some user-made plugins can also take a ROM file from the system covered in said plugin, and try to disassemble its binary to a text file. Some emulators offer the option to do this if you give them which address in the ROM (or RAM) you want to disassemble from.
However, disassembly can easily fail, and you end up with garbage nonsensical code in the text file. Why? Just like hex editors with text display, or tile editors, when disassemblers try to interpret stuff that's not programming as such, it's a recipe for disaster. Another extra problem is that after reading garbage data, even if the disassembler stumbles upon some legit programming bits after that, it will no longer tell where instructions begin and end (remember they're all just bytes) and so there will be even more erronous erroneous interpretations.
That is, not to mention the numerous cases where the developers DON'T want you to look at their code: so it's either protected against disassembler tools during runtime (Denuvo on PC games), compressed then the game uncompresses just what it needs to the RAM and executes from there (Ys 5 for the Super Famicom), or most of the programming is written in another arbitrary programming language and the remaining 10% recognizable assembly code for that hardware is just the part which translates that arbitrary languages and not much else - this is also called bytecode and is used in many RPGs, with a quite infamously complicated variant being present in Earthbound (Mother 2) for example.
* a documentation of the hardware you're working on (including the various registers, hardware registers for stuff like the VRAM, the memory addressing...)
* an opcode list for that hardware, which includes all the instructions allowed on that hardware which you'll encounter (in the game's original code) and probably will use (in the code you'll write as a replacement)
* an assembler tool, to transform the text file with your innovating hack's code to binary format to be inserted later with a hex editor in the game proper. If you're especially good in at regular computer programming, you could write one yourself for your personal use.
* a hex editor
* optionally, knowing how to use a cheat engine, since the RAM addresses it finds can lead to the instructions we need to find and eventually mod, in case those instructions affect those RAM addresses.
* any of the aforementioned disassembly solutions, as long as they can help you pinpoint which instructions in the original interest you and could be changed to achieve the effect you desire.
Having the new code being too long can be troublesome since you wouldn't want to overwrite irrelevant parts of the rom and thus corrupt it. The popular solution is to insert a JUMP instruction (as always, which instruction it is depends on the hardware) pointing your code to some faraway empty place where you can comfortably put all the code you want -- of course, within the limitations of that specific system. You can see it's the same idea as text editing.
If you're more interested, check SMWCentral's boards for tutorials introducing you to SNES hacking with Super Mario World. Then if you feel more comfortable tackling harder stuff, you could learn PS1/PS2 assembly and translate/mod/fix some games.
By the way, more recent systems no longer have a big data blob with all data types mixed, but use neatly arranged file trees with recognizeable recognizable (yet proprietary) file formats. This goes for programming too: all systems now have the executable in a separate file, and it's often the one loaded first. Some people even claim they had success running those through third-party disassemblers like IDA Pro. Some examples:
* PS1: SLUS_*** or some variation
* PSP: EBOOT.BIN, BOOT.BIN
* '''Cheats:''' You modified some text and graphics in the final stage but can't be bothered to replay the whole game legitimately. In case the emulator doesn't support this natively, you might want to consider using [http://www.cheatengine.org/ Cheat Engine].
* '''Save states, rewinding, fast forward, frame advance, pause:''' You modified something appearing in a very narrow timeframe, or you just want to take clean screenshoots screenshots of the game.
* '''Debuggers''' with the following features:
** '''Breakpoints:''' A breakpoint throws a fit and pauses the game if a specific address is tampered with. Of course, to know which address it is, you need to find it first with a cheat/RAM search.
===Emulators===
{| class="wikitable" style="text-align:center;"
|+NES
|-
! scope="col"|Useful?
|-
| style="text-align: center;"|[[FCEUX]]| style="text-align: center;"|Windows, Linux, macOS, Solaris, BSD| style="text-align: center;"|2.2.3| style="text-align: center;"|High| style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓| style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓✓
|}
* '''FCEUX''' is the golden standard for emulator debuggers, it's a fully featured one and very newbie friendly. So please check it out even if you're not interested in NES games as it's an excellent starting point for game modding. It's one of the few emulators, alongside PCSX2 and PPSSPP, to include conditional breakpoints.
{| class="wikitable" style="text-align:center;"
|+SNES
|-
! scope="col"|Useful?
|-
| style="text-align: center;"|[[Snes9x]]| style="textMulti-align: center;"|Windows, Linuxplatform| style="text-align: center;"|Gieger's r1.51| style="text-align: center;"|High| style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|Address| style="text-align: center;"|✗ | style="text-align: center;"|✓ | style="text-align: center;"|✗ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✗ | style="text-align: center;"|✗ | style="text-align: center;"|✓✓
|-
| style="text-align: center;"|[[BizHawk]]| style="text-align: center;"|Windows, Linux| style="text-align: center;"|Main| style="text-align: center;"|Cycle| style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|Range| style="text-align: center;"|✗ | style="text-align: center;"|✓ | style="text-align: center;"|✗ | style="text-align: center;"|Read-only| style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✗ | style="text-align: center;"|✓
|-
| style="text-align: center;"|[[No$|NO$SNS]]| style="text-align: center;"Windows, [[Intel CPUs|WindowsDOS]]| style="text-align: center;"|1.6| style="text-align: center;"|Mid| style="text-align: center;"|✗ | style="text-align: center;"|✗ | style="text-align: center;"|✗ | style="text-align: center;"|Address| style="text-align: center;"|✗ | style="text-align: center;"|✓ | style="text-align: center;"|✗ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓ | style="text-align: center;"|✓
|}
* Older '''bsnes''' versions, and many of its forks - notably BizHawk and Marmelade, have an extensive VRAM viewer, some versions having ones topping NO$SNS, as well as a memory viewer. byuu says he wants to make a proper debugger himself called Loki (citing this as the reason for putting on hiatus the FEOE:Zero translation) but don't hold your breath for it.
* Geiger's custom build of an older version of Snes9X Snes9x also is very useful. While the base emulator only has a background layer disabling hotkeys, cheat codes and frame advance features, this build adds a debugger, a tracer (to a log file), as well as a memory viewer/editor with the option to dump to external files to open with hex editors. There's also the very useful "What's Used" feature which colors areas in the memory viewer depending on what's onscreen (controllable with the BG layer hotkeys). However, it doesn't play nicely with nonstandard SNES cartridges. There's another custom Snes9X Snes9x build by FuSoYa for Super FX2 games.
* As for '''NO$''' emulators, right off the bat when you start it, they have a fully editable debugger (upper-left), RAM memory viewer (lower-left), hardware register (upper-right) and stack (lower-right). You can set breakpoints on addresses or programming lines (opcodes). You can view I/O status (for stuff like sound and DMA) with the F10 hotkey.
* '''DeSmumeDeSmuME''' has some older builds on gbatemp with interesting modder-friendly options:
** Custom build allowing searching for unused RAM areas. If you want to change the game's programming you'll need to find an empty place in memory to put your new code, so this is extremely useful.
** Custom build allowing to select a DEBUG option under Slot-1. The console window will show every single file loaded off the cartridge in real time, and it's also logged to a text file. If you're, say, looking for the title screen to change it, you can this way narrow down which files you need to look for.

Navigation menu