A few corrections: (from Joseph Rossi)
The number ANDed is missing a couple of zeroes. It should be #%11110000. Or you could use hexidecimal #$F0.
Dale's code would be the first step in getting the proper index to be put into either the y or x register to then get the tile collision value in one of the collision tables (e.g. collisionTable,y), but it's missing some steps to get you the x tile position. Let's say that the tile your are looking at is (5, 9), Dale's code will give you in hexidecimal #$50. To get it to become a 5, you need to use LSR 4 times before storing it into temp1 or whatever variable you're using. So the code should look like this:
Code:
LDA tileX
AND #%11110000
LSR
LSR
LSR
LSR
STA temp1
If you are trying to get the index for the for the collision table, the code should look like this:
Code:
LDA tileX
AND #%11110000
LSR
LSR
LSR
LSR
STA temp1
LDA tileY
AND #%11110000
ORA temp1
TAY
LDA collisionTable,y
Additionally you would have to do some kind of a check to make sure you are looking at the correct collision table.
Lastly, and I'm away from my computer right now, so I might not get this part 100% right, but tileX and tileY don't always contain the values of the pixel position of the tile collision. This might not be true for all modules but was definitely true in the platformer module. The issue is either just with tile type 01 or all tile types after 01. I think it's the former, but I forget off the top of my head.
The problem is that the way the tile collision code works is something like this: it checks all four of the object collision points, storing the results into tempA to tempD as it goes. It then checks if any of those tiles were tile type 01 and if so, it goes ahead and does the solid collision stuff. If it wasn't, it checks the collision points again, this time breaking to handle the collision code if the collision type is not zero.
Again, I'm writing this from memory, so I might have some details backwards, but the point is that there is an issue with tileX and tileY not having the correct values for a certain tile type or certain tile types. I think it's just tile type 01 that will always give you the coordinate of the lower right collision point because that is the last point that was checked even though the tile collision in question may have been one of the other 3 points.