void control_update() { psx_read_gamepad(); uint16_t read = psx_buttons(); button_changed = button_state ^ read; button_state = read; }
Tetris::run() { uint8_t running = 1; newGame(); while (running) { generate(); void psx_read_gamepad(); buttons = psx_buttons(); if (buttons & PSB_PAD_UP) rotate(); else if (buttons & PSB_PAD_DOWN) down(); else if (buttons & PSB_PAD_LEFT) left(); else if (buttons & PSB_PAD_RIGHT) right(); else if (buttons & PSB_TRIANGLE) running = 0; } }
byte PS2Pad::button(word button) { uint16_t buttons = psx_buttons(); return ((buttons & button) > 0); }