| 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  |
|
|
|
| Posted on 2012-04-10 10:08:20 PM |
Link | Quote |
|
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?
|
|
| Posted on 2012-04-10 10:20:44 PM |
Link | Quote |
|
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. |
|
| Posted on 2012-04-10 10:29:22 PM |
Link | Quote |
|
|
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. |
|
| Posted on 2012-04-12 07:56:32 PM |
Link | Quote |
|
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. |
|
| Posted on 2012-04-13 02:14:53 PM |
Link | Quote |
|
$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
|
|
| Posted on 2012-04-13 02:18:51 PM |
Link | Quote |
|
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?
|
|
| Posted on 2012-04-13 02:36:21 PM |
Link | Quote |
|
|
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) |