Tilemap Location of mysprite equation

I’m in a tight spot in a makecode project, and I wont go over all the details right here in the topic summary, but I basically need to know the math to convert pixel coordinates to tile coordinates. like the tilemap location of mysprite block uses. I tried this equation thinking it would basically be the same: (truncate ((Amount - 8) / 16)) but it isnt close to the same thing, please if one of the makecode devs are reading this, could you please tell me what the equation is for this block? I’m definitely not a math expert!

The exact code we use is right here: pxt-common-packages/libs/game/sprite.ts at 834a7016536dc2c8ac314e85e4e91c24654e6dd9 · microsoft/pxt-common-packagestiles.getTileLocation is just the ‘tilemap col row ’ block. x/y are the center of the sprite if that impacts what you’re using it for, and the important bit - the >> scene.tileMap.scale expresses the same as dividing by the tile size ignoring the remainder – like what you have if you remove the -8, assuming you are using 16x16 tiles.