03-31-2010, 07:54 AM
This issues a warning: "Test.bas:22: warning: Redundant operation ABS for unsigned value"
Surely if a Byte is signed, then (Byte-Byte) is signed as well?
Is this an internal issue, or is it me doing something wrong, and I should be casting, here?
(I know poking the routine with fspDataStart is a bad idea - I needed label to be able to make this compile on its own to demonstrate the query - I'm not really writing horrifically wrong self-modifying code!)
Surely if a Byte is signed, then (Byte-Byte) is signed as well?
Is this an internal issue, or is it me doing something wrong, and I should be casting, here?
(I know poking the routine with fspDataStart is a bad idea - I needed label to be able to make this compile on its own to demonstrate the query - I'm not really writing horrifically wrong self-modifying code!)
Code:
fspDataStart:
SUB fspCollisionCheck()
dim sprite as uInteger
dim xCoords(3) as Byte
dim yCoords(3) as Byte
dim i,j as uByte
let sprite=@fspDataStart
for i=0 to 3
if (PEEK sprite) mod 2 =1 then:
let xCoords(i)=PEEK (sprite+2)
let yCoords(i)=PEEK (sprite+2)
poke sprite,1
end if
let sprite=sprite+43
next i
let sprite=@fspDataStart
for i=0 to 2
for j=i+1 to 3
if ABS (xCoords(i)-xCoords(j)) < 2 AND ABS (yCoords(i)<yCoords(j)) <2 THEN poke (sprite+43*i), PEEK (sprite+43*i) + ((1 SHL i) SHL (j-i)) : END IF
next j
next i
END SUB