A89: Re: Quitting ASM or not -- please answer these questions


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

A89: Re: Quitting ASM or not -- please answer these questions





>
>from: Creating Tables
>l printed out J.Mardell's guide on 8.5x14 in. paper, l've read it all and
>things make sense!  However a couple of things are missing...
>1. Can l make a matrix like array in plusshell programs?  ls it defined the
>same way?

using dc.x; if it's something like 12 x 12 (word), you would add / subtract
24 to move between rows and add / subtract 2 to move between columns


>2. How can l display a sprite?  lf this is done by way of a library, and
the
>.h file tells how [input], don't bother with this question.

every sprite routine is different, so you'll have to find the documentation
for that routine
in general, though, it will input a row and column in d0,d1 and a pointer to
the sprite in a0

>
>from: Library Input/Output
>Where can l find the parameters for all the functions in the new plusshell
>libraries?

the .h or .asm I think

>
>from: Displaying sprites, help me and SimTown will be asm
>When making games (like Zelda) do asm programmers use arrays to place the
>sprites onto the screen at given locations?

I don't think SimTown is going to be a good first asm program for you.  Why
don't try it after you've had a little more experience?

>
>from: Using a 2 dimensional array to put sprites
>How can l sort of use "indirection" to put a sprite at a location?  Realize
>that part of the code would not work because l had to make it up, but l'll
try
>to explain what l'm doing.  table is a 50x50 array.  d1 is the row, d2 the
>col.
>
>lea     table(PC),a0  ; Let A0 point at the table
> mulu    #100,d1       ; One row is 100 bytes (50 words). We must use
>                       ; MULU to get the right offset. If each row was
>                       ; 128 bytes, we could have shifted instead (faster).
> adda    d1,a0         ; Add the rowoffset to the pointer
> lsl.w   #1,d2         ; Multiplicate the column with 2 (same reason as
above)
> move.w  0(a0,d2),d0   ; Get the word and store it in d0 (l wrote this
>comment!)
>
>Now: let's say that d0 equals 00000001 (which in my SimTown game l might
want
>to be the code for a road tile).  l know that my label for the sprite can't
>start with a number, but l don't want to:
>cmp d0,00000001
>beq road_tile
>cmp d0,00000002
>beq clear_land
>lnstead, l want to somehow jump to what d0 equals.  so when d0 equals
00000001
>l want to somehow convert that value into a label it can jump to.
>
>Please Help

each sprite is going to be what size?  if the sprite were 8x8 (not
grayscale, no mask), they would be 8 bytes each.  if your sprite code is 1,
then multiply by 8 (shift) and add that number to the address of your first
sprite: you will then have a pointer to the correct sprite