|
Subject: Re: [stella] lines From: emooney@xxxxxxxxxxxxxxxx (Erik Mooney) Date: Wed, 03 Dec 1997 18:19:43 GMT |
>Atari 2600 games with oblique or curved lines, like Laser Blast, Missile
>Command or Fishing Derby have always puzzled me. What is obvious on any
>other system becomes a challenge on the 2600.
>I was wandering if there's a more or less "standard" way to draw such
>lines. What do you think?
Well, you'd have to use an object for the Missile Command or Laser Blast
lines. I'd imagine you'd RESMx at the beginning of the frame, and keep a
counter during the frame, incrementing it by a certain amount each scanline
(the amount determines the angle of the line), and when it overflows, do an
HMOVE by one pixel one way or the other.
Like, assume we have a Missile Command missile, STA RESM0 has set the
missile to its starting position, and you've already set NUSIZ, COLUP0,
etc.
Eachline:
sta WSYNC
sta HMOVE ;apply the motion
lda MissileCounter ;the counter
clc ;could probably omit this if you need the cycles
adc MissileOffset ;the larger this is, the faster the missile angles
sta MissileCounter ;store the new value
lda MissileHmove ;this has been preinitialized to $F0 if the missile
;is moving right, $10 if the missile moves left
bcs MoveMissile ;if counter overflowed, move the missile
lda #0 ;if this line is reached, the counter didn't
;overflow, so we want to write 0 to HMM0.
MoveMissile
sta HMM0
dec Scanline
bne Eachline
With this, 256/MissileOffset is how many scanlines elapse between moves of
the missile. If MissileOffset=$40, the missile moves every fourth scanline:
X
X
X
X
X
X
X
X
and a MissileOffset of $AA will result in funky lines like:
X
X
X
X
X
X
X
X
X
Of course, I've no idea if this is how the game actually does it, but it's
how I'd do it.
--
Stella list is Administered by krishna@xxxxxxxxxxxx <Glenn Saunders>
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/stella.html
+-shameless plugs-------------------------------------------------------+
| Stella documentary at http://www.primenet.com/~krishna |
| Nick's VCS links via http://www.primenet.com/~nickb/atariprg.htm |
| Write the best game, win framed autographs of famous Atari alumni!! |
+-----------------------------------------------------------------------+
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [stella] lines, Piero Cavina | Thread | Re: [stella] lines, Chris Wilkson - MCD |
| [stella] lines, Piero Cavina | Date | Re: [stella] lines, Chris Wilkson - MCD |
| Month |