Jump to content



0

curious question about sprite alignment


7 replies to this topic

#1 grafixbmp OFFLINE  

grafixbmp

    Dragonstomper

  • 659 posts
  • Location:South Central US

Posted Sat May 9, 2009 6:17 PM

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?

#2 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Sat May 9, 2009 6:45 PM

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:

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

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

#3 Wickeycolumbus OFFLINE  

Wickeycolumbus

    River Patroller

  • 4,063 posts
  • Location:Michigan

Posted Sat May 9, 2009 6:58 PM

View PostSeaGtGruff, on Sat May 9, 2009 8:45 PM, said:

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?

#4 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Sat May 9, 2009 8:17 PM

View PostWickeycolumbus, on Sat May 9, 2009 8:58 PM, said:

View PostSeaGtGruff, on Sat May 9, 2009 8:45 PM, said:

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

#5 grafixbmp OFFLINE  

grafixbmp

    Dragonstomper

  • 659 posts
  • Location:South Central US

Posted Sun May 10, 2009 11:03 PM

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

#6 Omegamatrix OFFLINE  

Omegamatrix

    River Patroller

  • 4,795 posts
  • Location:Oh, Canada

Posted Mon May 11, 2009 1:14 AM

View Postgrafixbmp, on Sun May 10, 2009 10:03 PM, said:

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.


Attached File  TestBall.zip   1.37K   89 downloads

#7 stephena ONLINE  

stephena

    Stargunner

  • 1,967 posts
  • Stella maintainer
  • Location:Newfoundland, Canada

Posted Mon May 11, 2009 5:00 AM

View PostOmegamatrix, on Mon May 11, 2009 4:44 AM, said:

View Postgrafixbmp, on Sun May 10, 2009 10:03 PM, said:

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.


Attached File  TestBall.zip   1.37K   89 downloads
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.

#8 Omegamatrix OFFLINE  

Omegamatrix

    River Patroller

  • 4,795 posts
  • Location:Oh, Canada

Posted Mon May 11, 2009 8:44 AM

View Poststephena, on Mon May 11, 2009 4:00 AM, said:

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.

Attached File  TestBall.zip   1.74K   68 downloads




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users