Re: [stella] single digit scoring...

Subject: Re: [stella] single digit scoring...
From: Christopher Tumber <christophertumber@xxxxxxxxxx>
Date: Sun, 24 Aug 2003 20:18:55 -0400
Kirk wr0te:

>	LDA p0score ;accumulator = score
>	ROL ;accumulator = score * 2
>	ROL ;accumulator = score * 4
>	CLC
>	ADC p0score  ;accumulator = (score * 4) + score = score * 5
>	CLC
>	ADC Score0Graphic
>	STA GRP0

I think you're trying to do something like this:
(warning: untested code)

	LDA p0score ;accumulator = score
	ROL ;accumulator = score * 2
	ROL ;accumulator = score * 4
	ADC p0score  ;accumulator = (score * 4) + score = score * 5
          TAY
	LDA Score0Graphic,y
	STA GRP0

You want to create an offset but you're loading from an absolute address. What you want to do is:

GRPO=*(p0score*5 + Score0Graphic)

But what you're really doing in your version is:

GRPO=p0score*5 + *Score0Graphic

(I'm using * to indicate a pointer as in C)

This kind of thing is what the X and Y registers are there for, later CPU's allow you to do things more closely resembling true pointers like LDA [Pointer] but the 6502 is more limited (The only such instruction we have is JMP [Pointer])


You also shouldn't need the various CLC's given that the state of the carry should always be clear. In the first case, you ROL will clear the carry (ROLing 9 twice will never produce a carry) and the ADC p0score will also never produce a carry (9*4+9 is your max value)


>* what emulator supports showing the scan line count? how do you do it?

Z26 using the -v9 command line switch.

>* how can I find out how much of the 4K I'm actually using?

When assembling (with DASM) use the -l<filename> switch to generate a list file, then check that file.

Chris...



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


Current Thread