Page 1 of 1
Some questions about SNES collision
Posted: Fri Dec 23, 2016 2:48 pm
by ittyBittyByte
Is SNES collision hardware based (I once heard a lot of old consoles/computers used collision stuff built into the hardware) or does every game implement it differently? Is AABB common or are different types of bounding boxes usually used? I'm mainly talking about platformers e.g. Super Mario World, Mega Man X, Super Metroid etc. and how is it that when I forcibly teleport a character into a wall they almost alwayts pop back out into the correct spot?
Re: Some questions about SNES collision
Posted: Fri Dec 23, 2016 3:12 pm
by dougeff
Software handles collision.
Feel free to disassemble / trace these games yourself. I'd love to know if there is differences.
Re: Some questions about SNES collision
Posted: Fri Dec 23, 2016 3:59 pm
by ittyBittyByte
I would really like to but 65816 is gibberish to me right now I can't imagine myself understanding a decent amount it anytime soon. Hopefully within the next 5 or 6 months if I'm lucky.
Re: Some questions about SNES collision
Posted: Fri Dec 23, 2016 4:48 pm
by dougeff
What kind of game do you want to make?
I really think us SNES 'newbs' should collaborate more.
Re: Some questions about SNES collision
Posted: Fri Dec 23, 2016 4:58 pm
by Drew Sebastino
dougeff wrote:I really think us SNES 'newbs' should collaborate more.
Where do I stand?

Re: Some questions about SNES collision
Posted: Fri Dec 23, 2016 5:06 pm
by ittyBittyByte
dougeff wrote:What kind of game do you want to make?
I really think us SNES 'newbs' should collaborate more.
My aim isn't to make a game (at least not yet) but to reverse engineer, understand, and hack Mega Man X.
Re: Some questions about SNES collision
Posted: Fri Dec 23, 2016 5:44 pm
by tomaitheous
Espozo wrote:dougeff wrote:I really think us SNES 'newbs' should collaborate more.
Where do I stand?

In a world of your own making

Re: Some questions about SNES collision
Posted: Fri Dec 23, 2016 6:50 pm
by koitsu
ittyBittyByte wrote:My aim isn't to make a game (at least not yet) but to reverse engineer, understand, and hack Mega Man X.
Then your continual avoidance of 65816 will put an end to your aim/goal. You are going to have to learn assembly and put in the many, many hours reverse-engineering something to get an answer to all your questions. Not harping on you, just saying several of your posts look for "the easy way out", and there is no such way.
Re: Some questions about SNES collision
Posted: Sat Dec 24, 2016 11:03 am
by Khaz
Have to agree with koitsu... If you want to understand the program, you're going to have to read it at some point. I know 65816 and SNES have a pretty steep learning curve off the start, largely because good resources on it are hard to find.
This might help, it's a full blown official manual on the 65816, but it's also massive. At the least you should be able to look up different opcodes and addressing modes and learn what exactly they do. I refer to
this page a lot as a quick reference for details of each instruction. Mostly, which forms of each instruction exist (you can STZ using X as an index but not Y, for example) and which flags they affect.
The other main thing you'll need to understand to read SNES code once you have the 65816 instruction set down is the hardware registers. I've always referred to a very old text file I found somewhere around here for that. I don't know where to find it anymore so I've attached it here. If you see code reading/writing to addresses in the $2000s or $4000s, it's likely it's one of these registers. (But you have to be aware what bank you're currently in, as these registers only exist in banks $00 through $3F.)
This page gives you the entire memory map for the SNES, but it is understandably confusing at first glance. LoROM is the most common format I think, but I don't know if Megaman is.
As for how collision detection is done,
this page might provide some basic insight on different approaches to it that some games have taken, including megaman. Might help give some idea how to find what you're looking for.
Hopefully that should help you get started. It's rough at first but once you begin to understand it's easy from there.
Re: Some questions about SNES collision
Posted: Sat Dec 24, 2016 4:37 pm
by koitsu
Khaz wrote:... I've always referred to a very old text file I found somewhere around here for that. I don't know where to find it anymore so I've attached it here. ...
What you've attached is part of my old SNES documentation. The last release was in a file called sndoc230.lzh or sndoc230.zip, which you can find
here. (I'm Y0SHi/Yoshi; I've changed monikers a couple times since then)
It's "sufficient" for basic learning, but does get many things wrong. You can refer to
Anomie's docs,
no$sns docs, the wiki you referenced, or official documentation (send me a PM) for the rest of the nitty-gritty.