Originally posted by: Cockroachcharlie
Originally posted by: user
Originally posted by: Cockroachcharlie
Why do the offsets for each metasprite increase by ten when the metasprites themselves are four apiece. I assume this has to do with the total memory of each.
16px wide == 10 in HEX
Hope this helps.
... ..... ....... .........I feel really dumb now. :-)
You should not.
Actually, my answer is correct, but it was the answer to another question.
In the X position of two metasprites 16x16px next to eachother, the offset is 16px, hance 10 in HEX.
In the Y position of two metasprites 16x16px adjacent vertically, the offset is 16px, hance 10 in HEX.
However, this was not the offset you were asking about.
Still, it is an offset of 16, which is 10 HEX.
Let say that, as the MRN article proposes, you use RAM page $0200 for sprites.
Each metasprite is made of four (4) 8x8px sprites: UpL UpR BottomL BottomR.
Each of these four (4) sprites has four (4) bytes of info:
1. (address +0) Y position
2. (address +1) pattern
3. (address +2) attributes
4. (address +3) X position
Let say the metasprite "Foo" starts at address $0200, and is composed by the following four (4) 8x8px sprites: spriteUL, sprite UR, sprite BL, sprite BR.
$0200 = Y position spriteUL
$0201 = pattern spriteUL
$0202 = attributes spriteUL
$0203 = X position spriteUL
$0204 = Y position spriteUR
$0205 = pattern spriteUR
$0206 = attributes spriteUR
$0207 = X position spriteUR
$0208 = Y position spriteBL
$0209 = pattern spriteBL
$020a = attributes spriteBL
$020b = X position spriteBL
$020c = Y position spriteBR
$020d = pattern spriteBR
$020e = attributes spriteBR
$020f = X position spriteBR
As you can see, there are (4x4) 16 Bytes of info (from RAM address $0200 to $020f, both included) describing the 16x16px metasprite "Foo".
Where the next metasprite will start? At address $0210, with an offset of 16 Bytes, HEX 10, from address $0200.
I think now that this is the offset you were referring to in your question.
My apologies for giving a quick answer without understanding what the question was about, I hope this helps some more.
By the way, if you wonder:
- There are 256 Bytes to store sprites data.
- Which makes 64 total (8x8px) sprites (four (4) Bytes each sprite: Yposition, pattern, attributes, X position).
- Which makes 16 total (16x16px) metasprites available, if your game uses only 16x16 pixel metasprites (four (4) 8x8px sprites are used for each metasprite, hence 64/4).
Also (and sorry for my lacks in English) I hope this answer is correct, makes sense and is understandable.
And if by now you had everything understood already, sorry for the redundancy of this further reply.
Edit: formatting.