Jump to content
  • entries
    658
  • comments
    2,707
  • views
    906,831

Reposition Player 0 routines done


The revised Reposition Player 0 routines take 4 scanlines. The routines in the prior version took 6 (5 to reposition, plus 1 to get back into sync with the main kernel loop).

 

This screenshot shows reposition routines P0EarlyHM25, P0EarlyHM30, P0EarlyHM35, ..., P0EarlyHM70 being triggered (the red robots). They also show NUSIZ0 being updated (the red missile).

blogentry-3056-0-84560700-1390870040_thumb.png

 

Unlike player 1, the player 0 routines do not have any late updates. There's also quite a bit of SLEEP going on in the P0EarlyHMxx routines. It might be possible to shrink down to just 3 scanlines, but by using 4 scanlines I was able to set up the datastream usage to be exactly the same as for player 1, which will make the sprite C routines easier to implement.

 

I also added a constant to the source that controls the values in the datastreams. TEST_PLAYER = 0 will test player 0 reposition routines (that's the screenshot above and the ROM at the bottom).

 

TEST_PLAYER = 1 will test player 1 reposition routines.

blogentry-3056-0-28561900-1390870035_thumb.png

 

TEST_PLAYER = 2 (or any value other than 0 and 1) will not reposition the players.

blogentry-3056-0-56742300-1390870028_thumb.png

 

ROM

frantic_20140127.bin

 

Source

Frantic20140127.zip

5 Comments


Recommended Comments

I hear you about keeping the datastreams the same. It also makes it a lot easier to trouble shoot. ;)

 

 

You could change some of those SLEEP 3's to jumps or branches to identical code and save quite a few bytes. For example this code is identical in P0EarlyHM22, P0EarlyHM25, P0EarlyHM30, P0EarlyHM35, P0EarlyHM40, and P0EarlyHM45.

        SLEEP 3                 ; 3 52
        lda #<DS_PF2R           ; 2 54
        sta PF2                 ; 3 57 - PF2R, 50-65
        lda #<DS_PF0L_BL        ; 2 59
        sta PF0                 ; 3 62 - PF0L, after 55
        sta ENABL               ; 3 65 - any, on VDEL
        lda #<DS_PF1L           ; 2 67
        sta PF1                 ; 3 70 - PF1L, 66-28
        sta HMOVE               ; 3 73 - can be on 73 or 74
        lda #<DS_GRP1           ; 2 75 - PLAYER + 3
; start of event + 3, the 4th scanline of reposition player 1        
        sta GRP1                ; 3 78/2        
        lda #<DS_COLUP1         ; 2  4
        sta COLUP1              ; 3  7
        lda #<DS_COLUP0         ; 2  9 - COLOR + 3
        sta NUSIZ0              ; 3 12
        sty ENAM1               ; 3 15
        lda #<DS_EVENT_M0       ; 2 17 - EVENT + 3
        sta ENAM0               ; 3 20
        sta HMP0                ; 3 23 - must be $8x
        jmp Rentry26            ; 3 26

Or is this sleep delay a reserve for something future?

When I rewrite the sprite driver, I'll post a detailed blog entry about how the routines work to minimize flicker.

 

Based on the prior Frantic reboot, there will be 2 more updates before the sprite driver is rewritten: test of X routines and test of playfield updates.

 

The sprite driver rewrite might happen this weekend, though dad returned from Nigeria yesterday so it'll most likely be next week.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...