# pspctrl.h

Go to the documentation of this file.

    00001 /*
    00002  * PSP Software Development Kit - http://www.pspdev.org
    00003  * -----------------------------------------------------------------------
    00004  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
    00005  *
    00006  * pspctrl.h - Prototypes for the sceCtrl library.
    00007  *
    00008  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
    00009  * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
    00010  * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
    00011  *
    00012  * $Id: pspctrl.h 698 2005-07-20 06:08:06Z warren $
    00013  */
    00014
    00015 /* Note: Some of the structures, types, and definitions in this file were
    00016    extrapolated from symbolic debugging information found in the Japanese
    00017    version of Puzzle Bobble. */
    00018
    00019 #ifndef __CTRL_H__
    00020 #define __CTRL_H__
    00021
    00022 #ifdef __cplusplus
    00023 extern "C" {
    00024 #endif
    00025
    00028
    00034 enum PspCtrlButtons
    00035 {
    00037         PSP_CTRL_SELECT     = 0x000001,
    00039         PSP_CTRL_START      = 0x000008,
    00041         PSP_CTRL_UP         = 0x000010,
    00043         PSP_CTRL_RIGHT      = 0x000020,
    00045         PSP_CTRL_DOWN           = 0x000040,
    00047         PSP_CTRL_LEFT           = 0x000080,
    00049         PSP_CTRL_LTRIGGER   = 0x000100,
    00051         PSP_CTRL_RTRIGGER   = 0x000200,
    00053         PSP_CTRL_TRIANGLE   = 0x001000,
    00055         PSP_CTRL_CIRCLE     = 0x002000,
    00057         PSP_CTRL_CROSS      = 0x004000,
    00059         PSP_CTRL_SQUARE     = 0x008000,
    00061         PSP_CTRL_HOME       = 0x010000,
    00063         PSP_CTRL_HOLD       = 0x020000,
    00065         PSP_CTRL_NOTE       = 0x800000,
    00066 };
    00067
    00069 enum PspCtrlMode
    00070 {
    00071         /* Digitial. */
    00072         PSP_CTRL_MODE_DIGITAL = 0,
    00073         /* Analog. */
    00074         PSP_CTRL_MODE_ANALOG
    00075 };
    00076
    00078 typedef struct SceCtrlData {
    00080         unsigned int    TimeStamp;
    00082         unsigned int    Buttons;
    00084         unsigned char   Lx;
    00086         unsigned char   Ly;
    00088         unsigned char   Rsrv[6];
    00089 } SceCtrlData;
    00090
    00091 typedef struct SceCtrlLatch {
    00092         unsigned int    uiMake;
    00093         unsigned int    uiBreak;
    00094         unsigned int    uiPress;
    00095         unsigned int    uiRelease;
    00096 } SceCtrlLatch;
    00097
    00105 int sceCtrlSetSamplingCycle(int cycle);
    00106
    00114 int sceCtrlGetSamplingCycle(int *pcycle);
    00115
    00123 int sceCtrlSetSamplingMode(int mode);
    00124
    00132 int sceCtrlGetSamplingMode(int *pmode);
    00133
    00134 int sceCtrlPeekBufferPositive(SceCtrlData *pad_data, int count);
    00135
    00136 int sceCtrlPeekBufferNegative(SceCtrlData *pad_data, int count);
    00137
    00154 int sceCtrlReadBufferPositive(SceCtrlData *pad_data, int count);
    00155
    00156 int sceCtrlReadBufferNegative(SceCtrlData *pad_data, int count);
    00157
    00158 int sceCtrlPeekLatch(SceCtrlLatch *latch_data);
    00159
    00160 int sceCtrlReadLatch(SceCtrlLatch *latch_data);
    00161
    00164 #ifdef __cplusplus
    00165 }
    00166 #endif
    00167
    00168 #endif