「チュートリアル/基本的なプログラム/キー入力」の編集履歴(バックアップ)一覧はこちら

チュートリアル/基本的なプログラム/キー入力」(2010/09/13 (月) 11:28:41) の最新版変更点

追加された行は緑色になります。

削除された行は赤色になります。

#asciiart(blockquote){ #define printf pspDebugScreenPrintf int main(void) { //コントローラーの状態を保存する構造体 SceCtrlData pad; pspDebugScreenInit(); SetupCallbacks(); sceCtrlSetSamplingCycle(0); //アナログパットの方つかうよ sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG); while(1){ pspDebugScreenSetXY(0, 2); //押されてるボタン調べる sceCtrlReadBufferPositive(&pad, 1); //アナログスティックのx座標 printf("Analog X = %d ", pad.Lx); //アナログのy座標 printf("Analog Y = %d \n", pad.Ly); if (pad.Buttons != 0){ if (pad.Buttons & PSP_CTRL_SQUARE){ //四角ボタン押されてるときの処理 printf("Square pressed \n"); } if (pad.Buttons & PSP_CTRL_TRIANGLE){ //三角ボタン押されてるときの処理 以下同じ printf("Triangle pressed \n"); } if (pad.Buttons & PSP_CTRL_CIRCLE){ printf("Cicle pressed \n"); } if (pad.Buttons & PSP_CTRL_CROSS){ printf("Cross pressed \n"); } if (pad.Buttons & PSP_CTRL_UP){ printf("Up pressed \n"); } if (pad.Buttons & PSP_CTRL_DOWN){ printf("Down pressed \n"); } if (pad.Buttons & PSP_CTRL_LEFT){ printf("Left pressed \n"); } if (pad.Buttons & PSP_CTRL_RIGHT){ printf("Right pressed \n"); } if (pad.Buttons & PSP_CTRL_START){ printf("Start pressed \n"); } if (pad.Buttons & PSP_CTRL_SELECT){ printf("Select pressed \n"); } if (pad.Buttons & PSP_CTRL_LTRIGGER){ printf("L-trigger pressed \n"); } if (pad.Buttons & PSP_CTRL_RTRIGGER){ printf("R-trigger pressed \n"); } } } sceKernelExitGame(); return 0; } }
#define printf pspDebugScreenPrintf int main(void) { //コントローラーの状態を保存する構造体 SceCtrlData pad; pspDebugScreenInit(); SetupCallbacks(); sceCtrlSetSamplingCycle(0); //アナログパットの方つかうよ sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG); while(1){ pspDebugScreenSetXY(0, 2); //押されてるボタン調べる sceCtrlReadBufferPositive(&pad, 1); //アナログスティックのx座標 printf("Analog X = %d ", pad.Lx); //アナログのy座標 printf("Analog Y = %d \n", pad.Ly); if (pad.Buttons != 0){ if (pad.Buttons & PSP_CTRL_SQUARE){ //四角ボタン押されてるときの処理 printf("Square pressed \n"); } if (pad.Buttons & PSP_CTRL_TRIANGLE){ //三角ボタン押されてるときの処理 以下同じ printf("Triangle pressed \n"); } if (pad.Buttons & PSP_CTRL_CIRCLE){ printf("Cicle pressed \n"); } if (pad.Buttons & PSP_CTRL_CROSS){ printf("Cross pressed \n"); } if (pad.Buttons & PSP_CTRL_UP){ printf("Up pressed \n"); } if (pad.Buttons & PSP_CTRL_DOWN){ printf("Down pressed \n"); } if (pad.Buttons & PSP_CTRL_LEFT){ printf("Left pressed \n"); } if (pad.Buttons & PSP_CTRL_RIGHT){ printf("Right pressed \n"); } if (pad.Buttons & PSP_CTRL_START){ printf("Start pressed \n"); } if (pad.Buttons & PSP_CTRL_SELECT){ printf("Select pressed \n"); } if (pad.Buttons & PSP_CTRL_LTRIGGER){ printf("L-trigger pressed \n"); } if (pad.Buttons & PSP_CTRL_RTRIGGER){ printf("R-trigger pressed \n"); } } } sceKernelExitGame(); return 0; }

表示オプション

横に並べて表示:
変化行の前後のみ表示: