d();
			}
		}
	}

	
	// gamepad  https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
	// (sets bits in pico8_buttons[])
	function p8_update_gamepads() {
		var threshold = 0.3;
		var max_players = 8;
		var gps = navigator.getGamepads() || navigator.webkitGetGamepads();

		if (!gps) return;

		pico8_gamepads.count = gps.length;

		for (var i = 0; i < gps.length && i < max_players; i++) {
  			var gp = gps[i];
			if (gp && gp.axes && gp.buttons)
			{
				pico8_buttons[i] = 0;

		