Game Boy >> C/C++
Input(Wait)
參考資訊:
1. bgb
2. doc
3. gbdk_playground
等待Input按下
UINT8 waitpad(UINT8 mask);
第一個參數是要等待的按鍵(支援組合鍵)
回傳值為按鍵
等待Input釋放
void waitpadup(void)
main.c
#include <stdio.h> #include <gb/gb.h> void main(void) { while (1) { waitpad(J_START); printf("Start Pressed\n"); waitpad(J_A); printf("A Pressed\n"); waitpadup(); printf("A Released\n"); } }
完成