News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

I want to actually learn this stuff.

Started by Draconis Kenjishiya, February 18, 2016, 01:56:08 PM

Previous topic - Next topic

Draconis Kenjishiya

I'm not entirely sure where to post this. What I'd really like to change in a patch, what I think would work well for my romhack, is probably doable in about five minutes by the programmers here. I don't want to just ask someone to do it for me. I've done it in the past and it's really gotten me nowhere in understanding how the game works, how to put it together, how to change its behavior, et cetera. So, how do I learn SNES assembly? I've found a couple of tutorials on Google, but they've just sort of introduced me to terms and such and I don't know where to even begin. I know it's a massive process and I can't just flip open a page and suddenly know how to do anything much less everything. But like I said I don't know where to start.

begrimed

Download a .PDF file called "Programming the 65816" (it's like the first result on Google). There's also this archive I threw together with a bunch of general-knowledge SNES ASM stuff that isn't game-specific. G'luck!


personitis

I found that having the RAM Map and this OP code reference open at all times was very useful. Of course, take more time than I did to read up on the doc Grime's posted than I have. :heheh: Understanding other people's code is also a fantastic way to familiarize yourself even more as their code already does what it's suppose to, so you don't have to worry about whether or not it works when you learning. Other than all that, I suggest starting simple and branching out from there.

You also mentioned changing a patch. This can be a bit more involved as you had to apply the patch to make the changes appear first, and then use a disassembler to figure out what changed. Then it's down to understanding how it works and after that, you can apply your newly found knowledge in assembly to make your change(s).

Draconis Kenjishiya

Indeed, that's true. The bare bit of asm I know has been gleamed from changing peoples' patches to suit the exact needs of my hack, as well as from some work with Super Mario World I did like ten years ago. But this one, the one I'm trying to do, I basically sat there, looking at a similar patch, and realized that I didn't even know where to LOOK for information on how to change that. So, I asked how to learn. But that opcode list is really useful.

Quietus

A lot of the stuff above, as well as some follow along lessons, can also be found under 'References' in Scyzer's Tank. :^_^:

herald83

Regarding modifying existing patches, I find this ips to asm converter to be pretty useful: http://www.smwhacking.de/misc/IPS_converter.php

This will dump out all of the bytes that the ips will change. You still need to disassemble that back into compilable asm, but it's a start.

Note that when you tell it "lorom" it assumes you mean the type of lorom that uses $00:8000-$6F:FFFF instead of $80:8000 - $FF:FFFF. Super Metroid is the second type of lorom. It's not a huge deal as long as you're aware of the issue.

Personally, I hate ips patches for all modifications that aren't a playable hack, so I find myself converting all the ips resources I'm interested in over to asm. People have gotten better about this but a lot of the older resources in the patches section are ips only.

Quote58

Quote from: begrimed on February 18, 2016, 01:59:06 PM
Download a .PDF file called "Programming the 65816" (it's like the first result on Google). There's also this archive I threw together with a bunch of general-knowledge SNES ASM stuff that isn't game-specific. G'luck!

Holy shit some of that documentation is interesting grime. I may end up making of this in something I'm working on.........
Anyway, Draconis, here's the thing. Everyone learns differently, and in my opinion there is no one set of documents that will teach you all you need to know to get started it. All I can reference is my own experience, so I'll tell you what worked for me.
I started with the asm tutorials made by scyzer and black falcon, which were......ok. They got me started, but what really helped were 2 things:
1. Talking with someone who already knew assembly, and happened to be a good teacher (in my case this was Black falcon and then later Crashtour)
2. Reading stuff. The document grime mentioned (programming the 65c816) is a giant manual for the processor and if you learn best by reading, this shit has got you covered. If you don't, it's still  a great reference manual for how the processor works. More than that though, was just looking at existing code. That means both disassembling the game's code, and also reading through code made and posted by other people. There's tons of asm patches that can help you understand how to do general stuff by reading and manipulating them until you understand how they work. Then, to see how to make really /clever/ code, check out stuff by scyzer or kejardon. I learned a lot of useful stuff from code they posted.

So, here's my general list of stuff to look at.

Now on top of that, although I'm busy with school I can still answer any questions you have about asm or if you're stuck with one of the lessons (and I like to teach so I'm happy to help haha), so feel free to PM me on the forum. Or come to #cloudirc or #metconst on irc.esper.net and someone there will probably be able to help you.

Draconis Kenjishiya

Alright, awesome. That's quite a comprehensive list. I'll delve into it, and try to learn from messing around with others' patches. Everything I know already has been gleamed from altering patches, but it's very good to have a manual I can consult. Thanks.