Some questions about SNES collision

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
ittyBittyByte
Posts: 24
Joined: Sun Dec 18, 2016 1:11 pm

Some questions about SNES collision

Post 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?
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Some questions about SNES collision

Post by dougeff »

Software handles collision.

Feel free to disassemble / trace these games yourself. I'd love to know if there is differences.
nesdoug.com -- blog/tutorial on programming for the NES
ittyBittyByte
Posts: 24
Joined: Sun Dec 18, 2016 1:11 pm

Re: Some questions about SNES collision

Post 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.
Last edited by ittyBittyByte on Fri Dec 23, 2016 5:05 pm, edited 1 time in total.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Some questions about SNES collision

Post by dougeff »

What kind of game do you want to make?

I really think us SNES 'newbs' should collaborate more.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: Some questions about SNES collision

Post by Drew Sebastino »

dougeff wrote:I really think us SNES 'newbs' should collaborate more.
Where do I stand? :lol:
ittyBittyByte
Posts: 24
Joined: Sun Dec 18, 2016 1:11 pm

Re: Some questions about SNES collision

Post 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.
tomaitheous
Posts: 592
Joined: Thu Aug 28, 2008 1:17 am
Contact:

Re: Some questions about SNES collision

Post by tomaitheous »

Espozo wrote:
dougeff wrote:I really think us SNES 'newbs' should collaborate more.
Where do I stand? :lol:
In a world of your own making :)
__________________________
http://pcedev.wordpress.com
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Some questions about SNES collision

Post 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.
User avatar
Khaz
Posts: 314
Joined: Thu Dec 25, 2014 10:26 pm
Location: Canada

Re: Some questions about SNES collision

Post 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.
Attachments
Snes1.txt
List of SNES hardware registers and what they do
(47.32 KiB) Downloaded 167 times
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Some questions about SNES collision

Post 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.
Post Reply