Please login or register.

Login with username, password and session length
Advanced search  

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!

Pages: [1]
Angel of Darkness
RavenCurow [Posts: 44]
  • View Profile
  • share
  • [April 14, 2018, 12:20:39 PM]
Trying to figure out an asm formula
« on: April 14, 2018, 12:20:39 PM »
So I'm trying to figure out this asm formula to get the status on the formula and I can't seem to figure the math. So I set x to 27 and that gives me the status block that looks like this

   0x80 -
   0x40 - Crystal
   0x20 - Dead
   0x10 - Undead
   0x08 - Charging
   0x04 - Jump
   0x02 - Defending
   0x01 - Performing

Now the status that gets added is the Y value and so you plug that number in. Where it gets complicated is that Y will add multiple statuses to the formula because it adds the statuses together. For example if I put in 1 I'll get performing. 2 will get defending. But 3 will get both defending and performing. Now I want to just have Undead, but putting in 10 will of course get me defending and charging. So I'm not exactly sure what number to use to get what I need.

Edit: After much trial and error I came upon the correct number which is 16. I'm still not quite sure why that number is correct. The only reason I made a guess at it is because all of the statuses before it combine to 15 so I tried 16 which I figured was just as likely to get me Undead, jump, and defending.
« Last Edit: April 14, 2018, 12:54:32 PM by RavenCurow »
    • Modding version: PSX
  • Ramza: Delita, your hurt?
    Delita: No, really? Did you think I was taking a nap down here?
    Glain [Posts: 482]
    • View Profile
    • share
    • [April 14, 2018, 11:00:26 PM]
    Re: Trying to figure out an asm formula
    « Reply #1 on: April 14, 2018, 11:00:26 PM »
    The 0x prefix designates a hexadecimal (base 16) number.  Place value is based on 16, not 10.  0x10 = 16 * 1 + 0 = 16.
    Each number is double the previous, and represents a different bit inside the status byte.
    Angel of Darkness
    RavenCurow [Posts: 44]
    • View Profile
    • share
    • [April 15, 2018, 09:47:35 PM]
    Re: Trying to figure out an asm formula
    « Reply #2 on: April 15, 2018, 09:47:35 PM »
    Oh okay. I was thinking 0x10 was A lol. Shows how much I've picked up. Thanks for explaining that.

    • Modding version: PSX
  • Ramza: Delita, your hurt?
    Delita: No, really? Did you think I was taking a nap down here?
    Pages: [1]