Re: [stella] That .byte thing

Subject: Re: [stella] That .byte thing
From: Eckhard Stolberg <Eckhard_Stolberg@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 Sep 1998 15:39:46 +0200
At 19:39 24.09.98 -0500, you wrote:

>I want to draw an X on the background using the Player0 graphic.
>I have some problems.  I do not know how to do that .byte thing and when I
>do it the hard way (see below) I require 2 STA WSYNCs in order to see
>something draw on the screen.  Will the .byte command help me out?

The RESP0 register is used to position player0 horizontaly. The
position depends on when in the scanline RESP0 is hit. The position
will remain the same untill it is changed again. Therefore it is not
nessessary to hit RESP0 in every scanline. In a scanline, where RESP0
is hit, the player0 graphics will not be displayed. That's why you need
two scanlines to see something in your program.

The .byte pseudoopcode will insert a byte value at the current
address in the ROM. In DASM it can take values in decimal, binary,
hexadecimal and octal. For graphics the binary representation would
be the best. A routine to read those values and put them into the
GRP0 register could look like this.

    LDX #7
L1: STA WSYNC
    LDA GRAPHICS,X
    STA GRP0
    DEX
    BPL L1

GRAPHICS: .byte %00000000
          .byte %11000011
          .byte %01100110
          .byte %00111100
          .byte %00011000
          .byte %00111100
          .byte %01100110
          .byte %11000011

In this routine X contains the counter. Since it counts backwards,
the graphics data has to be stored upside down.


Ciao, Eckhard Stolberg



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

Current Thread