// Sdram.h: interface for the CSdram class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SDRAM_H__4BA57DB7_F4BE_4CF5_9F22_5A4830F8107D__INCLUDED_)
#define AFX_SDRAM_H__4BA57DB7_F4BE_4CF5_9F22_5A4830F8107D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CSdram  
{
public:
	CSdram();
	virtual ~CSdram();

	BOOL Init(int iBlockSize, int iCacheSize);
	void Free();

	void SetPage(int iAddressHi, int iAddressLo);
	inline unsigned char * GetPage()	{	return m_pPage;	}

	void SetBuffer(unsigned char iAddress, unsigned char * pData, int iLength);
	void SetString(unsigned char iAddress, unsigned char * pData, int iLength);
	inline unsigned char * GetBuffer(unsigned char iAddress)	{	return (m_pPage + iAddress);	}
	inline void SetVal(unsigned char iAddress, unsigned char iVal)	{	m_pPage[iAddress] = iVal;	}
	inline unsigned char GetVal(unsigned char iAddress)	{	return m_pPage[iAddress];	}
	
	inline unsigned char * GetBlock()	{	return m_pBlock;	}
	inline unsigned char * GetCache()	{	return m_pCache;	}

protected:
	unsigned char * m_pCache;
	unsigned char * m_pBlock;
	unsigned char * m_pPage;
};

#endif // !defined(AFX_SDRAM_H__4BA57DB7_F4BE_4CF5_9F22_5A4830F8107D__INCLUDED_)
