It is currently Wed Dec 13, 2017 6:14 am

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Dec 21, 2016 3:22 pm 
Offline

Joined: Sun Dec 18, 2016 1:11 pm
Posts: 22
I was looking through the mega man x RAM and I noticed tons of objects such as enemies and the player are state-based. But the weird thing is how they are used, like, states go 0, 2, 4, 6, 8, 10, 12 etc... not 0, 1, 2, 3, 4, etc... which in my opinion is pretty weird. I tried poking them and setting them to uneven values and every time, it just instantly froze the game.

What I am asking is, could there any actual technical reason for this or is it just completely arbitrary? :|

Please excuse me if any of my questions are dumb or annoying, I'm just trying to learn slowly and ask fro help so I can understand things that I don't understand yet.


Top
 Profile  
 
PostPosted: Wed Dec 21, 2016 3:43 pm 
Offline
User avatar

Joined: Thu Dec 25, 2014 10:26 pm
Posts: 309
Location: Canada
Sounds to me like they have a table of addresses that lead to code for each given "state". If each entry in the table is two bytes long, then having the states increment by two each time eliminates an instruction to multiply by two when using said table. And using an odd number would cause the program to jump to an invalid address which uuuusually crashes right away.


Top
 Profile  
 
PostPosted: Wed Dec 21, 2016 4:00 pm 
Offline

Joined: Sun Dec 18, 2016 1:11 pm
Posts: 22
Makes sense, thanks. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group