Re: [stella] single digit scoring...

Subject: Re: [stella] single digit scoring...
From: KirkIsrael@xxxxxxxxxxxxx
Date: 26 Aug 2003 02:27:52 -0000
Thanks for all your help so far...I got it working, but the hacking
to get the display quite right alarms me.  And when I tried to make it 
less hacky, I had some odd results, maybe someone wants to look, it's 
kind of intruguing.

I find that Erik's line
    LDA (pointerP0ScoreOffset), Y
won't assemble... "Illegal Addressing mode" for that line, alas

So Chris's suggestion seemed to be the next best match for my 
thinking. Except since it requires a dedicated register for the 
memory offset, and I want to draw two scores, I decided to just
do a single nonlooping "5 line kernal".

You can get the full source and a binary at 
http://alienbill.com/joustpong , final entry at the bottom.

I made it so every time you hit the button, both player's
score advance, so you can see all 10 digits.

The relevant (I think! ;-) lines are:

;early on...do I still need to have 2 bytes for each of these?
pointerP0ScoreOffset = $92
pointerP1ScoreOffset = $94

;
; in the vblank...
;

;--------------------------------------
;CALCULATE SCORE POINTERS
;--------------------------------------



	LDA p0score ;accumulator = score
	ASL ;accumulator = score * 2
	ASL ;accumulator = score * 4
	ADC p0score  ;accumulator = (score * 4) + score = score * 5
	STA pointerP0ScoreOffset


	LDA p1score ;accumulator = score
	ASL ;accumulator = score * 2
	ASL ;accumulator = score * 4
	ADC p1score  ;accumulator = (score * 4) + score = score * 5
	STA pointerP1ScoreOffset	



;;;;;;;;;;;;;;then at the top of the kernal:
;--------------------------------------
;SCORE DISPLAY KERNAL
;--------------------------------------


	STA WSYNC

	LDX pointerP0ScoreOffset
	LDY pointerP1ScoreOffset


	INX
	INX
	INX
	INX

	INY
	INY
	INY
	INY


	STA WSYNC
	LDA Score0Graphic,X
	STA GRP0
       	LDA Score0Graphic,Y
	STA GRP1
	DEY
	DEX

	STA WSYNC
	LDA Score0Graphic,X
	STA GRP0
       	LDA Score0Graphic,Y
	STA GRP1
	DEY
	DEX

	STA WSYNC
	LDA Score0Graphic,X
	STA GRP0
       	LDA Score0Graphic,Y
	STA GRP1
	DEY
	DEX

	STA WSYNC
	LDA Score0Graphic,X
	STA GRP0
       	LDA Score0Graphic,Y
	STA GRP1
	DEY
	DEX

	STA WSYNC
	LDA Score0Graphic,X
	STA GRP0
       	LDA Score0Graphic,Y
	STA GRP1
	DEY
	DEX

	STA WSYNC
	LDA Score0Graphic,X
	STA GRP0
       	LDA Score0Graphic,Y
	STA GRP1
	DEY
	DEX

	
	LDA #0
	STA GRP0
	STA GRP1
	
	STA WSYNC
	STA WSYNC
	STA WSYNC
	STA WSYNC

	;flip p1 before game kernal

	LDA #%00001000
	STA REFP1


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I think I'm playing way too fast and lose with the time or something...
because when I tried to remove all the INX and INY and use 
Score0Graphic+4 instead, it more or less worked fine, EXCEPT the left 
most pixel of only the "0" digit was missing!  Which doesn't make
any kind of intuitive sense to me.

Oy, anyway, I'm happy to see it more or less working, 
I welcome any suggestions for tweaks to it. (I'm probably not going 
to start down a totally different path if I can avoid it.)


Also, Z26 reports a pretty steady 242 scanlines...that's too few, innit?
Hrrm.

Thanks for your help! You guys are such a supportive bunch for 
blunderers like me....

-Kirk
-- 
"My mind is especially empty today."
    --goofy looking buddhist monk to second monk, New Yorker cartoon 

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


Current Thread