extern dword ctrl_hprm_raw(void) { u32 key = 0; /* if(xrKernelDevkitVersion() >= 0x02000010) return 0;*/ if (!xrHprmIsRemoteExist()) return 0; if (xr_lock(&hprm_l) >= 0) { xrHprmPeekCurrentKey(&key); xr_unlock(&hprm_l); } return (dword) key; }
extern dword ctrl_read_cont(void) { SceCtrlData ctl; xrCtrlReadBufferPositive(&ctl, 1); #ifdef ENABLE_HPRM if (hprmenable && xrHprmIsRemoteExist()) { u32 key; if (xr_lock(&hprm_l) >= 0) { xrHprmPeekCurrentKey(&key); xr_unlock(&hprm_l); if (key > 0) { switch (key) { case PSP_HPRM_FORWARD: if (key == lastkhprmkey) break; lastkhprmkey = key; return CTRL_FORWARD; case PSP_HPRM_BACK: if (key == lastkhprmkey) break; lastkhprmkey = key; return CTRL_BACK; case PSP_HPRM_PLAYPAUSE: if (key == lastkhprmkey) break; lastkhprmkey = key; return CTRL_PLAYPAUSE; } } else lastkhprmkey = 0; } } #endif last_btn = ctl.Buttons; last_tick = ctl.TimeStamp; return last_btn; }
int freq_lock() { return xr_lock(&freq_l); }
static inline int cache_lock(void) { // dbg_printf(d, "%s", __func__); return xr_lock(&cacher_locker); }
static void music_lock(void) { xr_lock(&music_l); }
/** * 加锁 */ int generic_lock(void) { return xr_lock(&generic_l); }