static void glw_ps3_mainloop(glw_ps3_t *gp) { int currentBuffer = 0; TRACE(TRACE_INFO, "GLW", "Entering mainloop"); #if 0 int r = ioPadSetPortSetting(6, 0xffffffff); TRACE(TRACE_ERROR, "PS3PAD", "portsetting=0x%x", r); #endif sysRegisterCallback(EVENT_SLOT0, eventHandle, gp); while(!gp->stop) { handle_pads(gp); handle_kb(gp); waitFlip(); drawFrame(gp, currentBuffer, 1); flip(gp, currentBuffer); currentBuffer = !currentBuffer; sysCheckCallback(); } waitFlip(); drawFrame(gp, currentBuffer, 0); flip(gp, currentBuffer); currentBuffer = !currentBuffer; sysUnregisterCallback(EVENT_SLOT0); }
static int glw_ps3_init(glw_ps3_t *gp) { init_screen(gp); glw_rsx_init_context(&gp->gr); ioPadInit(7); ioKbInit(MAX_KB_PORT_NUM); int i; for(i = 0; i < 7; i++) ioPadSetPortSetting(i, 0x2); if(sysUtilGetSystemParamInt(0x112, &gp->button_assign)) gp->button_assign = 1; return 0; }