Added new things, updated others

+ Tab in settings for cellCamera and cellGem related things, currently
includes setting camera type
+ cellCamera and cellGem initilization
+ Added cellCameraGetType
* Updated asmjit and ffmpeg
* Some minor optimizations
This commit is contained in:
Raul Tambre 2014-09-09 18:44:02 +03:00
parent a99c8e3c7c
commit 6029cc40f2
13 changed files with 117 additions and 37 deletions

View file

@ -1,4 +1,6 @@
#include "stdafx.h"
#include "Ini.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules.h"
#include "cellCamera.h"
@ -7,27 +9,29 @@ void cellCamera_init();
//Module cellCamera(0x0023, cellCamera_init);
Module *cellCamera = nullptr;
// Error Codes
enum
struct cellCameraInternal
{
CELL_CAMERA_ERROR_ALREADY_INIT = 0x80140801,
CELL_CAMERA_ERROR_NOT_INIT = 0x80140803,
CELL_CAMERA_ERROR_PARAM = 0x80140804,
CELL_CAMERA_ERROR_ALREADY_OPEN = 0x80140805,
CELL_CAMERA_ERROR_NOT_OPEN = 0x80140806,
CELL_CAMERA_ERROR_DEVICE_NOT_FOUND = 0x80140807,
CELL_CAMERA_ERROR_DEVICE_DEACTIVATED = 0x80140808,
CELL_CAMERA_ERROR_NOT_STARTED = 0x80140809,
CELL_CAMERA_ERROR_FORMAT_UNKNOWN = 0x8014080a,
CELL_CAMERA_ERROR_RESOLUTION_UNKNOWN = 0x8014080b,
CELL_CAMERA_ERROR_BAD_FRAMERATE = 0x8014080c,
CELL_CAMERA_ERROR_TIMEOUT = 0x8014080d,
CELL_CAMERA_ERROR_FATAL = 0x8014080f,
bool m_bInitialized;
cellCameraInternal()
: m_bInitialized(false)
{
}
};
cellCameraInternal cellCameraInstance;
int cellCameraInit()
{
UNIMPLEMENTED_FUNC(cellCamera);
cellCamera->Warning("cellCameraInit()");
if (cellCameraInstance.m_bInitialized)
return CELL_CAMERA_ERROR_ALREADY_INIT;
// TODO: Check if camera is connected, if not return CELL_CAMERA_ERROR_DEVICE_NOT_FOUND
cellCameraInstance.m_bInitialized = true;
return CELL_OK;
}
@ -61,9 +65,19 @@ int cellCameraGetDeviceGUID()
return CELL_OK;
}
int cellCameraGetType()
int cellCameraGetType(s32 dev_num, CellCameraType type)
{
UNIMPLEMENTED_FUNC(cellCamera);
cellCamera->Warning("cellCameraGetType(dev_num=%d, type_addr=0x%x)", dev_num, type);
if (Ini.CameraType.GetValue() == 1)
type = CELL_CAMERA_EYETOY;
else if (Ini.CameraType.GetValue() == 2)
type = CELL_CAMERA_EYETOY2;
else if (Ini.CameraType.GetValue() == 3)
type == CELL_CAMERA_USBVIDEOCLASS;
else
type = CELL_CAMERA_TYPE_UNKNOWN;
return CELL_OK;
}