Jump to content
IGNORED

HMOVE on cycle 71 and object copies


Kylearan

Recommended Posts

Hi,

 

I have some problems with strobing HMOVE on cycle 71 (so it completes on cycle 74, avoiding the black bars). When I use this on M0 set to three copies close, only the first copy gets moved; the other two are not moved (or moved differently, which is hard to tell).

 

Am I doing something wrong here, or is it just not possible to move all copies?

 

Somewhat related (noobish) question: Regarding RESM0, HMM0, ENAM0 (or RESP0, HMP0, GRP0 etc.), is there a specific order in which to set those up, or is the order irrelevant for the exact position in the end?

 

Thanks in advance,

 

-Kylearan

Link to comment
Share on other sites

Hi,

 

I have some problems with strobing HMOVE on cycle 71 (so it completes on cycle 74, avoiding the black bars). When I use this on M0 set to three copies close, only the first copy gets moved; the other two are not moved (or moved differently, which is hard to tell).

 

Am I doing something wrong here, or is it just not possible to move all copies?

 

Somewhat related (noobish) question: Regarding RESM0, HMM0, ENAM0 (or RESP0, HMP0, GRP0 etc.), is there a specific order in which to set those up, or is the order irrelevant for the exact position in the end?

 

Thanks in advance,

 

-Kylearan

It sounds like a problem where you are respositioning on a line that is displaying the missiles, and the write to RESM0 or RESM1 is what is causing the problem. The first copy gets drawed, and the repositioning takes affect.

  • Like 1
Link to comment
Share on other sites

Sorry for not posting screenshots and code. Somehow I thought this might be a known limitation with late HMOVEs, but maybe it's not - or, more probably, it's a mistake I made, so I'd appreciate some help.

Here's the relevant code:

	sta HMCLR	; just to be sure...

	; position vertical lines (M0) without enabling them yet
	sta WSYNC
	SLEEP 26
	sta RESM0
	lda #$30
	sta HMM0
	SLEEP 37
;	sta WSYNC
	sta HMOVE

	lda #%0000011	; Three copies close
	sta NUSIZ0

	; show horizontal lines (P0)
	sta WSYNC
	lda #%11111111
	sta GRP0
	SLEEP 20
	sta RESP0

	; Disable P0 and enable M0 on next scanlines
	sta WSYNC
	lda #0
	sta GRP0
	lda #%00000010
	sta ENAM0

This is what it looks like (the grey borders to the left and right in the screenshot are the window decorations from Stella):

post-35905-0-42661600-1387479815_thumb.png

 

Notice the odd spacing between the horizontal lines (P0).

If I comment out the SLEEP 37 in line 9 and comment in the sta WSYNC in line 10, it looks like this:

post-35905-0-03761700-1387479816_thumb.png

 

This is how I had expected the first version to look like, minus the black comb bar. (This is Stella 3.8.1 by the way; unfortunately I won't have my Harmony cartridge before next year, so cannot test on real hardware.)


So now I'm confused: I manipulate HMM0 with a sta HMOVE on cycle 71/74, and the display of P0 gets changed in an odd way...? What am I missing here?

Link to comment
Share on other sites

You know that the movement values change when you do an early HMOVE?

 

 


     HMPx values
     0   1   2   3   4   5   6   7   8   9   a   b   c   d   e   f
Cyc  ------------------------------------------------------------------------
70  -5  -6  -7  -8  -9 -10 -11 -12   0   0   0   0  -1  -2  -3  -4  **
71  -6  -7  -8  -9 -10 -11 -12 -13   0   0   0  -1  -2  -3  -4  -5
72  -7  -8  -9 -10 -11 -12 -13 -14   0   0  -1  -2  -3  -4  -5  -6
73  -8  -9 -10 -11 -12 -13 -14 -15   0  -1  -2  -3  -4  -5  -6  -7
74  -8  -9 -10 -11 -12 -13 -14 -15   0  -1  -2  -3  -4  -5  -6  -7  **
75   0  -1  -2  -3  -4  -5  -6  -7   8   7   6   5   4   3   2   1     HBLANK
76   0  -1  -2  -3  -4  -5  -6  -7   8   7   6   5   4   3   2   1     HBLANK
Link to comment
Share on other sites

This is what it looks like (the grey borders to the left and right in the screenshot are the window decorations from Stella):

 

attachicon.gifhmove_3copies_cycle71.png

 

Notice the odd spacing between the horizontal lines (P0).

 

If I comment out the SLEEP 37 in line 9 and comment in the sta WSYNC in line 10, it looks like this:

 

attachicon.gifhmove_3copies_wsync.png

 

This is how I had expected the first version to look like, minus the black comb bar. (This is Stella 3.8.1 by the way; unfortunately I won't have my Harmony cartridge before next year, so cannot test on real hardware.)

 

So now I'm confused: I manipulate HMM0 with a sta HMOVE on cycle 71/74, and the display of P0 gets changed in an odd way...? What am I missing here?

This looks like what I suspected, except that it is GRP0. You are repositioning with RESP0 while GRP0 is still being drawn. That is why it looks so displaced.

 

With the HMOVE's ending at cycle 73/74 you can only fine move left (or not at all). HMCLR does not work with these HMOVE's as you need to store $80 to the HMxx registers instead of $00 to have no movement. Here are some constants I use:

;HMxx
LEFT_7               = $70
LEFT_6               = $60
LEFT_5               = $50
LEFT_4               = $40
LEFT_3               = $30
LEFT_2               = $20
LEFT_1               = $10
NO_MOTION            = $00
RIGHT_1              = $F0
RIGHT_2              = $E0
RIGHT_3              = $D0
RIGHT_4              = $C0
RIGHT_5              = $B0
RIGHT_6              = $A0
RIGHT_7              = $90
RIGHT_8              = $80

;73/74 cycle HMxx
LEFT74_15            = $70
LEFT74_14            = $60
LEFT74_13            = $50
LEFT74_12            = $40
LEFT74_11            = $30
LEFT74_10            = $20
LEFT74_9             = $10
LEFT74_8             = $00
LEFT74_7             = $F0
LEFT74_6             = $E0
LEFT74_5             = $D0
LEFT74_4             = $C0
LEFT74_3             = $B0
LEFT74_2             = $A0
LEFT74_1             = $90
NO_MO_74             = $80

Sometimes it is desirable to position an object and hit HMOVE for it in the same scanline. This is not so easy with an early HMOVE since you can't simply use a WSYNC followed by a HMOVE. I wrote a routine to not only do the RESxx strobe, but do a cycle 74 HMOVE after that on the same scanline for any position on the screen.

Link to comment
Share on other sites

This looks like what I suspected, except that it is GRP0. You are repositioning with RESP0 while GRP0 is still being drawn. That is why it looks so displaced.

 

Oh, I see. I guess I hadn't spotted this as the displacement didn't happen with the standard HMOVE, but only because the timing was then slightly different and the displacement wasn't really related to the HMOVE .

 

HMCLR does not work with these HMOVE's as you need to store $80 to the HMxx registers instead of $00 to have no movement.

 

Ah, okay! I didn't realize that. I'll also have a look at your source. Thanks a lot!

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