Jump to content
IGNORED

Blank pixels after HMOVE


Devin

Recommended Posts

Hello all,

 

I'm sure this is a very common newbie question, but I was wondering if there is a solution.

 

I'm positioning some sprites using the rather odd horizontal movement registers. When I call HMOVE immediately after WSYNC, about 6 or so pixels on the next scanline are black. Is there a solution to this?

 

I'm currently tormenting the clock example.

post-17256-1198234957_thumb.png

Edited by Devin
Link to comment
Share on other sites

I'm positioning some sprites using the rather odd horizontal movement registers. When I call HMOVE immediately after WSYNC, about 6 or so pixels on the next scanline are black. Is there a solution to this?

 

Most machines position sprites by using a horizontal position counter and then a compare register for each sprite. When the counter hits the compare register value, the sprite is triggered. The Atari 2600 is the only machine I know of which implements sprites differently.

 

On the 2600, each sprite has a count-to-160 circuit (which is internally subdivided into count-to-4 and count-to-40 sections). Since there are 160 pixels per scan line and the count advances once per pixel, each sprite will appear in the same place on each line.

 

When a RESxx address is hit, it resets a sprite's position counter to zero. This will allow precise code to set a sprite's position to any multiple of three pixels, or easy code to set it to any multiple of 15. To allow a sprite to be positioned more finely, it's necessary to use a pulser circuit to "nudge" it.

 

I'm not sure how the HMOVE circuit evolved, since it's a little more complex than it needs to be, but it has two purposes:

 

-1- Hit each sprite with 0-15 extra pulses. This will move the sprite 0-15 pixels to the left.

 

-2- Kill the first 8 pulses of a scan line for all sprites. Without motion pulses in the first 8 pixels, whatever is displayed on pixel 8 would be displayed on pixels 0-7 as well. To avoid this, the 2600 simply blanks those pixels. Old Flashback 2 consoles do not have the blanking circuit; in some games like Missile Command, there are odd graphics when explosions occur at the far left of the screen.

 

The important things to know about HMOVE are:

 

-1- Hitting HMOVE two or three cycles before the end of a scan line (so the next instruction starts at cycle 74 or 75) will cause the pulses to be sent normally (per -1- above) but will not cause the start of the next scan line to be blanked.

 

-2- Hitting HMOVE any time after that, but before the displayed portion of the next scan line, will cause the start of the next line to be blanked, and cause 8 motion pulses to be skipped for all sprites.

 

-3- Hitting HMOVE more than three cycles before the start of a scan line will cause the first few motion pulses to occur during the visible part of the line. This may cause strange artifacts, and will cause behavior that may vary with different chip revisions.

 

-4- Hitting HMOVE too long after the start of a scan line may cause some motion pulses to occur in the visible part of the next line. When sending 15 motion pulses, one hit the HMOVE by 4. When sending fewer pulses, it's acceptable to start HMOVE later.

 

-5- Changing the horizontal motion registers while the pulser is running may cause odd effects. The most useful of these are:

 

- - Setting it to $70 (15 motion pulses), hitting HMOVE, and then setting it to $80 (no pulses) will result in 16 motion pulses being sent.

 

- - Setting it to $70 (15 motion pulses), hitting HMOVE, and then setting it to $90 (one pulse) will result in motion pulses being sent continuously until the next HMOVE. Cosmic Arc does that for the stars.

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