[stella] cosmic ark stars missile 1

Darrell Spice, Jr. darrell.spice.jr at spiceware.org
Thu Jan 17 12:42:01 CST 2008


I did a number of tests and only got it to work with $7x and $6x for  
Stay Frosty.  Possibly different sleep values would be needed if the  
2nd value isn't $6x.


On Jan 17, 2008, at 12:32 PM, Eckhard Stolberg wrote:

> The Cosmic Ark starfield effect should work for all moveable objects
> alike. Also in your example code you should be able to replace the
> #$60 with all other values exept #$70 of course. The effect isn't that
> difficult to understand, if you know how the horizontal motion works
> in the TIA.
>
> The TIA is generating 228 clock pulses in each scanline (160 during
> the visible part of the screen and 68 during the horizontal blank).
> At every fourth of these TIA pulses a motion pulse is generated too,
> which gets fed into the horizontal position counters of the moveable
> objects under certain circumstances. This way the horizontal position
> counter gets more clock pulses than the normal 160 it gets during the
> visible part of the screen. This will result in a left shift. The
> extended horizontal blank will prevent the normal TIA pulses to go
> through to the position counters. Therefore the counter will get
> fewer clock pulses than normal, which will result in an eight pixel
> shift to the right.
>
> When you trigger an HMOVE command, the latches that will allow the
> motion pulses to go through to the position counters will be opened
> for all moveable objects. Also a counter from 0 to 16 will be started
> which gets advanced on each motion pulse. This counter continuously
> gets compared to the values in the HMxx registers (with the highest
> bit inverted). If there is a match, the latch for that object will be
> closed and no more motion pulses can get through. So a HMxx value of
> $80 means no motion pulses will get though, because the value matches
> the initial state of the counter, and a value of $70 means all 15  
> motion
> pulses will get through to the position counter of that object.
>
> The tricky part is that the HMOVE counter will count from 0 to 15 only
> once. And a latch will only close on a perfect match between the  
> counter
> and the HMxx value. So if you set the HMxx register to a high value
> like $70 initially and then wait until the HMOVE counter has  
> progressed
> a bit but not reached $f0 ($70 with the top bit inverted) yet, you can
> write a value that is smaller than the current state of the HMOVE  
> counter
> into a HMxx register and the compare will never match. Therefore this
> object will keep getting motion pulses fed into it's position counter
> until a new HMOVE command can close the latch.
>
> During the visible part of the screen the motion pulses will overlap
> perfectly with the normal pixel clock pulses and therefore have no  
> effect.
> Therefore the object will move 17 pixels to left in each scanline,  
> which
> is the number of motion clocks that fit into the horizontal blank. On
> the TIA89 (the one that has problems with Kool Aide Man) however the
> motion pulses will overlap with the normal pixel pulses in such a way
> that the pulse will be cancelled out. Therefore the position  
> counter will
> get fewer pulses which will result in extra shifts to the right. As a
> result the starfield effect will have a different pattern on these  
> VCSs.
>
> The pixel clock pulses are also used to advance the signals in the  
> object
> output circuit. Here (and that is true for both types of TIAs) the  
> motion
> pulses also overlap in such a way that the signals get delayed.  
> That is
> why you get some lines with no 'stars' and some lines with double wide
> 'stars' in the Cosmic Arc starfield.
>
>
> Ciao, Eckhard Stolberg
>
> ----- Original Message -----
> From: "Andrew Davie" <andrew at taswegian.com>
> To: "'Atari 2600 programming list'" <stella at atari2600.org>
> Sent: Tuesday, January 15, 2008 2:17 PM
> Subject: [stella] cosmic ark stars missile 1
>
>
>> I don't understand the magic behind cosmic ark stars, but I am  
>> using it
>> successfully for Boulder Dash to give the extra-life shimmer.   
>> However,
>> the
>> code I use is using missile 0 and I really want to use missile 1.   
>> But
>> when
>> I change things from missile 0 to missile 1, I no longer get 'stars';
>> just
>> 'stripes'.  In other words the effect doesn't work.  I'm pretty  
>> sure it's
>> to
>> do with the magic numbers in the following code.  I just don't  
>> know what
>> magic numbers to use for M1 (or for ball).  Can anyone help?
>>
>>                jsr rndm
>>                and #7
>>                clc
>>                adc #4
>>
>>                TAY
>>         ;       STA     WSYNC
>> .r22             DEY
>>                BPL     .r22
>>                STA     RESM0
>>                LDA     #$70            ;this value is important  
>> for the
>> effect
>>                STA     HMM0
>>
>>                STA     WSYNC
>>                STA     HMOVE
>>                JSR     Trick2           ;waste 18 cycles and load  
>> move
>> value
>>                STA     HMM0            ;this is the tricky part
>>
>>
>>                LDA     #$02            ;turn missile0 on
>>                sta WSYNC                       ; 3
>>                STA     ENAM0
>>
>>                rts
>>
>> Trick2:          NOP                     ;the tricky subroutine
>>                NOP
>>                LDA     #$60
>>                RTS
>>
>>
>> The above gives a reasonable random effect for me.  If I change  
>> the lda
>> #$60
>> then it stops working.  If I change to missile 1, it stops working.
>>
>> Could someone please analyse this and/or suggest the correct values?
>>
>> Thanks
>> A
>>
>>
>>
>> _______________________________________________
>> Stella mailing list
>> Stella at atari2600.org
>> http://atari2600.org/mailman/listinfo/stella
>
>
> _______________________________________________
> Stella mailing list
> Stella at atari2600.org
> http://atari2600.org/mailman/listinfo/stella

Darrell Spice, Jr.
darrell.spice.jr at spiceware.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://atari2600.org/pipermail/stella/attachments/20080117/fb9ab7a9/attachment-0001.html 


More information about the Stella mailing list