[stella] single digit scoring...

Subject: [stella] single digit scoring...
From: KirkIsrael@xxxxxxxxxxxxx
Date: 24 Aug 2003 22:31:14 -0000
Hey, I know this is really retarded, but I'm having trouble doing 
a single digit scoring routing...

I have the digits 0-9 like this

        .byte #%00111100
        .byte #%01000010
        .byte #%01000010
        .byte #%01000010
        .byte #%00111100
        .byte #%00111110
        .byte #%00001000
        .byte #%00001000
        .byte #%00101000
        .byte #%00011000

I know 5 is kind of an odd number,
I tried for 4 but couldn't make it look good, and it seems wasteful
to pad it to 8

I decided that the score display was going to be a seperate kernal,
above the main action.  But my overwhelming ignorance about memory 
deferencing is killing me here.

I think the basic idea is pretty simple:
for each scanline, the piece of score to display is at

Y (holding scanline) + (5 * playerscore) + startofscoresinmemory

(hmm, actually maybe I should compute
(5 * playerscore) + startofscoresinmemory
during the VBLANK and then just add the scanline to that?

Anyway, this is the bit I came up with:

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

;...P1 etc goes here, along with two WSYNCs

	BNE ScoreDisplayLoop	

Ugh, I know that's pretty badly broken, I'm not derefrencing right 
at all. Plus, I probably really should compute most of that before
hand, and then look to that computed value plus the scan line count...

Also, 2 more questions:
* what emulator supports showing the scan line count? how do you do it?
* how can I find out how much of the 4K I'm actually using?

Anyway, http://alienbill.com/joustpong/ has the result of today's
labor...it's pretty  cool, I made the 2nd player controlled by the 
computer, so it's actually cool to play as a game right now.  

Thanks for all your help!

KirkIsrael@xxxxxxxxxxxxx    http://kisrael.com
 "Oh, you hate your job? Why didn't you say so? There's a support group for 
  that. It's called EVERYBODY, and they meet at the bar." --Drew Carey

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

Current Thread