Re: A83: Can you check this code:


[Prev][Next][Index][Thread]

Re: A83: Can you check this code:




Hey, I have an idea for bouncing routines in ASM:

Now, I'm sure that at least a lot of you know how to do it in BASIC:
have an inc var that inc's the X-loc, say, until it hits a wall, then the 
inc-var inverses (so instead of X+I (I is the inc var) and I is 1 
(therefore X+1) it is X+(-1), or X-1, thusly the object wil go the other 
way and appear to 'bounce' yadda,yadda)
Now, I think that there is a way to do it this way in ASM:
have ya'll heard of the NEG command?  I read up on it somewhere that what 
it actually does is not actually making a negative number, but 
subtracting it from 255 (or 256, whatever).  Like so:
a = 5
b = 10
a + b = 15 (duh...)
now, if you NEG A:
a = 250
b = 10
a + b = 5 (250 + 10 = 260, but because of overflow, carries over to add 
to zero: 260-255=5...)

See?  Now, thise should work, applying the BASIC routine to ASM and the 
NEG func...  I have WAY too much HW to mess with it myself, but if anyone 
can get it to work, please tell me!

		-Dimitri
 


References: