1
Scripting and Reverse Engineering / Re: [ff8] Edit the encounters on the world map
« on: 2016-11-23 16:54:20 »Thanks!
I don't know if it happens everywhere, but the X variable should be ANDed to 7 bits (0x7F). Do you know for what this one bit is responsible for?
My bad... The value is calculated from block positions.
the X is treated as two sequential rows so the math goes:
Code: [Select]
X = rowBlockAmount, which is 4 times segment amount so 4 * 32 = 128 or 0x80. The last bit tells which row of the two we are on, first or second. The range of top row is from 0x00 - 0x7F and second row's 0x80 - 0xFF.
Y is incremented whenever X goes over 0xFF.
Hope this image helps more than my blather (Open in new tab for seeing text)