Jump to content
IGNORED

reseting player sprites


swiley

Recommended Posts

I noticed that if you reset a player multiple times on one scan line it isn't drawn at all. I lost the original program I found this in (I was afraid of asking then) so I modified the How to Draw a Playfield example to show this. Is this a bug in stella, or can you not do this on a real Atari? I thought I read somware that you could do this to make a backround that repetaed the same pattern over and over again but I can't remember where that was. thanks in advance for your answeres.

dos.bin

dos.asm.txt

Link to comment
Share on other sites

I noticed that if you reset a player multiple times on one scan line it isn't drawn at all. I lost the original program I found this in (I was afraid of asking then) so I modified the How to Draw a Playfield example to show this. Is this a bug in stella, or can you not do this on a real Atari? I thought I read somware that you could do this to make a backround that repetaed the same pattern over and over again but I can't remember where that was. thanks in advance for your answeres.

 

I haven't gone through the .asm you posted, but here's how I do it in the game I'm working on:

 

WriteLives
STA WSYNC
NOP3
WriteLives_loop
LDA graphicPtr,Y
DEY
BPL KeepOnWriting
RTS
KeepOnWriting
STA.w GRP0
STA GRP1
REPEAT 8
STA RESP0
STA RESP1
REPEND
STA RESP0
STX GRP1
STX GRP0
JMP WriteLives_loop

 

It's a little clunky, but it works. Give that a try in Stella... works fine with 2.8.x and 3.0.

 

Hope this helps.

 

--Will

Link to comment
Share on other sites

Thanks so much! that worked!

Yes, it's just the way the TIA works. If you reset the position of a player on a given scan line, its primary copy will not appear on that scan line-- that is, unless it's already been drawn. For example, if you reset player0 to screen position 2 on the last line of VBLANK before the active area, then it will appear at that position on (active) scan line 1. Then on line 1 you could reset player0 to screen position 18, and it might not display a second time on line 1, but it will display there on line 2. Then on line 2 you could reset player0 to screen position 34, and it will display there on line 3. Do as long as you wait until after the player has been drawn on a line, and then reset it to a position to the right of that one, it will appear once per line, and will be moved to the right on the next line, like this:

 

...XXXXXXXX
...................XXXXXXXX
...................................XXXXXXXX
etc.

Note that you cannot do the same thing going to the left:

 

...................................XXXXXXXX
...................XXXXXXXX
...XXXXXXXX

Instead, you would have to leave at least one blank line between the leftward repositionings:

 

...................................XXXXXXXX
.......................
...................XXXXXXXX
.......................
...XXXXXXXX

If you keep resetting a player multiple times on each line, chances are it won't ever get a chance to be drawn, because on the next line down-- where it would first appear at the new position-- you'll be resetting it to some position that's way to the left of the last position you'd set it to on the previous line, see?

 

On the other hand, the extra copies of a player will be displayed on the line where you reset the player, as long as you wait long enough between each strobe of RESPx to give the first extra copy a chance to be displayed. So if you set NUSIZx to display 2 copies, you can get one copy that displays (the second copy), and keep getting additional copies of it by repeatedly strobing RESPx (but not too quickly between each strobe).

 

It's confusing, but once you "get" it, it's easy. :)

 

Michael

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