Ejemplo n.º 1
0
static void* ps3_input_init(void)
{
   cellPadInit(MAX_PADS);
#ifdef HAVE_MOUSE
   cellMouseInit(MAX_MICE);
#endif

   return (void*)-1;
}
Ejemplo n.º 2
0
static void* ps3_input_init(void)
{
   ps3_input_t *ps3 = (ps3_input_t*)calloc(1, sizeof(*ps3));
   if (!ps3)
      return NULL;

   cellPadInit(MAX_PADS);
#ifdef HAVE_MOUSE
   cellMouseInit(MAX_MICE);
#endif

   return ps3;
}
Ejemplo n.º 3
0
static void* ps3_input_init(void)
{
   ps3_input_t *ps3 = (ps3_input_t*)calloc(1, sizeof(*ps3));
   if (!ps3)
      return NULL;

   ps3->joypad = input_joypad_init_driver(g_settings.input.joypad_driver);

   if (ps3->joypad)
      ps3->joypad->init();

#ifdef HAVE_MOUSE
   cellMouseInit(MAX_MICE);
#endif
   return ps3;
}
Ejemplo n.º 4
0
static void* ps3_input_init(void)
{
   settings_t *settings = config_get_ptr();
   ps3_input_t *ps3 = (ps3_input_t*)calloc(1, sizeof(*ps3));
   if (!ps3)
      return NULL;

   ps3->joypad = input_joypad_init_driver(settings->input.joypad_driver, ps3);

   if (ps3->joypad)
      ps3->joypad->init(ps3);

#ifdef HAVE_MOUSE
   cellMouseInit(MAX_MICE);
#endif
   return ps3;
}
Ejemplo n.º 5
0
static void* ps3_input_init(void)
{
   cellPadInit(MAX_PADS);
#ifdef HAVE_MOUSE
   cellMouseInit(MAX_MICE);
#endif

   for(unsigned i = 0; i < MAX_PLAYERS; i++)
      if (driver.input->set_keybinds)
         driver.input->set_keybinds(driver.input_data, 0, i, 0,
               (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS));

   for(unsigned i = 0; i < MAX_PADS; i++)
   {
      unsigned keybind_action = 0;

      switch (g_settings.input.dpad_emulation[i])
      {
         case ANALOG_DPAD_LSTICK:
            keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
            break;
         case ANALOG_DPAD_RSTICK:
            keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK);
            break;
         case ANALOG_DPAD_NONE:
            keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE);
            break;
         default:
            break;
      }

      if (keybind_action)
         if (driver.input->set_keybinds)
            driver.input->set_keybinds(driver.input_data, 0, i, 0,
                  keybind_action);
   }

   return (void*)-1;
}
Ejemplo n.º 6
0
//-----------------------------------------------------------------------------
// Description: Platform specific input initialization
// Parameters:	pPlatformData - Platform specific data
// Returns:
// Notes:
//-----------------------------------------------------------------------------
bool FWInput::platformInit(void *pPlatformData)
{
	FWInputDevicePad		*pPad;
	FWInputDeviceKeyboard	*pKeybd;
	FWInputDeviceMouse		*pMouse;
	long				i;

	// stop unused parameter warning
	(void)pPlatformData;

	cellPadInit(FW_MAX_PAD_NUM);

	for(i = 0; i < FW_MAX_PAD_NUM; i ++)
	{
		sOldPadStatus[i] = 0;
		pPad = new FWInputDevicePad((void *)new FWCellPadInfo(i));
	}

	cellKbInit(FW_MAX_KEYBD_NUM);

	for(i = 0; i < FW_MAX_KEYBD_NUM; i ++)
	{
		sOldKeybdStatus[i] = 0;
		pKeybd = new FWInputDeviceKeyboard((void *)i);

		cellKbSetCodeType(i, CELL_KB_CODETYPE_RAW);
	}

	cellMouseInit(FW_MAX_MOUSE_NUM);

	for(i = 0; i < FW_MAX_MOUSE_NUM; i ++)
	{
		sOldMouseStatus[i] = 0;
		pMouse = new FWInputDeviceMouse((void *)i);
	}

	return true;
}
Ejemplo n.º 7
0
static SDL_VideoDevice*	CELL_CreateDevice		(int devindex)
{
	/* Allocate memory for sdl video device */
	CELL_VideoDevice = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
	if(CELL_VideoDevice)
	{
		SDL_memset(CELL_VideoDevice, 0, (sizeof *CELL_VideoDevice));
		CELL_VideoDevice->hidden = &CELL_Video;
		SDL_memset(&CELL_Video, 0, sizeof(CELL_Video));
	}
	else
	{
		SDL_OutOfMemory();
		return(0);
	}

	/* Set the function pointers */
	//General
	CELL_VideoDevice->VideoInit = CELL_VideoInit;
	CELL_VideoDevice->ListModes = CELL_ListModes;
	CELL_VideoDevice->SetVideoMode = CELL_SetVideoMode;
	//ToggleFullScreen(this, int on)
	//UpdateMouse(this)
	//SDL_Overlay *(*CreateYUVOverlay)(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
	CELL_VideoDevice->SetColors = CELL_SetColors;
	CELL_VideoDevice->UpdateRects = CELL_UpdateRects;
	CELL_VideoDevice->VideoQuit = CELL_VideoQuit;

	//Accel
	CELL_VideoDevice->AllocHWSurface = CELL_AllocHWSurface;
	//int (*CheckHWBlit)(_THIS, SDL_Surface *src, SDL_Surface *dst);
	CELL_VideoDevice->FillHWRect = CELL_FillHWRect;
	//int (*SetHWColorKey)(_THIS, SDL_Surface *surface, Uint32 key);
	//int (*SetHWAlpha)(_THIS, SDL_Surface *surface, Uint8 value);
	CELL_VideoDevice->LockHWSurface = CELL_LockHWSurface;
	CELL_VideoDevice->UnlockHWSurface = CELL_UnlockHWSurface;
	CELL_VideoDevice->FlipHWSurface = CELL_FlipHWSurface;
	CELL_VideoDevice->FreeHWSurface = CELL_FreeHWSurface;

	//Gamma
	//int (*SetGamma)(_THIS, float red, float green, float blue);
	//int (*GetGamma)(_THIS, float *red, float *green, float *blue);
	//int (*SetGammaRamp)(_THIS, Uint16 *ramp);
	//int (*GetGammaRamp)(_THIS, Uint16 *ramp);

	//OpenGL
	//int (*GL_LoadLibrary)(_THIS, const char *path);
	//void* (*GL_GetProcAddress)(_THIS, const char *proc);
	//int (*GL_GetAttribute)(_THIS, SDL_GLattr attrib, int* value);
	//int (*GL_MakeCurrent)(_THIS);
	//void (*GL_SwapBuffers)(_THIS);

	//Window manager
	CELL_VideoDevice->SetCaption = CELL_CAPTION_Set;
	//void (*SetIcon)(_THIS, SDL_Surface *icon, Uint8 *mask);
	//int (*IconifyWindow)(_THIS);
	//SDL_GrabMode (*GrabInput)(_THIS, SDL_GrabMode mode);
	//int (*GetWMInfo)(_THIS, SDL_SysWMinfo *info);

	//Cursor
	CELL_VideoDevice->FreeWMCursor = CELL_CURSOR_Free;
	CELL_VideoDevice->CreateWMCursor = CELL_CURSOR_Create;
	CELL_VideoDevice->ShowWMCursor = CELL_CURSOR_Show;
	//void (*WarpWMCursor)(_THIS, Uint16 x, Uint16 y);
	CELL_VideoDevice->MoveWMCursor = CELL_CURSOR_Move;
	//void (*CheckMouseMode)(_THIS);

	//Events
	CELL_VideoDevice->InitOSKeymap = CELL_EVENTS_Init;
	CELL_VideoDevice->PumpEvents = CELL_EVENTS_Pump;

	//Clean up
	CELL_VideoDevice->free = CELL_DeleteDevice;

	/* Initialize CELL input libs */
	cellKbInit(1);
	cellMouseInit(1);
	cellPadInit(7);

	/* Setup PSGL */
	CELL_PSGL_Setup(CELL_VideoDevice);

	/* Read the RC File */
	CELL_RC_GetData();
	return CELL_VideoDevice;
}