Jump to content
IGNORED

stella flickers, z26 seems ok


xucaen

Recommended Posts

Hi, I'm playing with playfield registers and doing a simple exercise. When I run this in stella the screen flickers, but it looks OK in z26. Has anyon else noticed differences between these two emulators? Is there something wrong with my code?

 


   processor 6502

   include vcs.h

   include macro.h

   SEG

   org $F000



VarPf = $80



Reset


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  ; Clear RAM and all TIA registers



      ldx #0

      lda #0

Clear  sta 0,x

      inx

      bne Clear

     ;total 9 bytes!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



      ;load test playfield bits

       LDA #%10001000

       STA VarPf

StartOfFrame



      ;/////////////////////////////////////////////////

       VERTICAL_SYNC   

      ;////////////////////////////////////////////////



       ldx #37    ; 37 scanlines of vertical blank...

vblankloop

       sta WSYNC

       dex

       bne vblankloop



       LDA #%00000001

       STA CTRLPF

       LDA #0

       STA VBLANK
;draw the viewable screen



       ldx 192

       LDA VarPf

       LDY #$16

       STY COLUPF

       sta PF0

       sta PF1

       sta PF2

DrawLoop        

       sta WSYNC

       dex

       bne DrawLoop





       LDA #%01000010     ; Disable TIA Output

       STA VBLANK


;overscan


;initialize graphics

       LDA     #$00   ; put $00 in A

       STA WSYNC

       STA     PF0; clear out first playfield section

       STA     PF1; clear out second playfield section

       STA     PF2; clear out third playfield section

       STA     GRP0   ; clear out player graphic 0

       STA     GRP1   ; clear out player graphic 1

       STA     ENAM0  ; clear out missile 0

       STA     ENAM1  ; clear out missile 1

       STA     ENABL  ; clear out ball

       STA     COLUP0 ; set player 0 to black

       STA     COLUP1 ; set player 1 to black

       STA     COLUPF ; set playfield to black

       STA     COLUBK ; set background to black
;end initialize graphics



       ldx  #30 

overscanLoop

       sta WSYNC

       dex

       bne overscanLoop





       JMP StartOfFrame



      ;this is the end. change origin to the end of the 4k rom

       org $FFFA

TheEnd

       .word Reset    ;NMI;used in 7800?

       .word Reset    ;RESET

       .word Reset    ;IRQ;used in 7800?



      ;end of file

       END

 

thanks,

 

Jim

Link to comment
Share on other sites

I've definitely noticed differences between Stella and z26. I think Stella usually displays better; qb's flicker is less noticeable in Stella, as is the flicker in the copyright screen in the game I'm working on (slowly, as time permits). I loaded your code onto my 2600 via Supercharger and it flickered, there, too, but then went gray and stopped. I think there might be a timing problem with your code? I'm a novice at this myself. I use the scanline-counting switch in z26 to check that the display is properly aligned.

Link to comment
Share on other sites

II use the scanline-counting switch in z26 to check that the display is properly aligned.

 

Hi, I did that and it shows my example runninfg 45 FPS and 343 lines. Yikes!

 

After careful examination I found what I did wrong:

 

;draw the viewable screen



       ldx 192;<-- I forgot the '#' symbol

              ;    so I was moving junk from address 192

              ;    instead of the value 192

       LDA VarPf

       LDY #$16

       STY COLUPF

       sta PF0

       sta PF1

       sta PF2

DrawLoop

       sta WSYNC

       dex

       bne DrawLoop



 

This is one hell of a gotcha! Is there an emoticon for embarrased? :ponder:

 

Jim

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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...