1 2 3 4
| [b]Edit:[/b] Annoying code tag bug. Try to ignore x.x Okay :) So, one line at a time: [code]0->A |
Initialize A, like we've been doing
You can store to variable inside expressions. We need I to point to the beginning of the data containing the size, so it is stored.
Since the size data for each map is 2 bytes, we multiply L by 2, then add it to the beginning of the size data to get the end where we stop.
Just repeat until we reach the end.
I points to the X-size of the current map, and I+1 points to the Y-size of it. (I had had I-1, but I fixed it.)
We multiply these to get the total size of the current map, and add it to A. The multiplication comes first because otherwise it would evaluate as (A+{I})*{I+1} and not A+({I}*{I+1})
Add 2 to move on to the next set of data.
1 2 3
| End/code] Finish our loop
|
Copy(A+GDB1,L1,{E-1}*{E-2})[/code]
A is the correct offset, so we add it to GDB1 to get to the start of the map data.
Alternatively, we could have done GDB1->A at the beginning and just A on this line instead of A+GDB1.
L1 is the destination.
E is the end of the size data we've scanned. The data for the map you're loading is right before it. So {E-1} is the Y-size and {E-2} is the X-size. We multiply those to get the size of the map which we're copying.