cnovlite.c

来自「这是一个SIGMA方案的PMP播放器的UCLINUX程序,可播放DVD,VCD,」· C语言 代码 · 共 398 行 · 第 1/2 页

C
398
字号
/******************************************************************************//*  cnovlite.c : Implementation of the AnalogOverlay interface*  REALmagic Quasar Hardware Library*  Created by Aurelia Popa-Radu*  Copyright Sigma Designs Inc*  Sigma Designs Proprietary and confidential*  Created on 8/20/01*  Description:/******************************************************************************//****h* HwLib/CNovaLite_implementation * NAME *	CNovaLite_implementation * DESCRIPTION *  CNovaLite implementation of the IAnalogOverlay interface. *	NovaLite is the name of EM9038. Because EM9038 has no chroma key capability *	some procedures of IAnalogOverlay are empty   * COPYRIGHT *  Copyright Sigma Designs Inc *  Sigma Designs Proprietary and confidential/******************************************************************************/#include "pch.h"#if defined NOVALITE_OBJECT#include "ci2c.h"#include "cnovbase.h"#include "cnovlite.h"void CNovaLite__InitVtable(IAnalogOverlay* pIAnalogOverlay){	CNovaLite* this = (CNovaLite*) pIAnalogOverlay;	this->VTable.Write					= CNovaBase__Write;	this->VTable.Read					= CNovaBase__Read;	this->VTable.Write					= CNovaBase__Write;	this->VTable.Delete					= CNovaLite__Delete;	this->VTable.Init					= CNovaLite__Init;	this->VTable.SetRegistry			= CNovaLite__SetRegistry;	this->VTable.WriteREG12				= CNovaLite__WriteREG12;	this->VTable.ReadREG12				= CNovaLite__ReadREG12;	this->VTable.ProgramPLL				= CNovaLite__ProgramPLL;	this->VTable.InitAnalogMux			= CNovaLite__InitAnalogMux;	this->VTable.SetVGA					= CNovaLite__SetVGA;	this->VTable.SetTv					= CNovaLite__SetTv;	this->VTable.Test					= CNovaLite__Test;	// Initialize not implemented functions	this->VTable.SetDVCLKFrequency		= CNoNova__SetDVCLKFrequency;	this->VTable.IsVGAConnected			= CNoNova__IsVGAConnected;	this->VTable.GetHFreq				= CNoNova__GetHFreq;	this->VTable.GetDefaultCorrection	= CNoNova__GetDefaultCorrection;	this->VTable.SlaveShowAll			= CNoNova__SlaveShowAll;	this->VTable.SetVrdyDelay			= CNoNova__SetVrdyDelay;	this->VTable.GetVrdyDelay			= CNoNova__GetVrdyDelay;	this->VTable.SetJitterAdjustment	= CNoNova__SetJitterAdjustment;	this->VTable.GetJitterAdjustment	= CNoNova__GetJitterAdjustment;	this->VTable.MakeMask				= CNoNova__MakeMask;	this->VTable.Hide					= CNoNova__Hide;	this->VTable.SetChromaKey			= CNoNova__SetChromaKey;	this->VTable.ShowAll				= CNoNova__ShowAll;	this->VTable.StartAutoCalibration	= CNoNova__StartAutoCalibration;	this->VTable.StopAutoCalibration	= CNoNova__StopAutoCalibration;	this->VTable.ClearPulse				= CNoNova__ClearPulse;	this->VTable.DetectPulse			= CNoNova__DetectPulse;	this->VTable.UpperLower				= CNoNova__UpperLower;	this->VTable.UpdateColorKey			= CNoNova__UpdateColorKey;	this->VTable.SetMode				= CNoNova__SetMode;	this->VTable.SetVgaResolution		= CNoNova__SetVgaResolution;	this->VTable.SetVgaKey				= CNoNova__SetVgaKey;	this->VTable.GetVgaKey				= CNoNova__GetVgaKey;	this->VTable.SetVgaKey2				= CNoNova__SetVgaKey2;	this->VTable.SetColorCalibration	= CNoNova__SetColorCalibration;	this->VTable.SetOverrideRedUpper	= CNoNova__SetOverrideRedUpper;	this->VTable.GetOverrideRedUpper	= CNoNova__GetOverrideRedUpper;	this->VTable.SetOverrideRedLower	= CNoNova__SetOverrideRedLower;	this->VTable.GetOverrideRedLower	= CNoNova__GetOverrideRedLower;	this->VTable.SetOverrideGreenUpper	= CNoNova__SetOverrideGreenUpper;	this->VTable.GetOverrideGreenUpper	= CNoNova__GetOverrideGreenUpper;	this->VTable.SetOverrideGreenLower	= CNoNova__SetOverrideGreenLower;	this->VTable.GetOverrideGreenLower	= CNoNova__GetOverrideGreenLower;	this->VTable.SetOverrideBlueUpper	= CNoNova__SetOverrideBlueUpper;	this->VTable.GetOverrideBlueUpper	= CNoNova__GetOverrideBlueUpper;	this->VTable.SetOverrideBlueLower	= CNoNova__SetOverrideBlueLower;	this->VTable.GetOverrideBlueLower	= CNoNova__GetOverrideBlueLower;	// end initialize not implemented functions	this->lpVtbl = &this->VTable;}/****f* HwLib/CNovaLite__CreateInstance * USAGE *	NOT PRESENT in IAnalogOverlay interface *	void CNovaLite__CreateInstance(void **pv, DWORD dwInstance) * DESCRIPTION *	CNovaLite__CreateInstance - allocates memory for a new overlay object * PARAMETERS *	IN DWORD dwInstance - instance passed down by CreateInstance. *	OUT void** pv - points to a 32-bit variable that receives the pointer to object * SEE ALSO *   CNovaLite__CreateInstance/******************************************************************************/void CNovaLite__CreateInstance(void** ppv, DWORD dwInstance){    CNovaLite__New((CNovaLite**)ppv, TEXT("AnalogOverlay"), TRUE, dwInstance);}/****f* HwLib/CNovaLite__New * USAGE *	NOT PRESENT in IAnalogOverlay interface *	void CNovaLite__New(CNovaLite** ppCNovaLite, TCHAR *pName, BOOL bAllocate, DWORD dwInstance) * DESCRIPTION *	CNovaLite__New - allocates memory for a new overlay object and plays the role of *	the constructor in C++. * PARAMETERS *	OUT CNovaLite** ppCNovaLite - Points to a 32-bit variable that receives the pointer to object *	IN TCHAR *pName - pointer to string containing the name of the object - debug purposes. *	BOOL bAllocate - usually called with TRUE to allocate memory for object. *	               - if FALSE ppCNovaLite should point to an object already created. *	IN DWORD dwInstance - instance passed down by CreateInstance. * SEE ALSO *   IAnalogOverlay_Delete/******************************************************************************/void CNovaLite__New(CNovaLite** ppCNovaLite, TCHAR *pName, BOOL bAllocate, DWORD dwInstance){	CNovaLite* this = *ppCNovaLite;	if (bAllocate)	{		// Allocate CNovaLite		*ppCNovaLite = OSmalloc(sizeof(CNovaLite));		this = (CNovaLite*) *ppCNovaLite;		if(this == NULL)			return;		OSmemset(this, 0, sizeof(CNovaLite));	}	// Call CObject constructor with bAllocate = FALSE	CObject__New ((CObject**)ppCNovaLite, pName, FALSE, dwInstance);	CNovaLite__InitVtable((IAnalogOverlay*)this);}/****f* HwLib/CNovaLite__Delete * USAGE *	CNovaLite__Delete(IAnalogOverlay* pIAnalogOverlay, BOOL bDeleteObject) * DESCRIPTION *	CNovaLite__Delete is implementation for IAnalogOverlay_Delete - frees *	memory for the specified overlay object. *	IAnalogOverlay_Delete plays the role of the destructor in C++. * PARAMETERS *	IN IAnalogOverlay* pIAnalogOverlay - pointer to the object created by a previous *		call to CNovaLite__CreateInstance or CNovaLite__New. *	BOOL bDeleteObject - usually called with TRUE to free memory for object. *				   - if FALSE doesn't free any memory. * SEE ALSO *   CNovaLite__CreateInstance, CNovaLite__New/******************************************************************************/void CNovaLite__Delete(IAnalogOverlay* pIAnalogOverlay, BOOL bDeleteObject){	CNovaLite* this = (CNovaLite*) pIAnalogOverlay ;	if (this == NULL)		return;	// Call CObject Destructor	CObject__Delete ((IObject*)this, FALSE);	if (bDeleteObject)		OSfree(pIAnalogOverlay);}/****f* HwLib/CNovaLite__Init * USAGE *	void CNovaLite__Init(IAnalogOverlay* pIAnalogOverlay, DWORD* pAnalogOverlayId) * DESCRIPTION *	CNovaLite__Init implements IAnalogOverlay_Init - initialize the overlay object. *	It is called by CreateInstance. * PARAMETERS *	IN IAnalogOverlay* pIAnalogOverlay - pointer to the overlay object *	IN DWORD* pAnalogOverlayId - pointer to the overlay identifier, not used/******************************************************************************/void CNovaLite__Init(IAnalogOverlay* pIAnalogOverlay, DWORD* pAnalogOverlayId){	CNovaLite* this = (CNovaLite*) pIAnalogOverlay;	I2CPARAMS* pI2Cparams;	QueryInterface(this->m_dwInstance, IID_ISETI2CPIO, (void**)&(this->pISetI2CpIO));	ISetI2CpIO_GetI2C_params(this->pISetI2CpIO, (void**)&pI2Cparams);	this->m_dwData0 = pI2Cparams->m_dwData0;	this->m_dwData1 = pI2Cparams->m_dwData1;	this->m_dwDataIN = pI2Cparams->m_dwDataIN;	this->m_dwDataOUT = pI2Cparams->m_dwDataOUT;	this->m_dwClock0 = pI2Cparams->m_dwClock0;	this->m_dwClock1 = pI2Cparams->m_dwClock1;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?