Jump to content
IGNORED

struggling with horizontal positioning/ hmove


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

Link to comment
Share on other sites

HMOVE needs to follow a WSYNC.

http://atariage.com/forums/topic/47639-session-24-some-nice-code/

 

 

edit: from the Stella Programmer's Guide:

 

 

 

8.0 Horizontal Motion

Horizontal motion allows the programmer to move any of the 5 graphics objects relative to their current horizontal position. Each object has a 4 bit horizontal motion register (
, HMP1,
, HMM1,
) that can be loaded with a value in the range of +7 to -8 (negative values are expressed in two's complement from). This motion is not executed until the
register is written to, at which time all motion registers move their respective objects. Objects can be moved repeatedly by simply executing HMOVE. Any object that is not to move must have a 0 in its motion register. With the horizontal positioning command confined to positioning objects at 15 color clock intervals, the motion registers fills in the gaps by moving objects +7 to -8 color clocks. Objects can not be placed at any color clock position across the screen. All 5 motion registers can be set to zero simultaneously by writing to the horizontal motion clear register (
).

There are timing constraints for the HMOVE command.
The HMOVE command must immediately follow a
(Wait for SYNC) to insure the HMOVE operation occurs during horizontal blanking.
This is to allow sufficient time for the motion registers to do their thing before the electron beam starts drawing the next scan line. Also, for mysterious internal hardware considerations, the motion registers should not be modified for at least 24 machine cycles after an HMOVE command.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

I can't see HMOVE anywhere in this code!

 

I use the linux text editor called "Kate", and it seems to be showing some strange varying quality of indentation in your code.

 

1. Please fix the indentation in your code text so that it is uniform

 

2. I don't think you've initialised your constants properly. For instance here:

YPos    .byte 

What is the actual binary value Ypos is supposed to be holding?

 

3. You have not formatted your program labels properly.

 

This is incorrect:

Start sei ; disable interrupts

Do either of these:

.Start
     sei

OR

Start:
     sei

That's all I have time for right now, I'll come back soon.

  • Like 1
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...