Page 1 of 1

Re: Good way to access dynamic parallel arrays?

Posted: Mon Nov 26, 2018 1:54 pm
by pubby

Code: Select all

   lda Level_1_Collisions_x1
   sta collisionX1
   lda Level_1_Collisions_x1+1
   sta collisionX1+1
Doesn't make any sense. I think you meant to do this?

Code: Select all

   lda #.lobyte(Level_1_Collisions_x1)
   sta collisionX1
   lda #.hibyte(Level_1_Collisions_x1)
   sta collisionX1+1
But yes, it is reasonable to have several pointers in zeropage to do this.

Re: Good way to access dynamic parallel arrays?

Posted: Mon Nov 26, 2018 2:48 pm
by tokumaru
Yes, I've used multiple ZP pointers to solve problems like this before. It may seem a little wasteful at first, but as long as you have the RAM to spare, it's fine.

Re: Good way to access dynamic parallel arrays?

Posted: Mon Nov 26, 2018 5:39 pm
by pubby
Interleaved arrays are an option too. That would reduce the number of pointers.