Views: 240,506,940Time: 2013-06-19 01:59:48 AM 9 users online: Akireyano, Catobat, CerberusYoshi, cstutor89, Everest, Flame8765, Pokeymeister80, Torchkas, yoshicookiezeus - Guests: 29 - Bots: 25 Users: 23,082 (1,328 active)Latest: JuanK Paniagua
 Tip: Avoid blind jumps. If the player has to jump down a random hole to proceed with no indication at all that they can go down there, you've done something wrong!
What are the values to mean? (Custom Sprite Clippings)
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - What are the values to mean? (Custom Sprite Clippings)
 Pages: 1
All the values follows: X displacement, Y displacement, width, height

Let's say I had these values:
db \$00,\$F0,\$14,\$20\ set 1 facing right
db \$FC,\$F0,\$14,\$20/ set 1 facing left
db \$04,\$F0,\$24,\$20\ set 2 facing right
db \$E8,\$F0,\$24,\$20/ set 2 facing left

What do these values mean?
Exactly what they say. By the way, I haven't done ASM in a while, but should those \$ all be #\$....?

So basically you need to know hex for this.

01: To the right 1 pixel
02: right 2 pixels
03: right 3 pixels
...
80: To the left 80 pixels
8A: To the left 79 pixels
...
FF: to the left 1 pixel

Then the last two are just width and height.

I'm PRETTY sure that's all correct...? The bit from 80-FF might be wrong. You can do a little experimenting and find out. There should be a tutorial about this somewhere I thought.
Last edited on 2012-04-10 10:22:26 PM by Maxx.
Nope, they shouldn't be #\$'s. It's simply inserting a direct value, so the assembler doesn't need the # sign.
Last edited on 2012-04-10 10:30:54 PM by MarioEdit.
For more detail on negative numbers, they are done using two's complements, which basically means the negative value is the positive number with all it's bit's flipped with one added to it. So \$01 flipped is \$FE plus one is \$FF, and \$FF flipped is \$00 plus one is \$01. I think that's how it works anyway.

If finding the two's complement is too much of a pain, you can also use 0-\$whatever and the assembler will automatically figure out the right value for you.
Last edited on 2012-04-12 08:05:14 PM by KilloZapit.
\$00-\$7F are positive values while \$80-\$FF are negative values (opposites obviously).

Also, to correct Maxx:

\$01 -> 1 pixel right
\$10 -> 16 pixels right
\$40 -> 64 pixels right
\$7F -> 127 pixels right (nobody really needs that much)
\$80 -> 127 pixels left (same as above)
\$C0 -> 64 pixels left
\$F0 -> 16 pixels left
\$FF -> 1 pixel left
Originally posted by Ice Man
\$80 -> 127 pixels left (same as above)

Correction: 128 pixels left.
Proof: What would \$81 be if \$80 was 127? What would \$82 be? What would \$FF be?
Actual reason: there isn't two \$00's. \$00-\$7F is 128 and \$80-\$FF is 128.
 Pages: 1
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - What are the values to mean? (Custom Sprite Clippings)

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.