Jump to content
IGNORED

curious question about sprite alignment


Recommended Posts

Was just contemplating h position and was wondering if a missle has its h position set, and is active for several scanlines, would any change to size width alter the h position a few pixels on the same frame depending on the current size set for each scanline? I had heard this once but didn't know how a change to size would be percieved for every scanline following changes made.

 

like for scanlines 20 to 21 set at 4 x and for scanlines 22 to 24 at 2 x. If the alignment on the left side were diffrent that would mean that an HMOVE would need to be triggered to compensate, correct?

Link to comment
Share on other sites

Changing a missile's width without changing its horizontal position will affect where it ends on a scanline, but will *not* affect where it begins:

 

post-7456-1241916151_thumb.png

 

On the other hand, changing a *player's* width without changing its horizontal position *can* cause it to shift to the right by one color clock:

 

post-7456-1241916173_thumb.png

 

Specifically, it will start at the same color clock position as long as it is a single-wide player-- no matter how many copies of it are displayed-- but it will start one color clock later if it is a double- or quadruple-wide player.

 

Michael

Link to comment
Share on other sites

On the other hand, changing a *player's* width without changing its horizontal position *can* cause it to shift to the right by one color clock

 

Specifically, it will start at the same color clock position as long as it is a single-wide player-- no matter how many copies of it are displayed-- but it will start one color clock later if it is a double- or quadruple-wide player.

 

Michael

 

I never knew about that. Is it a hardware bug?

Link to comment
Share on other sites

On the other hand, changing a *player's* width without changing its horizontal position *can* cause it to shift to the right by one color clock

 

Specifically, it will start at the same color clock position as long as it is a single-wide player-- no matter how many copies of it are displayed-- but it will start one color clock later if it is a double- or quadruple-wide player.

 

Michael

 

I never knew about that. Is it a hardware bug?

I don't think it's a bug, but I can't give you an explanation of why it happens. The TIA hardware notes that were written by Andrew Towers talk about horizontal positioning, but I don't understand all the technical aspects of it. However, there are several people on this board who can probably explain this behavior, so hopefully one of them will chime in! :)

 

Michael

Link to comment
Share on other sites

doesn't the ball have any size settings and if so, do they stay aligned properly?

Yep, the ball has size settings. They are actually a part of the CTRLPF register, bits D5 and D4.

 

 

I wrote a small program and it seems like the ball always begins at the same place, despite its width. I tried it on real hardware with the Krok and it looks okay. I get some weird scrolling in both Stella and Z26 though. I think it might be my ancient video card.

 

 

TestBall.zip

Link to comment
Share on other sites

doesn't the ball have any size settings and if so, do they stay aligned properly?

Yep, the ball has size settings. They are actually a part of the CTRLPF register, bits D5 and D4.

 

 

I wrote a small program and it seems like the ball always begins at the same place, despite its width. I tried it on real hardware with the Krok and it looks okay. I get some weird scrolling in both Stella and Z26 though. I think it might be my ancient video card.

 

 

TestBall.zip

Yes, you're probably using software mode in Stella (and in z26, this is the only mode available). The artifacts you're seeing are because the screen updates aren't synchronized to your monitor refresh rate, and for most (all?) operating systems, it's impossible to do so in software mode. If you switch to OpenGL mode and turn on OpenGL vsync, the updates will be much smoother.

Link to comment
Share on other sites

Yes, you're probably using software mode in Stella (and in z26, this is the only mode available). The artifacts you're seeing are because the screen updates aren't synchronized to your monitor refresh rate, and for most (all?) operating systems, it's impossible to do so in software mode. If you switch to OpenGL mode and turn on OpenGL vsync, the updates will be much smoother.

 

Yep, that worked for the refresh rate. Thanks. :)

 

 

I also changed the demo slightly, and commented the source a little more. No big deal, but it's more readible.

 

TestBall.zip

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