/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/include/sgx/core/platform/hwplatform.hpp

*/

#ifndef SGX_CORE_PLATFORM_HPP
#define SGX_CORE_PLATFORM_HPP 

#define SGX_KILOBYTES   (1024)
#define SGX_MEGABYTES   (1024*1024)

class CHardwarePlatform {
public:
    typedef enum { eBigEndian=0, eLittleEndian=1 } tEndian;
    typedef enum { eLandscape=0, ePortrait=1 } tOrientation;
    typedef enum { eDefault=0, ePAL, eNTSC, ePAL_M, eSECAM, eSIF, eHD, eUnused } tScreenFormat;
    typedef enum { eVGA=0, eVGA43=0, eVGA169, eXGA, e720P, eWXGA, eSXGA, eWXGA169 } tVideoStandard;
	
public:
    static CHardwarePlatform   *get();

    virtual const char *	getPlatformName() const =0;
    virtual const char *	getPlatformID() const =0;
    virtual const char *	getDocsURL() const =0;
    virtual const char *	getDevelopmentURL() const =0;
    virtual tREAL32			getDiscAccessSpeed() const =0;     // in seconds
    virtual tREAL32			getDiscReadSpeed() const =0;       // in bytes/second
    virtual tEndian			getEndian() const =0;
    virtual tUINT32			getNumCPUs() const =0;
    virtual tUINT32			getCPUSpeed(tUINT32 type=0) const =0;
    virtual tUINT32			getNumMemoryBanks() const =0;
    virtual tUINT32			getMemorySize(tUINT32 type=0) const =0;
    virtual void			getVideoResolution(sgxRect2i &rc, const tScreenFormat fmt=eDefault) const =0;

    virtual tScreenFormat	getVideoDefaultFormat() const ;
    virtual tOrientation	getVideoOrientation(const tScreenFormat fmt=eDefault) const ;
    virtual void			getCRLF(tBYTE *) const ;

    virtual void			dumpStats() const ;

	
	static void				getVideoStandard(sgxRect2i &rc, const tVideoStandard std);

	static sgxHashMap<tUINT32, const CHardwarePlatform *>	m_PlatformList;
	static void registerPlatform(const CHardwarePlatform *pPlatform);
	static const CHardwarePlatform *getPlatform(const char *pName);

protected:
    CHardwarePlatform();

	static CHardwarePlatform   *ms_pSingleton;
};

#endif /* SGX_CORE_PLATFORM_HPP */