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


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

A89: 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?
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.

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

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?

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


Follow-Ups: