   megadrive_read_button(MEGADRIVE_BUTTON_START, MEGADRIVE_DATA_START_C_PIN);
   megadrive_read_button(MEGADRIVE_BUTTON_A, MEGADRIVE_DATA_A_B_PIN);
   digitalWrite(MEGADRIVE_SELECT_PIN, HIGH); 
+  //wait for next frame
   delay(16);
   delayMicroseconds(666);
 }

  snes_read_button(SNES_BUTTON_X);
  snes_read_button(SNES_BUTTON_L);
  snes_read_button(SNES_BUTTON_R);

  delay(16);
  delayMicroseconds(466); 
  Serial.println(hat_direction, DEC);
}

void loop() {


void setup() {
  megadrive_read_buttons();
}

void snes_read_button_raw(int button_index){
