Jump to content
IGNORED

Basic sprite question


wopr67

Recommended Posts

I am experimenting with sprites, and I have a simple two-line kernel.  Every even-numbered scanline should show a solid red line (#255), while every odd-numbered scanline should show a dotted (#170) yellow line.  I want to use GRP0 for both odd and even lines.  Nothing I have tried works, and for the life of me, I can't figure out why.  Here is my kernel:

 

NextFrame
		VERTICAL_SYNC    
		TIMER_SETUP 37

		lda #$70
		sta COLUBK

		lda #0
		sta VDELP0

		lda #0
		sta GRP0
		sta GRP1

        TIMER_WAIT

		ldx #192

LVScan
		txa
		and #$01
		beq .oddscan

.evenscan
		lda #$48	;red	
		sta COLUP0
		lda #255
		sta GRP0
		sta RESP0

		jmp .join

.oddscan
		lda #$1e	;yellow
		sta COLUP0
		lda #170
		sta GRP0
		sta RESP0

.join
		sta WSYNC

		dex 
        bne LVScan 
             
		; 30 lines of overscan
		TIMER_SETUP 32    
		lda #170
		sta GRP0
        TIMER_WAIT

        jmp NextFrame

Any idea what the problem is?

 

Thanks!

 

 

Edited by wopr67
Link to comment
Share on other sites

18 hours ago, Karl G said:

I'm pretty sure the problem is the RESP0 in your kernel. 

+1 . Writing to RESP0 has ... all kinds of tricky side effects. To keep things simple strobe RESP0 before you go into your display loop. This could be as simple as inserting WSYNC / SLEEP ... / sta RESP0  - before you go into LVScan. By changing the sleep value you'll be able to observe how strobing at different points sets the sprite to different horizontal positions.

It is also super helpful to use stella in debug mode and step through frame by frame / line by line to observe what's happening on each scan line.

Edited by Dave C
  • Like 1
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...