I know this isn't really "Handheld hacking" but there isnt an amateur coding section in Console Hacking

I'll probably have this finished by tomorrow, I've been busy and stuff

Anyway, here's what I have so far
Code:
item slots:
25 acres 
6400 slots
5x5 acres
16x16 per acre

coordinates:
x and y
 the part we're using starts at (?) and goes up to (?)+ 4F or (?)+9E (anyone care to help me out here?)



formulation:
*set two registers to the coordinate value in the top left item slot (X and Y)
*search the map for an item, adding to a counter(A) for each slot searched
*once the item is found...use the counter for the following
*divide (A) by 256 to get acres, remainder=X quotient=Y 
*add to coordinates
*divide (A) by 5 to get rows and columns, remainder=X quotient=Y
*add to coordinates
*finally, divide (A) by 16 to get individual item slots, remainder=X quotient=Y
*add to coordinates to get final coordinates
* ?
*profit!

(I actually understand everything, I just don't know how the coordinates are structured, I probably made mistakes here cause I'm half asleep, but I know how it works...)
pretty hard doing all of this without a USBGecko or any way to view the game's code...but I just kinda guessed all of it, so sorry if I'm wrong about anything

oh and I forgot this game uses the z coordinate...would that affect anything? for example if you teleport from a lower area to a higher area, will you get stuck underground?