[stella] need 1 cycle

Subject: [stella] need 1 cycle
From: Glenn Saunders <mos6507@xxxxxxxxx>
Date: Sat, 20 Aug 2005 19:36:42 -0400
I'm having a hard time finishing up modifications to
Thomas' 3x2 multicolored score.  I tried integrating
this into Death Derby once before and gave up, and
rationalized it at the time but inside I really wanted
to use it.  So I've gone back to it.  This time I'm
having much more luck in customizing it.

(BTW, the gear indicator is going to be tough because
there is no time to rewrite the playfield graphics
between the left and right half of the screen.  I may
try dropping a black missile over part of the
playfield or just have the score blink when you are in
reverse.  I don't want to use any space above or below
the score in order to maximize the main play area.)

Anyway, first thing I did in this second attempt is
altered the font a bit so it's a little closer to what
I think Death Race looks like.  (A little less
7-segment-like) This ate up a bit more ROM because I
can't use the same level of shape reuse in the tables.
 I think it's worth it.

Then I managed to change the kernel to load the player
colors (actually using the playfield) from RAM.  That
way the color B&W switch will work.  After getting the
P0 color working, I ran out of cycles until I tried
randomly commenting stuff out.  This helped me
discover one extraneous instruction at the bottom that
freed up 3 cycles otherwise making the two scores'
color dynamic would not have been possible.

The only limitation is that the timer display has to
remain a load-immediate, and that means I would be
stuck with using straight white there so I don't have
to change colors in B&W mode.  It's not a tragedy, but
I wanted the timer to be blue in color mode because
there is so little color in the game as it is.

I've gotten REALLY close to enabling RAM color for the
timer, but I'm left with a sensitive GRP1 write that
is the last instruction at the end of the scanline.
Unfortunately I have nowhere else to shove a .w into
to pad it by 1 cycle.  The write happens too late
under certain circumstances, like crossing a page
boundary or something, and I'm losing a little bit of
the tens digit on the P1 score.

Before I settle on the white timer display, I'm
opening this up to the list to see if a solution can
be found.

(I could always branch into two separate kernels, one
for color and one for B&W, but I don't think that
would be worth the ROM space just to make the timer be
blue in color mode.)

I'm including the source of both versions. version 2
has the load-immediate for a static white timer.
version 3 loads the timer color from RAM but winds up
pushing the GRP1 write 1 cycle too late.  Here is the
problematic section:

Don't trust these cycle counts anymore.


.loopScore:
    lax     (ptrScore+10),y     ; 5
    txs                         ; 2
    lax     (ptrScore+ 4),y     ; 5

    lda     Car0_Color          ; 3
    sta     COLUPF              ; 3     @07
    lda     (ptrScore+ 0),y     ; 5
    sta     GRP0                ; 3     @15
    lda     (ptrScore+ 6),y     ; 5
    sta     GRP1                ; 3     @23

    lda     (ptrScore+ 2),y     ; 5
    sta     GRP0                ; 3     @31
    lda     (ptrScore+ 8),y     ; 5
    sta     GRP1                ; 3     @39


    lda   Timer_Color;#$0f;Timer_Color         ; 2

    stx   GRP0                ; 3     @47
    sta   COLUPF              ; 3     @44

    lda    Car1_Color;#$dc                ; 2

    sta    COLUPF              ; 3     @57
  tsx ; 2


    ;happening one cycle too late!!
    stx.w     GRP1                ; 3     @54



;    SLEEP 2

    ;sta     GRP0                ; 3
    ;sleep 2
    dey                         ; 2
    bpl     .loopScore          ; 23






____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs

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

[demime 1.01d removed an attachment of type application/x-zip which had a name of score3x2.zip]

Current Thread