Re: [stella] subpixel joustpong

Subject: Re: [stella] subpixel joustpong
From: "Andrew Davie" <atari2600@xxxxxxxxxxxxx>
Date: Tue, 3 Feb 2004 21:36:57 +1100
> If you want to play with the physics numbers yourself,
> I made a javascript tool to convert decimal numbers into
> binary, since figuring the two's complement stuff was getting
> to be a serious pain, you can see and use that at
> http://kisrael.com/viewblog.cgi?date=2004.02.03
> (oops, I just noticed that Window's calculator now lets
> you do some kind of specification of how many bytes...
> well, it still seems fiddley to use. and the javascript thing was kind
> of fun to slap togehter.)


Nice, but un-necessary.  Let the assembler do the work....

    lda #<NUMBER
    sta var
    lda #>NUMBER
    sta var+1

Now set NUMBER to whatever you want.  The two-byte variable "var" will hold
the low byte (in var) and the high byte (in var+1).  But what about negative
numbers in two's complement form?  The assembler automatically does it!

NUMBER = -2984

    lda #<NUMBER
    sta var
    lda #>NUMBER
    sta var+1

voila!  I'm not even going to check it -- trust me.  Oh, yea of little
faith!

By the way, to negate numbers (single byte)...

    clc
    lda var
    eor #$FF
    adc #1
    sta var

or, for two-byte negation, easiest is to subtract the number from 0

    sec
    lda #0
    sbc var
    sta var
    lda #0
    sbc var+1
    sta var+1

Subpixel joustpong is looking much better, but i think the gravity should be
roughly 4x as strong, and the flapping should be about 1/4 of the power.  So
you really have to flap to keep your position, and going up is major flap
time.

One other thing... had a brief look at your code.

Instead of..

NUMBER = #8

it's more standard to just go

NUMBER = 8

Cheers
A


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


Current Thread