News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: NES Romhacking Guide  (Read 884 times)

Cyneprepou4uk

  • Jr. Member
  • **
  • Posts: 19
    • View Profile
NES Romhacking Guide
« on: February 24, 2019, 05:45:43 am »
Hello. I'm currently working on a site for teaching nes romhacking to novices. I have tons of information on my draft. The problem is novice level of this guide. I need to make it is as clear for understanding as possible so I can move forward to more advanced articles, considering the reader will be absolutely ready for it. But at the same time I need to make sure he won't recieve lots of unnecessary data for his level and won't lose interest because it was too hard for him. The novice level will contain information about bytes, bits, fceux, opcodes, and other articles that are useful for novices. The next level is joysticks, then graphics, then other hardcore stuff.

Basically I need to figure out exactly what my table of content should be. In which order should I explain opcodes, so I can make better and more interesting examples of more complex and useful codes? Should I explain all existing opcodes before moving to address search and how to start making your own small hacks, or should I do it simultaneously? What games do you think are easy enough to make hacks from for demonstration, like battle city? Should I explain bits right from the start, or wait before my reader moves on to joysticks articles, and also talk about bit opcodes here, not on novice level? And so on and so on.

I would also like to hear from you, especially from novice romhackers, what topics are most difficult for you to understand, what problems you are currently facing, etc. If you have some ideas for the site, don't hesitate to tell. The more info I get, the better. However I'm not a html/css programmer, so don't expect anything flashy. I am more concern about content than how it looks.

I am native russian, so my priority is russian articles, which I will translate to english later if anyone has a need for it. I think I will do it anyway, but I better have more reasons to do so.

If you have read this far, I want to share my personal opcodes list, which some of fceux users may find useful. It contains several opcodes from a modified emulator, don't mind them.
http://s000.tinyupload.com/index.php?file_id=00792595691906824018

Chicken Knife

  • Full Member
  • ***
  • Posts: 207
    • View Profile
Re: NES Romhacking Guide
« Reply #1 on: February 24, 2019, 09:06:42 am »
Hello! Thanks for doing this. I only started hacking last August of 2018 so I consider myself somewhat of a notice. I've been working on Delocalized versions of the NES Dragon Quest games and have been lucky enough to have had a lot of help and guidance, first and foremost by abw who is a great teacher. I'll give you the order that I've been learning things as well as the major pain points I experienced.

I only started this because I happened to watch a video on youtube of hacking Super Mario bros. graphics with tile layer pro. I thought to myself: I can probably uncensor some of the Dragon Warrior sprites now that have been bugging me forever. When I accomplished that, the only confusion initially was learning to adjust with the plus and minus keys to make the sprite tiles appear clearly with certain games.

Then I found someone made a script editing tool for Dragon Warrior 1 and I started removing medieval English out of the script. It was easy to use but didn't allow for expansions to any individual lines of text. I essentially rewrote the script of Dragon Warrior 1 with those limitations based on a translation document online. I also at that point learned to use a hex editor to change names on item/monster/spell name lists. That wasn't too difficult but I did experience pain around calculating pointers. The concepts of ROM address versus RAM address was extremely overwhelming for me and I had great difficulty learning it. Someone gave me a simple little formula for calculating pointers but I didn't actually understand how bank loading worked until much later.

After that I wanted to retranslate Dragon Warrior 2 but I couldn't just load a table file and do it within a hex editor as originally planned because of a script compression formula. Luckily abw came to the rescue with his abcde software and lots of hands on guidance. If it wasn't for him I don't think I would have learned how to set up a bit based table file or even learn the complex details around setting up extractions and insertions. That was a long painful process but now I'm mostly comfortable with it. There weren't any good guides available and the product documentation was far too dense for me to understand. I find a lot of documentation is written for people who already have a high level of vocabulary and understanding and I was totally lost reading it. Abw really had to break it down for me. After I did the script for DW2 the right way, I went back and set up extraction and insertion for DW1 because there were too many compromises by my former approach.

In the midst of doing all that I gathered a legit translation team together and the quality of our work has skyrocketed. I still feel handicapped as the main hacker in the group but I'm trying my best to push forward and learn trace logging / debugging. This is another issue where I find available documentation is far too dense for me to get much out of. I have found a youtube video which is somewhat helpful but abw is currently helping me with this as well. I'm trying to solve a simple task with trace logging at the moment but I have an ambition to learn how to do much more complex things with it like change where graphic tiles are stored alter where the code pulls them from. I also want to not just change color palettes but reassign specific sprites to different existing palettes. Hopefully trace logging / debugging will help me accomplish those. I know for some of these things I need to understand some basic ASM so I tried taking online courses in learning the language. They would all start off intelligible to me and then become far too dense far too fast.

Many people have recommended NES.dev on numerous occasions but I personally feel those resources are only good for people of an intermediate to advance knowledge. For the longest time it was pure gobbledygook and I'm only getting to the point now where I'm getting something out of it.

My main advice is to be very clear with your definitions of words and use a lot of plain non-tech speech to constantly try to add clarity to the concepts you are discussing.
« Last Edit: February 24, 2019, 09:12:12 am by Chicken Knife »

werewolfslayr925

  • Full Member
  • ***
  • Posts: 103
    • View Profile
Re: NES Romhacking Guide
« Reply #2 on: February 24, 2019, 12:20:12 pm »
For the longest time it was pure gobbledygook and I'm only getting to the point now where I'm getting something out of it.

My main advice is to be very clear with your definitions of words and use a lot of plain non-tech speech to constantly try to add clarity to the concepts you are discussing.

This.

I'm usually able to grasp stuff pretty easily, but I've yet to meet someone who has been able to offer a holistic paradigm for NES programming, much less programming in general. People usually just give examples of "do this to get that" which is as useless as teaching algebra or calculus without teaching formulas or thoroughly explaining why x results in y. Start at the most fundamental knowledge you have about the NES, even if it means talking about hardware and how it interacts. Assume that your audience has never even seen a computer. That may seem ridiculous or drastic or dramatic, but it will help your audience immensely and offer them no reason to do research elsewhere.

Also, thank you for doing this :D
As the harbor is welcome to the sailor, so is the last line to the scribe.

- complaint in the margin of a medieval manuscript

Cyneprepou4uk

  • Jr. Member
  • **
  • Posts: 19
    • View Profile
Re: NES Romhacking Guide
« Reply #3 on: February 26, 2019, 05:33:51 am »
Thank you for your replies, I'll take them into account.

Chicken Knife, I'd like to ask you a few more questions.
- what is that formula for calculating pointers?
- tell more about those asm online courses
- give some examples of paragraphs from nesdev articles you were looking for that you don't understand
- can you list opcodes that you don't understand? Or list those which you already fully understand. I don't know which of those have less quanity :D

werewolfslayr925, why do you think it's important for a novice romhacker to know such deep fundamentals? Do you mean some technical stuff like how pins are connected on the real nes?
For example I have no idea where the hell accumulator register is located on the cpu or whatever, but it doesn't prevent me from abusing it any way I want to.

Gyroballer

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
Re: NES Romhacking Guide
« Reply #4 on: February 26, 2019, 06:51:20 pm »
Hey there. I recently translated DBZ II for the Famicom and I've been having trouble with DB3 Gokuuden locating text that isn't just out there in the open for me (aka uncompressed, not split up, etc.).

I've been trying to follow this guide:
http://archive.rpgclassics.com/subsites/twit/docs/text/

But I can't fully grasp what's going on. Again, I can find dialogue text if it's not compressed, I can figure out how to switch pointers to gain some more space, I can mess with the graphics to help myself as well, but I have a lot of trouble figuring out practically anything with ASM, even though that tutorial does make sense to me, by and large.

It's when I go try to apply it elsewhere that it seems it doesn't help me, especially if it's not that simple (like the text just being there).

Here's my latest post where I was having issues:
http://www.romhacking.net/forum/index.php?topic=27997.msg371632#msg371632

Cyneprepou4uk

  • Jr. Member
  • **
  • Posts: 19
    • View Profile
Re: NES Romhacking Guide
« Reply #5 on: March 08, 2019, 08:06:48 am »
Thanks for reply. Not a bad guide