utton
					// stretch across right-hand half above X O buttons
					if (x > w - r*3) 
						b |= 0x40;
				}
				else if (x < w/2 && x < r*6)
				{
					// stick

					mask = 0xf; // dpad
					var cx = 0 + r*3;
					var cy = h - r*3;

					deadzone = r/3;
					var dx = x - cx;
					var dy = y - cy;

					if (abs(dx) > abs(dy) * 0.6) // horizontal 
					{
						if (dx < -deadzone) b |= 0x1;
						if (dx > deadzone) b |= 0x2;
					}
					if (abs(dy) > abs(dx) * 0.6) // vertical
					{
						if (dy < -deadzone