Jump to content
IGNORED

struggling with horizontal positioning/ hmove


easmith

Recommended Posts

Hi, I am a newbie this is my first post/ program.

 

I am struggling with figuring out the correct placement of HMOVE .

 

I have placed a sprite , but I want to move it 3 pixels to the left . When I try to load the offset , do WSYNC and then HMOVE immediately after RESP0 I get a crazy flickering screen.

 

 

can someone please help ? Does the HMOVE need t be done on each sprite scanline or once per frame? If once per frame , then where should it be placed?

 

I have seen several examples of algorithms for fine horizontal placement but cannot get these to work correctly either. Perhaps it has to do with the fact that I am wasting my VBLANK periods by not using timer.

 

 

 

Sorry for so many questions... code is attached

 

 

 

borderwcatfine6.asm

Edited by easmith
Link to comment
Share on other sites

When you're starting out you should position your objects during Vertical Blank. Do a single WSYNC HMOVE after you've strobed all the RESxx and set all the HMxx registers for the objects you are using.

 

Work your way through the tutorial in my blog, be sure to download the source for each step as there's a bunch of comments in the source code explaining it. Also check the comments below each entry as they may contain answers to questions you have (if not, be sure to post a question!). X and Y positioning of the players is covered in steps 4 & 5, but be sure to go through the prior steps as they contain important info that you'll need to know.

  • Like 1
Link to comment
Share on other sites

Spiceware's code is really great for this.

 

You position the Horizontal Position before hand then the Sprite Draw Pointer (and some incidental kernel code) handles the vertical drawing.

 

thanks, I'll take a look. I think I am confused about how you can position a player before you arrive at the lines where the player will be drawn.

Link to comment
Share on other sites

How well do you know the TIA? Remember, it automatically holds the last data you sent to it. So if you were to set player zero's speed at 3 (left) then put RESP0 and HMOVE outside of your NextFrame loop (for example, near your ZeroZP) you would have the sprite look just as it is, but it would be to the left a little bit, and it would stay there.

 

Putting HMOVE inside of your NextFrame loop would have your sprite move to the left every frame, and so it will appear to be moving at a pretty good speed, to the left.

 

Putting HMOVE on every scan line would move your sprite to the left on every scan line, giving the sprite a slanted look- a severe rightward slant.

Edited by BNE Jeff
  • Like 1
Link to comment
Share on other sites

The way I imagine it is that the TIA will draw your sprite at whatever position on the screen horizontally you set. So when you write to RESPxx and then HMOVE, the TIA is automatically waiting for you to draw your sprite VERTICALLY, and will basically draw your sprite at the correct horizontal position as if by magic.

 

So it's actually false to say the 2600 is hard to program, because it actually does a lot of important stuff automatically!

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