Jump to content

Photo

struggling with horizontal positioning/ hmove


2 replies to this topic

#1 easmith OFFLINE  

easmith

    Chopper Commander

  • 130 posts
  • Location:Alexandria, VA

Posted Sun Jan 7, 2018 12:22 PM

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

Attached Files



#2 xucaen OFFLINE  

xucaen

    Stargunner

  • 1,231 posts
  • Paying bills...
  • Location:Massachusetts

Posted Sun Jan 7, 2018 12:27 PM

HMOVE needs to follow a WSYNC.

http://atariage.com/...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 (HMP0, HMP1, HMM0, HMM1, HMBL) 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 HMOVE 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 (HMCLR).

There are timing constraints for the HMOVE command. The HMOVE command must immediately follow a WSYNC (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.



#3 vidak OFFLINE  

vidak

    Moonsweeper

  • 442 posts
  • Location:Sydney, Australia

Posted Sun Jan 21, 2018 5:05 AM

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.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users