Hello,
I'm currently implementing varvara's screen in Dusk OS and I'm confused by
this part of screen.c:
dx = (d->dat[0x6] & 0x01) << 3;
dy = (d->dat[0x6] & 0x02) << 2;
[...]
screen_blit(&uxn_screen, layer, x + dy * i, y + dx * i, [...]
So, dx is properly set to 8 when the X auto flag is set, dy is also set to 8
when the Y auto flag is set... but dx is applied to y and dy is applied to x.
Even more puzzling is that examples roms seem to... go along with it and use
inverted X/Y auto flag for sprites (because for pixels, the behavior is
correct).
Am I missing something? Did I misread documentation? I'd submit a patch, but it
would probably break a whole lot of existing programs.
I tried to search the mailing list for this subject but didn't find anything.
Regards,
Virgil
Ah! yes, it's kind of odd. I should really make a sort of illustration
that explains this one.
So, imagine a single sprite(8x8 pixels), with auto-x, would move to
the tile at its right. Now imagine we do the same thing with auto-x,
but with a size value in the high nibble of 3(#21).
https://assets.merveilles.town/media_attachments/files/109/536/783/001/064/529/original/8cd98831ab435b8c.png
We'd move to its right, but we're painting 3 extra tiles vertically each time.
Does that make sense?
On Sun, Dec 18, 2022, at 4:28 PM, Hundred Rabbits wrote:
> I meant to write (#31) in there, sorry.>> I have also found a graphics for the NeoGeo that explains this somewhat:>> https://wiki.neogeodev.org/images/e/e7/Mutnatsprite.png
Oh, I get it now, thanks. It would indeed help to at least mention that auto x/y
are inverted in the "length" loop, but it would be even better with an image
such as the one you've just linked. It helps a lot.
Regards,
Virgil