[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DRAW & XDRAW... How to use



jh82 (webmasterNOweSPAM@jh82.i-p.com.invalid) wrote:
: I am in the process of making a huge, graphic fantasy game.  The
: problem I have is that I lost my notes as to how to set up the DRAW &
: XDRAW commands.  I do remember that it involves a ton of POKEs, but I
: can't remember the address to start at, or the byte codes.  I seem to
: remember it being explained in a manual.  If ANYONE can help me, please
: do.  This is going to be a great game, but I can't finish it until I
: can get those instructions.

You're wanting to use shape tables.

You begin by defining a shape somewhere in memory...where is not
important, but the shape is defined as a byte stream something like this--

Byte:   1 - Number of shapes in table
      2-3 - Offset (bytes) to 1st shape
      4-5 - Offset (bytes) to 2nd shape
      ...
      m-n - First shape

Shapes are defined as sequences of bytes, using 3-bit plotting/moving
commands.  So each byte can hold as many as three instructions.  The last
byte of the shape is zero.  The codes are as follows:

No Plot, Move Up   : 000
No Plot, Move Right: 001
No Plot, Move Down : 010
No Plot, Move Left : 011
   Plot, Move Up   : 100
   Plot, move Right: 101
   Plot, Move Down : 110
   Plot, Move Left : 111

Once your shape table is defined, you must tell Applesoft where it is
located by putting the address into the pointer at location $E8-E9 (232-233).

To use it:
SCALE=s (Size of shape meaning distance per plot 0-255...0 means 256)
ROT=r  (rotation, 0-255, but it's more or less in radians if I remember right
HCOLOR=c (0-7)
DRAW p AT x,y (plots shape #p starting at location x,y scaled to s and
rotated r in color c)

XDRAW p AT x,y (plots shape as DRAW does, but instead of plotting in color
c, it reverses the pixels where plotting happens)

: Also, I remember a sound routine I found in a game called Lemonade
: Stand, or something like that.  If you have that program, I really need
: the sound routine from it.  It's toward the end of the program, and
: involvers a lot of POKEs.  If you have this, let me know.

Er, I have that around here someplace...

--Dave Althoff, ][.
  Paying a rare visit to c.s.a2 after catching up on rec.roller-coaster.
  Hi, folks, nice to be back again, if only briefly!
-- 
    /^\        _       _               _*** Closed for the season ***
   /XXX\      /X\     /X\_      _     /X\__      _     _        _____  
  /XXXXX\    /XXX\  _/XXXX\_   /X\   /XXXXX\    /X\   /X\      /XXXXX
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX