Re: [stella] Distella --> DAsm problem

Subject: Re: [stella] Distella --> DAsm problem
From: Piero Cavina <p.cavina@xxxxxxxxxxxxx>
Date: Sun, 23 Aug 1998 00:06:21 +0200
At 18.55 21/08/98 -0000, you wrote:

>Thanks for the help.  And not to look a gift horse in the mouth, but 
>(that might seem really really weird to someone not from the US, huh?  Or 
>does it have international appeal?  ;)...

It's very international I think, here the meaning is exactly the same :)

At 03.13 22/08/98 GMT, Erik Mooney wrote:

>I'd suggest changing the kernel so that the same
>WSYNC counts off every line of screen, as follows:
>
>    ldy #0
>DoScreen:
>    STA WSYNC
>    ldx #0
>    tay             ;using Y to count scanlines
>    sec             ;
>    sbc $80         ;A now has the distance between current line and object
>    cmp #7          ;7=height of object
>    bcs DontDraw    ;branch if (scanline-$80)>7
>    ldx #2          ;if (scanline-$80) was <= 7, enable the object
>DontDraw:
>    stx ENAM0
>    iny
>    cpy #192
>    bne DoScreen
>
>This is a decent amount more streamlined and flexible.  Much easier to add
>more objects, and it's less prone to error - you're always simply counting
>lines from 0 to 191 instead of from 0 to x, eight lines to display the
>object, then 0 to 191-8-x.

Why not count backwards..:

(top of the screen)
  .
  .
100   let's say.. sprite height = 4; sprite y-pos=48
 99   sprite must be drawn in scanlines 48,49,50,51
 98 
  .
 52   52-48 = 4 >= 4, don't draw
 51   51-48 = 3  < 4, draw   
 50   50-48 = 2  < 4, draw
 49   49-48 = 1  < 4. draw
 48 <- y-pos; note: last scanline! 48-48=0  <4, draw
 47   47-48 = $FF = 255 >=4, don't draw
  .
  .
  2
  1
  0
(bottom of the screen )

I hope this helps. Also, remember that this technique takes a lot of
processor time, and it may be not suitable for a single scanline resolution
kernel. But please first this first.. and don't forget to study the Combat
source carefully, it's all done this way, plus the PHP trick.


Ciao,
 P.


--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread