GBDKライブラリドキュメント
GBDK libraries documentation

Prev
5章 ライブラリ
Chapter 5.Libraries

Next

ジョイパッド - gb.h
Joypad - gb.h

関数
Functions

joypad / waitpad / waitpadup
joypad / waitpad / waitpadup

/* Joypad bits */

#define	J_START      0x80U
#define	J_SELECT     0x40U
#define	J_B          0x20U
#define	J_A          0x10U
#define	J_DOWN       0x08U
#define	J_UP         0x04U
#define	J_LEFT       0x02U
#define	J_RIGHT      0x01U

UBYTE
joypad(void);

UBYTE
waitpad(UBYTE mask);

void
waitpadup(void);

解説
Description

joypad()関数は、ジョイパッドの現在のステータスを読みます。 それは、現在のスレッドの制御をブロックしません。 関数によって返されたジョイパッドステータスは、上に与えられた定義によって、各ボタンのために1ビットを使用します。
The joypad() function reads the current status of the joypad.It does not block the current thread of control.The joypad status returned by the function uses one bit for each button, according to the definitions given above.

waitpad()関数は、押される与えられたマスクからの任意のボタンを待ちます。 waitpadup()関数は、ボタンがすべてリリースされるのを待ちます。
The waitpad() function waits for any button from a given mask to be pushed.The waitpadup() function waits for all buttons to be released.

引数
Parameters

mask:待つボタンのセット。
mask: set of buttons to wait for.

返り値
Returns

joypad()と\waitpadup()関数はジョイパッドステータスを返します。
The joypad() and \waitpadup() functions return the joypad status.



Prev
ホーム
Home

Next
グラフィックス/タイル関数
Graphics/Tile functions

Up
ハードウェアレジスタ-hardware.h
Hardware registers - hardware.h
 1