0 Members and 1 Guest are viewing this topic.
Quote from: yunhua98 on August 02, 2011, 04:03:12 pmWhat he said.the A*8 is indeed because of the 8x8 tiles, and in {Q+B*24+P+A+GDB1}, Q+B*24 is interpreted as (Q+B)*24 because of left to right order of operations. The width of the map is 24, so to get to the next row, you add 24, in this case, you add Q+B number of rows. Add one to go one byte to the right, so P and A are added, plus the original pointer, GDB1.Hem... Is it normal? IRL, or in C, the * operaotr has more priotiy than +...
What he said.the A*8 is indeed because of the 8x8 tiles, and in {Q+B*24+P+A+GDB1}, Q+B*24 is interpreted as (Q+B)*24 because of left to right order of operations. The width of the map is 24, so to get to the next row, you add 24, in this case, you add Q+B number of rows. Add one to go one byte to the right, so P and A are added, plus the original pointer, GDB1.
:For(A,GDB1,GDB1+length(GDB1)-1):2*A->Z:nib{Z}->M:nib{Z+1}->N:.display sprite M:.display sprite N:End
For nibbles, cant you just do this?Code: [Select]:For(A,GDB1,GDB1+length(GDB1)-1):2*A->Z:nib{Z}->M:nib{Z+1}->N:.display sprite M:.display sprite N:End
:For(A,GDB1,GDB1+length(GDB1)-1):Z/16->M //gets only the first 4 bits 'cause it rounds:Z^16->N //gets only last 4 bits(modulo):.display sprite M:.display sprite N:End