More questions on this!
With regards to the offsets as minus numbers, how are people storing these?
It seems that with CA65 at least, you would need to convert them in to their positive (2s compliment) equivalent -
After this discussion, I have just attempted to store an (unrelated to NESST) array for a bounce offset of an item* and CA65 throws up range errors if I try and use minus numbers.
So it would seem that the code generated by NESST for metasprites still wouldn't work, as although you could use it in sbc, adc etc, you couldn't store it. Unless I'm missing something? Is there a signed byte size label or equivalent?** Or are people using C and is CC65 converting it for you?
*I'm experimenting with using a flat physics model for my latest game with fixed LUTs for gravity, acceleration, recoil, etc.
** In fact,I quickly tried copying a pasting in a metasprite and NESST auto generated the byte labels and caused the same issues.
Code:
cut and pasted from NESST:
metasprite:
.byte -16,- 8,$00,0
.byte - 8,- 8,$01,0
.byte -16, 0,$10,0
.byte - 8, 0,$11,0
.byte 0, 0,$12,0
.byte -16, 8,$63,0
.byte -16, 16,$73,0
.byte - 8, 8,$64,0
.byte - 8, 16,$74,0
.byte 0, 16,$75,0
.byte 0, 8,$65,0
Errors in the assembler:
twin_ships_asm.s(1721): Error: Range error (-16 not in [0..255])
twin_ships_asm.s(1721): Error: Range error (-8 not in [0..255])
twin_ships_asm.s(1722): Error: Range error (-8 not in [0..255])
twin_ships_asm.s(1722): Error: Range error (-8 not in [0..255])
twin_ships_asm.s(1723): Error: Range error (-16 not in [0..255])
twin_ships_asm.s(1724): Error: Range error (-8 not in [0..255])
twin_ships_asm.s(1726): Error: Range error (-16 not in [0..255])
twin_ships_asm.s(1727): Error: Range error (-16 not in [0..255])
twin_ships_asm.s(1728): Error: Range error (-8 not in [0..255])
twin_ships_asm.s(1729): Error: Range error (-8 not in [0..255])