Re: A83: Lists and Tables


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

Re: A83: Lists and Tables




with is the virtual with of the table.
this is a table of with three:

 .db 0, 5, 7
 .db 4, 6, 8
 .db 94, 5, 7
 .db 4, 6, 8

this is one of with six:

 .db 0, 5, 7, 4, 6, 8
 .db 94, 5, 7, 4, 6, 8

I say virtual since in the actual ram they would look identical, but sometimes
they are easier to think of as a two dimensional fiel. and then you use that
formula table + y*with + x, where x is the position in x, and y the position in
y and with the with of the table. (doh :)

//Olle - hi everyone. anyone remember me?

VVeakling@aol.com wrote:
> 
> what do you mean by width in this: "(table+(y*WIDTH)+x)"  the width of each
> of the peices of info? so the table would be like-
> 
> datatable:
>   .db   0,4,7,4,5,6
> 
> for that, the width would be 1??  and to access the 7 it would be
> "(table+(0*1)+3)"  or simplified:  "(table+3)" ??  what if one of the numbers
> is negative like:
> 
> datatable:
>   .db   0,4,7,-4,5,6
> 
> is the width still one?  or...
> 
> datatable:
>   .db   0,4,7,4,25,6
> 
> what is the width now? how do i access the 6? thank you for your help... i
> really need it for an upcoming tennis game.. in the ball routine, i need a
> data table to store:
> 1)  how much to move the ball in the x direction
> 2)  how much to move the ball in the y direction
> 3) how much to move the ball in the z  (height) direction
> 4) the apex, or highest point the ball reaches
> 5) other randomly generated stuff
> 
> i figured a table is the best and most organized way to do this.. i also
> assumed the quickest, but i dont really know how to do it.  Also, is the
> table written with  .db's   or  .dw's   and what is the difference between
> them?
> 
> thanks a lot for your help
> 
> -Weak
> (Jared Verdi)



Follow-Ups: References: