[stella] signed 8-bit comparisons?

Subject: [stella] signed 8-bit comparisons?
From: KirkIsrael@xxxxxxxxxxxxx
Date: 4 Mar 2004 05:44:43 -0000
For some reason, comparisons (and math in general) have
always been my downfall in 6502/6507 land, and now I just 
realized I've been doing unsiged comparisons, and the signed 
comparison I need is going to be even tougher.

I'm using a 6502 emulator to work this out. I think the 
follow would generally work if I wasn't dealing w/ any negative values:
(var is the value, set to MIN or MAX if it exceeds that value)

	*= $600
var = $0000
MAX = 3
MIN = -3
	LDA #-4 ; initial value
	STA var

	LDA #MAX
	cmp var
	BCS DoneSetToMax
	LDA #MAX
	STA var
DoneSetToMax


	lda #MIN
	clc
	cmp var
	bcs DoneSetToMin
	LDA #MIN
	STA var
DoneSetToMin
	BRK

In case people are wondering, I'm finally (a week from 
my self-imposedish PC5 deadline) getting around to using "fractional"
positioning for the ball vertical speed.  Initial results were
fairly promising, with the ball vert. being the speed of the player
who hit it, but I was getting some overflowish problem or 
something where the ball was wrapping past the floor to 
and coming out of the ceiling, which I think was partially
tied in with it moving too fast.

Thanks for any help w/ the signed comparison!

-Kirk

-- 
KirkIsrael@xxxxxxxxxxxxx    http://kisrael.com
"If you feel it, but it isn't right, don't do it and don't 
 believe it. We can be better than natural -- we're human."--Penn Jillette


----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread