From f2cbd883a6fff524a03208bae80af48c47f3633f Mon Sep 17 00:00:00 2001 From: "wrenczes@gmail.com" Date: Fri, 28 Jan 2011 06:03:52 +0000 Subject: [PATCH] Apply LF line endings as an SVN property, this time on the JGE source files. --- JGE/include/DebugRoutines.h | 118 +- JGE/include/Encoding.h | 40 +- JGE/include/JAnimator.h | 828 ++-- JGE/include/JApp.h | 176 +- JGE/include/JCooleyesMP3.h | 124 +- JGE/include/JDistortionMesh.h | 94 +- JGE/include/JFileSystem.h | 286 +- JGE/include/JGBKFont.h | 384 +- JGE/include/JGameLauncher.h | 114 +- JGE/include/JGameObject.h | 518 +-- JGE/include/JLBFont.h | 374 +- JGE/include/JMD2Model.h | 510 +-- JGE/include/JOBJModel.h | 164 +- JGE/include/JParticle.h | 210 +- JGE/include/JParticleEffect.h | 292 +- JGE/include/JParticleEmitter.h | 442 +-- JGE/include/JParticleSystem.h | 228 +- JGE/include/JRenderer.h | 1296 +++---- JGE/include/JSocket.h | 60 +- JGE/include/JSpline.h | 334 +- JGE/include/JSprite.h | 974 ++--- JGE/include/JTTFont.h | 614 +-- JGE/include/Vector2D.h | 146 +- JGE/include/Vector3D.h | 190 +- JGE/include/hge/hgecolor.h | 162 +- JGE/include/hge/hgedistort.h | 140 +- JGE/include/hge/hgefont.h | 186 +- JGE/include/hge/hgeparticle.h | 330 +- JGE/include/hge/hgerect.h | 70 +- JGE/include/hge/hgevector.h | 114 +- JGE/include/unzip/crypt.h | 264 +- JGE/include/unzip/ioapi.h | 150 +- JGE/include/unzip/iowin32.h | 42 +- JGE/include/unzip/mztools.h | 62 +- JGE/include/unzip/unzip.h | 712 ++-- JGE/include/unzip/zip.h | 470 +-- JGE/include/vram.h | 108 +- JGE/src/Encoding.cpp | 6446 ++++++++++++++++---------------- JGE/src/JAnimator.cpp | 822 ++-- JGE/src/JCooleyesMP3.cpp | 662 ++-- JGE/src/JDistortionMesh.cpp | 242 +- JGE/src/JGBKFont.cpp | 1294 +++---- JGE/src/JGameObject.cpp | 668 ++-- JGE/src/JGfx.cpp | 4518 +++++++++++----------- JGE/src/JGui.cpp | 514 +-- JGE/src/JMD2Model.cpp | 1354 +++---- JGE/src/JOBJModel.cpp | 444 +-- JGE/src/JParticle.cpp | 492 +-- JGE/src/JParticleEffect.cpp | 778 ++-- JGE/src/JParticleEmitter.cpp | 646 ++-- JGE/src/JParticleSystem.cpp | 248 +- JGE/src/JSpline.cpp | 406 +- JGE/src/JSprite.cpp | 1022 ++--- JGE/src/JTTFont.cpp | 1298 +++---- JGE/src/Vector2D.cpp | 162 +- JGE/src/hge/hgecolor.cpp | 178 +- JGE/src/hge/hgedistort.cpp | 504 +-- JGE/src/hge/hgefont.cpp | 720 ++-- JGE/src/hge/hgeparticle.cpp | 612 +-- JGE/src/hge/hgepmanager.cpp | 182 +- JGE/src/hge/hgerect.cpp | 90 +- JGE/src/hge/hgevector.cpp | 138 +- JGE/src/unzip/ChangeLogUnzip | 134 +- JGE/src/unzip/Makefile | 50 +- JGE/src/unzip/crypt.h | 264 +- JGE/src/unzip/ioapi.c | 354 +- JGE/src/unzip/ioapi.h | 150 +- JGE/src/unzip/iowin32.c | 540 +-- JGE/src/unzip/iowin32.h | 42 +- JGE/src/unzip/miniunz.c | 1170 +++--- JGE/src/unzip/minizip.c | 840 ++--- JGE/src/unzip/mztools.c | 562 +-- JGE/src/unzip/mztools.h | 62 +- JGE/src/unzip/unzip.c | 3196 ++++++++-------- JGE/src/unzip/unzip.h | 712 ++-- JGE/src/unzip/zip.c | 2438 ++++++------ JGE/src/unzip/zip.h | 470 +-- JGE/src/vram.c | 550 +-- 78 files changed, 23650 insertions(+), 23650 deletions(-) diff --git a/JGE/include/DebugRoutines.h b/JGE/include/DebugRoutines.h index ef0a3f496..6ac61edb2 100644 --- a/JGE/include/DebugRoutines.h +++ b/JGE/include/DebugRoutines.h @@ -1,59 +1,59 @@ -#ifndef DEBUGROUTINES_H -#define DEBUGROUTINES_H - -// dirty, but I get OS header includes this way -#include "JGE.h" - -#include -#include -#include -#include -#include -#include - -#if defined (WIN32) || defined (LINUX) -#ifdef _DEBUG - -using namespace std; - -template -std::string ToHex(T* pointer) -{ - std::ostringstream stream; - stream << std::hex << showbase << setfill('0') << setw(8) << (int) pointer; - return stream.str(); -} - - -#ifndef QT_CONFIG -#define DebugTrace(inString) \ -{ \ - std::ostringstream stream; \ - stream << inString << std::endl; \ - OutputDebugString(stream.str().c_str()); \ -} -#else -#define DebugTrace(inString) \ -{ \ - std::ostringstream stream; \ - stream << inString << std::endl; \ - qDebug(stream.str().c_str()); \ -} -#endif //QT_CONFIG - -#endif //#ifdef _DEBUG -#endif // Win32, Linux - -#if defined (IOS) && defined (DEBUG) -#define DebugTrace(inString) \ -{ \ - std::cout << inString << std::endl; \ -} -#endif // IOS, DEBUG - - -#ifndef DebugTrace -#define DebugTrace(inString) (void (0)) -#endif - -#endif // DEBUGROUTINES_H +#ifndef DEBUGROUTINES_H +#define DEBUGROUTINES_H + +// dirty, but I get OS header includes this way +#include "JGE.h" + +#include +#include +#include +#include +#include +#include + +#if defined (WIN32) || defined (LINUX) +#ifdef _DEBUG + +using namespace std; + +template +std::string ToHex(T* pointer) +{ + std::ostringstream stream; + stream << std::hex << showbase << setfill('0') << setw(8) << (int) pointer; + return stream.str(); +} + + +#ifndef QT_CONFIG +#define DebugTrace(inString) \ +{ \ + std::ostringstream stream; \ + stream << inString << std::endl; \ + OutputDebugString(stream.str().c_str()); \ +} +#else +#define DebugTrace(inString) \ +{ \ + std::ostringstream stream; \ + stream << inString << std::endl; \ + qDebug(stream.str().c_str()); \ +} +#endif //QT_CONFIG + +#endif //#ifdef _DEBUG +#endif // Win32, Linux + +#if defined (IOS) && defined (DEBUG) +#define DebugTrace(inString) \ +{ \ + std::cout << inString << std::endl; \ +} +#endif // IOS, DEBUG + + +#ifndef DebugTrace +#define DebugTrace(inString) (void (0)) +#endif + +#endif // DEBUGROUTINES_H diff --git a/JGE/include/Encoding.h b/JGE/include/Encoding.h index def8e5cf6..9486b1096 100644 --- a/JGE/include/Encoding.h +++ b/JGE/include/Encoding.h @@ -1,20 +1,20 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _ENCODING_H -#define _ENCODING_H - - - -#include "../../JGE/include/JGE.h" - -u16 charsets_gbk_to_ucs(const u8 * cjk); - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _ENCODING_H +#define _ENCODING_H + + + +#include "../../JGE/include/JGE.h" + +u16 charsets_gbk_to_ucs(const u8 * cjk); + +#endif diff --git a/JGE/include/JAnimator.h b/JGE/include/JAnimator.h index 7d416a93c..794c6ce50 100644 --- a/JGE/include/JAnimator.h +++ b/JGE/include/JAnimator.h @@ -1,414 +1,414 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _JANIMATOR_H_ -#define _JANIMATOR_H_ - -#include - -#include "JRenderer.h" - -using namespace std; - - -class JResourceManager; -class JQuad; -class JAnimatorFrame; -class JAnimatorObject; - - -////////////////////////////////////////////////////////////////////////// -/// A frame based animation system. The animation frames and play sequence -/// are loaded from a XML file. -/// -/// A sample animation script: -/// -/// @code -/// -/// -/// -/// @endcode -/// -/// A frame can also overide the global frame rate by using the "time" parameter (in second) -/// as shown above. -/// -////////////////////////////////////////////////////////////////////////// -class JAnimator -{ -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - /// @param resourceMgr - ResourceManager to look for images (JQuads) - /// - ////////////////////////////////////////////////////////////////////////// - JAnimator(JResourceManager* resourceMgr); - - ////////////////////////////////////////////////////////////////////////// - /// Destructor. - /// - ////////////////////////////////////////////////////////////////////////// - ~JAnimator(); - - ////////////////////////////////////////////////////////////////////////// - /// Load animation sequence from a script file. - /// - /// @param scriptFile - Animation script. - /// - /// @return True if no problem during loading. False otherwise. - /// - ////////////////////////////////////////////////////////////////////////// - bool Load(const char* scriptFile); - - ////////////////////////////////////////////////////////////////////////// - /// Start animation. - /// - ////////////////////////////////////////////////////////////////////////// - void Start(); - - ////////////////////////////////////////////////////////////////////////// - /// Stop animation. - /// - ////////////////////////////////////////////////////////////////////////// - void Stop(); - - ////////////////////////////////////////////////////////////////////////// - /// Pause animation. - /// - ////////////////////////////////////////////////////////////////////////// - void Pause(); - - ////////////////////////////////////////////////////////////////////////// - /// Resume animation. - /// - ////////////////////////////////////////////////////////////////////////// - void Resume(); - - ////////////////////////////////////////////////////////////////////////// - /// Update animation. - /// - /// @param dt - Time elapsed since last update (in second). - /// - ////////////////////////////////////////////////////////////////////////// - void Update(float dt); - - ////////////////////////////////////////////////////////////////////////// - /// Render animation. - /// - ////////////////////////////////////////////////////////////////////////// - void Render(); - - ////////////////////////////////////////////////////////////////////////// - /// Check if animation is playing or not. - /// - /// @return True if playing animation. - /// - ////////////////////////////////////////////////////////////////////////// - bool IsAnimating(); - - ////////////////////////////////////////////////////////////////////////// - /// Check if the animation is active. - /// - /// @return True if active. - /// - ////////////////////////////////////////////////////////////////////////// - bool IsActive(); - - JResourceManager* GetResourceManager(); - - ////////////////////////////////////////////////////////////////////////// - /// Set current frame to a particular index. - /// - /// @param index - The new index of current frame. - /// - ////////////////////////////////////////////////////////////////////////// - void SetCurrentFrameIndex(int index); - - ////////////////////////////////////////////////////////////////////////// - /// Get index of current frame. - /// - /// @return Index of current frame. - /// - ////////////////////////////////////////////////////////////////////////// - int GetCurrentFrameIndex(); - - ////////////////////////////////////////////////////////////////////////// - /// Set animation type. - /// - /// @param type - Animation type. - /// - /// @code - /// JSprite::ANIMATION_TYPE_LOOPING - Default - /// JSprite::ANIMATION_TYPE_ONCE_AND_GONE - /// JSprite::ANIMATION_TYPE_ONCE_AND_STAY - /// JSprite::ANIMATION_TYPE_ONCE_AND_BACK - /// JSprite::ANIMATION_TYPE_PINGPONG - /// @endcode - /// - ////////////////////////////////////////////////////////////////////////// - void SetAnimationType(int type); - - ////////////////////////////////////////////////////////////////////////// - /// Set position of the sprite. - /// - /// @param x - X position. - /// @param y - Y position. - /// - ////////////////////////////////////////////////////////////////////////// - void SetPosition(float x, float y); - - ////////////////////////////////////////////////////////////////////////// - /// Set anchor point of the animation. All rendering operations will be - /// based on this anchor point. - /// - /// @param x - X position of the anchor point. - /// @param y - Y position of the anchor point. - /// - ////////////////////////////////////////////////////////////////////////// - void SetHotSpot(float x, float y); - -private: - JResourceManager* mResource; - vector mFrames; - - bool mAnimating; - bool mActive; - int mCurrentFrame; - int mAnimationType; - int mFrameDelta; - - float mX; - float mY; - float mHotSpotX; - float mHotSpotY; - - -}; - - -////////////////////////////////////////////////////////////////////////// -/// A single frame of an animation. -/// -////////////////////////////////////////////////////////////////////////// -class JAnimatorFrame -{ -public: - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - /// @param parent - Parent of the frame. - /// - ////////////////////////////////////////////////////////////////////////// - JAnimatorFrame(JAnimator* parent); - - ////////////////////////////////////////////////////////////////////////// - /// Destructor. - /// - ////////////////////////////////////////////////////////////////////////// - ~JAnimatorFrame(); - - ////////////////////////////////////////////////////////////////////////// - /// Add a new object into the frame. - /// - /// @param obj - New animation object. - /// - ////////////////////////////////////////////////////////////////////////// - void AddObject(JAnimatorObject *obj); - - ////////////////////////////////////////////////////////////////////////// - /// Set play time of the frame. - /// - /// @param duration - Time to play (in second). - /// - ////////////////////////////////////////////////////////////////////////// - void SetFrameTime(float duration); - - ////////////////////////////////////////////////////////////////////////// - /// Frame update. - /// - /// @param dt - Time elapsed since last update (in second). - /// - /// @return True if the frame is done. - /// - ////////////////////////////////////////////////////////////////////////// - bool Update(float dt); - - ////////////////////////////////////////////////////////////////////////// - /// Render frame. - /// - /// @param x - X position for rendering. - /// @param y - Y position for rendering. - /// - ////////////////////////////////////////////////////////////////////////// - void Render(float x, float y); - - ////////////////////////////////////////////////////////////////////////// - /// Start playing the frame. - /// - ////////////////////////////////////////////////////////////////////////// - void Start(); - - -private: - float mTimer; - float mFrameTime; - JAnimator* mAnimator; - vector mObjects; - -}; - - -////////////////////////////////////////////////////////////////////////// -/// Animation object (image quad) in a frame. -/// -////////////////////////////////////////////////////////////////////////// -class JAnimatorObject -{ -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - ////////////////////////////////////////////////////////////////////////// - JAnimatorObject(); - - ////////////////////////////////////////////////////////////////////////// - /// Destructor. - /// - ////////////////////////////////////////////////////////////////////////// - ~JAnimatorObject(); - - ////////////////////////////////////////////////////////////////////////// - /// Update object. - /// - /// @param dt - Time elapsed since last update (in second). - /// - ////////////////////////////////////////////////////////////////////////// - void Update(float dt); - - ////////////////////////////////////////////////////////////////////////// - /// Render object. - /// - /// @param x - X position for rendering. - /// @param y - Y position for rendering. - /// - ////////////////////////////////////////////////////////////////////////// - void Render(float x, float y); - - ////////////////////////////////////////////////////////////////////////// - /// Set something to show. - /// - /// @param quad - Image quad. - /// - ////////////////////////////////////////////////////////////////////////// - void SetQuad(JQuad *quad); - - ////////////////////////////////////////////////////////////////////////// - /// Set position of the object. - /// - /// @param x - X position. - /// @param y - Y position. - /// - ////////////////////////////////////////////////////////////////////////// - void SetPosition(float x, float y); - - ////////////////////////////////////////////////////////////////////////// - /// Set rotation factor of the object. - /// - /// @param angle - Rotation angle in radian. - /// - ////////////////////////////////////////////////////////////////////////// - void SetRotation(float angle); - - ////////////////////////////////////////////////////////////////////////// - /// Set horizontal scale of the object. - /// - /// @param scale - Horizontal scale. - /// - ////////////////////////////////////////////////////////////////////////// - void SetHScale(float scale); - - ////////////////////////////////////////////////////////////////////////// - /// Set vertical scale of the object. - /// - /// @param scale - Vertical scale. - /// - ////////////////////////////////////////////////////////////////////////// - void SetVScale(float scale); - - ////////////////////////////////////////////////////////////////////////// - /// Set blending color of the object. - /// - /// @param color - Blending color. - /// - ////////////////////////////////////////////////////////////////////////// - void SetColor(PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Set horizontal flipping. - /// - /// @param flag - flipping flag. - /// - ////////////////////////////////////////////////////////////////////////// - void SetFlip(bool flag); - -private: - JRenderer* mRenderer; - JQuad* mQuad; - - float mX; - float mY; - float mRotation; - float mHScale; - float mVScale; - PIXEL_TYPE mColor; - bool mFlipped; -}; - -#endif - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _JANIMATOR_H_ +#define _JANIMATOR_H_ + +#include + +#include "JRenderer.h" + +using namespace std; + + +class JResourceManager; +class JQuad; +class JAnimatorFrame; +class JAnimatorObject; + + +////////////////////////////////////////////////////////////////////////// +/// A frame based animation system. The animation frames and play sequence +/// are loaded from a XML file. +/// +/// A sample animation script: +/// +/// @code +/// +/// +/// +/// @endcode +/// +/// A frame can also overide the global frame rate by using the "time" parameter (in second) +/// as shown above. +/// +////////////////////////////////////////////////////////////////////////// +class JAnimator +{ +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + /// @param resourceMgr - ResourceManager to look for images (JQuads) + /// + ////////////////////////////////////////////////////////////////////////// + JAnimator(JResourceManager* resourceMgr); + + ////////////////////////////////////////////////////////////////////////// + /// Destructor. + /// + ////////////////////////////////////////////////////////////////////////// + ~JAnimator(); + + ////////////////////////////////////////////////////////////////////////// + /// Load animation sequence from a script file. + /// + /// @param scriptFile - Animation script. + /// + /// @return True if no problem during loading. False otherwise. + /// + ////////////////////////////////////////////////////////////////////////// + bool Load(const char* scriptFile); + + ////////////////////////////////////////////////////////////////////////// + /// Start animation. + /// + ////////////////////////////////////////////////////////////////////////// + void Start(); + + ////////////////////////////////////////////////////////////////////////// + /// Stop animation. + /// + ////////////////////////////////////////////////////////////////////////// + void Stop(); + + ////////////////////////////////////////////////////////////////////////// + /// Pause animation. + /// + ////////////////////////////////////////////////////////////////////////// + void Pause(); + + ////////////////////////////////////////////////////////////////////////// + /// Resume animation. + /// + ////////////////////////////////////////////////////////////////////////// + void Resume(); + + ////////////////////////////////////////////////////////////////////////// + /// Update animation. + /// + /// @param dt - Time elapsed since last update (in second). + /// + ////////////////////////////////////////////////////////////////////////// + void Update(float dt); + + ////////////////////////////////////////////////////////////////////////// + /// Render animation. + /// + ////////////////////////////////////////////////////////////////////////// + void Render(); + + ////////////////////////////////////////////////////////////////////////// + /// Check if animation is playing or not. + /// + /// @return True if playing animation. + /// + ////////////////////////////////////////////////////////////////////////// + bool IsAnimating(); + + ////////////////////////////////////////////////////////////////////////// + /// Check if the animation is active. + /// + /// @return True if active. + /// + ////////////////////////////////////////////////////////////////////////// + bool IsActive(); + + JResourceManager* GetResourceManager(); + + ////////////////////////////////////////////////////////////////////////// + /// Set current frame to a particular index. + /// + /// @param index - The new index of current frame. + /// + ////////////////////////////////////////////////////////////////////////// + void SetCurrentFrameIndex(int index); + + ////////////////////////////////////////////////////////////////////////// + /// Get index of current frame. + /// + /// @return Index of current frame. + /// + ////////////////////////////////////////////////////////////////////////// + int GetCurrentFrameIndex(); + + ////////////////////////////////////////////////////////////////////////// + /// Set animation type. + /// + /// @param type - Animation type. + /// + /// @code + /// JSprite::ANIMATION_TYPE_LOOPING - Default + /// JSprite::ANIMATION_TYPE_ONCE_AND_GONE + /// JSprite::ANIMATION_TYPE_ONCE_AND_STAY + /// JSprite::ANIMATION_TYPE_ONCE_AND_BACK + /// JSprite::ANIMATION_TYPE_PINGPONG + /// @endcode + /// + ////////////////////////////////////////////////////////////////////////// + void SetAnimationType(int type); + + ////////////////////////////////////////////////////////////////////////// + /// Set position of the sprite. + /// + /// @param x - X position. + /// @param y - Y position. + /// + ////////////////////////////////////////////////////////////////////////// + void SetPosition(float x, float y); + + ////////////////////////////////////////////////////////////////////////// + /// Set anchor point of the animation. All rendering operations will be + /// based on this anchor point. + /// + /// @param x - X position of the anchor point. + /// @param y - Y position of the anchor point. + /// + ////////////////////////////////////////////////////////////////////////// + void SetHotSpot(float x, float y); + +private: + JResourceManager* mResource; + vector mFrames; + + bool mAnimating; + bool mActive; + int mCurrentFrame; + int mAnimationType; + int mFrameDelta; + + float mX; + float mY; + float mHotSpotX; + float mHotSpotY; + + +}; + + +////////////////////////////////////////////////////////////////////////// +/// A single frame of an animation. +/// +////////////////////////////////////////////////////////////////////////// +class JAnimatorFrame +{ +public: + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + /// @param parent - Parent of the frame. + /// + ////////////////////////////////////////////////////////////////////////// + JAnimatorFrame(JAnimator* parent); + + ////////////////////////////////////////////////////////////////////////// + /// Destructor. + /// + ////////////////////////////////////////////////////////////////////////// + ~JAnimatorFrame(); + + ////////////////////////////////////////////////////////////////////////// + /// Add a new object into the frame. + /// + /// @param obj - New animation object. + /// + ////////////////////////////////////////////////////////////////////////// + void AddObject(JAnimatorObject *obj); + + ////////////////////////////////////////////////////////////////////////// + /// Set play time of the frame. + /// + /// @param duration - Time to play (in second). + /// + ////////////////////////////////////////////////////////////////////////// + void SetFrameTime(float duration); + + ////////////////////////////////////////////////////////////////////////// + /// Frame update. + /// + /// @param dt - Time elapsed since last update (in second). + /// + /// @return True if the frame is done. + /// + ////////////////////////////////////////////////////////////////////////// + bool Update(float dt); + + ////////////////////////////////////////////////////////////////////////// + /// Render frame. + /// + /// @param x - X position for rendering. + /// @param y - Y position for rendering. + /// + ////////////////////////////////////////////////////////////////////////// + void Render(float x, float y); + + ////////////////////////////////////////////////////////////////////////// + /// Start playing the frame. + /// + ////////////////////////////////////////////////////////////////////////// + void Start(); + + +private: + float mTimer; + float mFrameTime; + JAnimator* mAnimator; + vector mObjects; + +}; + + +////////////////////////////////////////////////////////////////////////// +/// Animation object (image quad) in a frame. +/// +////////////////////////////////////////////////////////////////////////// +class JAnimatorObject +{ +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + ////////////////////////////////////////////////////////////////////////// + JAnimatorObject(); + + ////////////////////////////////////////////////////////////////////////// + /// Destructor. + /// + ////////////////////////////////////////////////////////////////////////// + ~JAnimatorObject(); + + ////////////////////////////////////////////////////////////////////////// + /// Update object. + /// + /// @param dt - Time elapsed since last update (in second). + /// + ////////////////////////////////////////////////////////////////////////// + void Update(float dt); + + ////////////////////////////////////////////////////////////////////////// + /// Render object. + /// + /// @param x - X position for rendering. + /// @param y - Y position for rendering. + /// + ////////////////////////////////////////////////////////////////////////// + void Render(float x, float y); + + ////////////////////////////////////////////////////////////////////////// + /// Set something to show. + /// + /// @param quad - Image quad. + /// + ////////////////////////////////////////////////////////////////////////// + void SetQuad(JQuad *quad); + + ////////////////////////////////////////////////////////////////////////// + /// Set position of the object. + /// + /// @param x - X position. + /// @param y - Y position. + /// + ////////////////////////////////////////////////////////////////////////// + void SetPosition(float x, float y); + + ////////////////////////////////////////////////////////////////////////// + /// Set rotation factor of the object. + /// + /// @param angle - Rotation angle in radian. + /// + ////////////////////////////////////////////////////////////////////////// + void SetRotation(float angle); + + ////////////////////////////////////////////////////////////////////////// + /// Set horizontal scale of the object. + /// + /// @param scale - Horizontal scale. + /// + ////////////////////////////////////////////////////////////////////////// + void SetHScale(float scale); + + ////////////////////////////////////////////////////////////////////////// + /// Set vertical scale of the object. + /// + /// @param scale - Vertical scale. + /// + ////////////////////////////////////////////////////////////////////////// + void SetVScale(float scale); + + ////////////////////////////////////////////////////////////////////////// + /// Set blending color of the object. + /// + /// @param color - Blending color. + /// + ////////////////////////////////////////////////////////////////////////// + void SetColor(PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Set horizontal flipping. + /// + /// @param flag - flipping flag. + /// + ////////////////////////////////////////////////////////////////////////// + void SetFlip(bool flag); + +private: + JRenderer* mRenderer; + JQuad* mQuad; + + float mX; + float mY; + float mRotation; + float mHScale; + float mVScale; + PIXEL_TYPE mColor; + bool mFlipped; +}; + +#endif + diff --git a/JGE/include/JApp.h b/JGE/include/JApp.h index 310fa05a5..136ec751e 100644 --- a/JGE/include/JApp.h +++ b/JGE/include/JApp.h @@ -1,88 +1,88 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _JAPP_H_ -#define _JAPP_H_ - -class JGE; - -////////////////////////////////////////////////////////////////////////// -/// Main application class for the system to run. The core game class -/// should be derived from this base class. -/// -////////////////////////////////////////////////////////////////////////// -class JApp -{ - -public: - - JApp(); - virtual ~JApp(); - - ////////////////////////////////////////////////////////////////////////// - /// Initialization function. - /// - ////////////////////////////////////////////////////////////////////////// - virtual void Create() = 0; - - ////////////////////////////////////////////////////////////////////////// - /// Cleanup function before exiting from the game. - /// - ////////////////////////////////////////////////////////////////////////// - virtual void Destroy() = 0; - - - ////////////////////////////////////////////////////////////////////////// - /// Update function to be called for each frame update. Should perform - /// all the game logic here. - /// - /// @par Example: A simple Update() implementation: - /// @code - /// void Update() - /// { - /// float dt = JGE::GetInstance()->GetDelta(); - /// mX += mSpeed*dt; - /// } - /// @endcode - /// - ////////////////////////////////////////////////////////////////////////// - virtual void Update() = 0; - - ////////////////////////////////////////////////////////////////////////// - /// Render function to be called for each frame update. Should do all the - /// game rendering here. - /// - /// @par Example: A simple Render() implementation: - /// @code - /// void Render() - /// { - /// JRenderer *r = JRenderer::GetInstance(); - /// r->FillRect(0,0,480,272,ARGB(255,0,0,0)); - /// } - /// @endcode - /// - ////////////////////////////////////////////////////////////////////////// - virtual void Render() = 0; - - ////////////////////////////////////////////////////////////////////////// - /// Callback function called when the game is paused by the system. - /// - ////////////////////////////////////////////////////////////////////////// - virtual void Pause() = 0; - - ////////////////////////////////////////////////////////////////////////// - /// Callback function called when the game is resumed by the system. - /// - ////////////////////////////////////////////////////////////////////////// - virtual void Resume() = 0; -}; - - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _JAPP_H_ +#define _JAPP_H_ + +class JGE; + +////////////////////////////////////////////////////////////////////////// +/// Main application class for the system to run. The core game class +/// should be derived from this base class. +/// +////////////////////////////////////////////////////////////////////////// +class JApp +{ + +public: + + JApp(); + virtual ~JApp(); + + ////////////////////////////////////////////////////////////////////////// + /// Initialization function. + /// + ////////////////////////////////////////////////////////////////////////// + virtual void Create() = 0; + + ////////////////////////////////////////////////////////////////////////// + /// Cleanup function before exiting from the game. + /// + ////////////////////////////////////////////////////////////////////////// + virtual void Destroy() = 0; + + + ////////////////////////////////////////////////////////////////////////// + /// Update function to be called for each frame update. Should perform + /// all the game logic here. + /// + /// @par Example: A simple Update() implementation: + /// @code + /// void Update() + /// { + /// float dt = JGE::GetInstance()->GetDelta(); + /// mX += mSpeed*dt; + /// } + /// @endcode + /// + ////////////////////////////////////////////////////////////////////////// + virtual void Update() = 0; + + ////////////////////////////////////////////////////////////////////////// + /// Render function to be called for each frame update. Should do all the + /// game rendering here. + /// + /// @par Example: A simple Render() implementation: + /// @code + /// void Render() + /// { + /// JRenderer *r = JRenderer::GetInstance(); + /// r->FillRect(0,0,480,272,ARGB(255,0,0,0)); + /// } + /// @endcode + /// + ////////////////////////////////////////////////////////////////////////// + virtual void Render() = 0; + + ////////////////////////////////////////////////////////////////////////// + /// Callback function called when the game is paused by the system. + /// + ////////////////////////////////////////////////////////////////////////// + virtual void Pause() = 0; + + ////////////////////////////////////////////////////////////////////////// + /// Callback function called when the game is resumed by the system. + /// + ////////////////////////////////////////////////////////////////////////// + virtual void Resume() = 0; +}; + + +#endif diff --git a/JGE/include/JCooleyesMP3.h b/JGE/include/JCooleyesMP3.h index 2a4d930ef..c9e01b6cf 100644 --- a/JGE/include/JCooleyesMP3.h +++ b/JGE/include/JCooleyesMP3.h @@ -1,62 +1,62 @@ -//------------------------------------------------------------------------------------- -// -// JGE is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// Copyright (c) 2007 Cooleyes -// -//------------------------------------------------------------------------------------- - -#ifndef _COOLEYES_MP3_ -#define _COOLEYES_MP3_ - - -#define FORCE_BUFFER_ALIGNMENT - -class JCooleyesMP3 -{ -public: - JCooleyesMP3(); - ~JCooleyesMP3(); - - bool Load(const char* filename); - void Release(); - bool Play(bool looping = false); - void Stop(); - void Resume(); - void FeedAudioData(void* buf, unsigned int length/*, bool mixing = false*/); - void Decode(); - bool IsPlaying(); - - void InitBuffers(unsigned long *MP3CodecBuffer, short* decoderBuffer, short* decodedDataOutputBuffer); - -public: - bool mPlaying; - SceUID mp3_handle; - u8* mFileBuffer; - u8* mMP3FirstFramePointer; - int mFileSize; - int mUpdateCounter; - u8* mCurrFramePointer; - int mDataPointer; - int mSamplesPending; - bool mAllMP3DataProcessed; - - bool mLooping; - - u32 mSamplePerFrame; - u32 mChannelCount; - u32 mSampleRate; - - int mOutputBufferIndex; - - short *mDecoderBuffer; - short *mDecodedDataOutputBuffer; - unsigned long *mMP3CodecBuffer; - -}; - -#endif - +//------------------------------------------------------------------------------------- +// +// JGE is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// Copyright (c) 2007 Cooleyes +// +//------------------------------------------------------------------------------------- + +#ifndef _COOLEYES_MP3_ +#define _COOLEYES_MP3_ + + +#define FORCE_BUFFER_ALIGNMENT + +class JCooleyesMP3 +{ +public: + JCooleyesMP3(); + ~JCooleyesMP3(); + + bool Load(const char* filename); + void Release(); + bool Play(bool looping = false); + void Stop(); + void Resume(); + void FeedAudioData(void* buf, unsigned int length/*, bool mixing = false*/); + void Decode(); + bool IsPlaying(); + + void InitBuffers(unsigned long *MP3CodecBuffer, short* decoderBuffer, short* decodedDataOutputBuffer); + +public: + bool mPlaying; + SceUID mp3_handle; + u8* mFileBuffer; + u8* mMP3FirstFramePointer; + int mFileSize; + int mUpdateCounter; + u8* mCurrFramePointer; + int mDataPointer; + int mSamplesPending; + bool mAllMP3DataProcessed; + + bool mLooping; + + u32 mSamplePerFrame; + u32 mChannelCount; + u32 mSampleRate; + + int mOutputBufferIndex; + + short *mDecoderBuffer; + short *mDecodedDataOutputBuffer; + unsigned long *mMP3CodecBuffer; + +}; + +#endif + diff --git a/JGE/include/JDistortionMesh.h b/JGE/include/JDistortionMesh.h index c0102afc2..10939a83e 100644 --- a/JGE/include/JDistortionMesh.h +++ b/JGE/include/JDistortionMesh.h @@ -1,47 +1,47 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -// Note: Inspired by HGE's DistortionMesh. -// -//------------------------------------------------------------------------------------- - -#ifndef _JDISTORT_MESH_H -#define _JDISTORT_MESH_H - -#include "JRenderer.h" - -class JDistortionMesh -{ -public: - JDistortionMesh(JTexture *tex, float x, float y, float width, float height, int cols, int rows); - ~JDistortionMesh(); - - void Render(float x, float y); - void SetColor(int col, int row, PIXEL_TYPE color); - void SetDisplacement(int col, int row, float dx, float dy);//, int ref); - -private: - - static JRenderer *mRenderer; - Vertex* mVertices; - int mRows; - int mCols; - float mCellWidth; - float mCellHeight; - float mTexX; - float mTexY; - float mTexWidth; - float mTexHeight; - JTexture* mTexture; - JQuad* mQuad; - - -}; - - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +// Note: Inspired by HGE's DistortionMesh. +// +//------------------------------------------------------------------------------------- + +#ifndef _JDISTORT_MESH_H +#define _JDISTORT_MESH_H + +#include "JRenderer.h" + +class JDistortionMesh +{ +public: + JDistortionMesh(JTexture *tex, float x, float y, float width, float height, int cols, int rows); + ~JDistortionMesh(); + + void Render(float x, float y); + void SetColor(int col, int row, PIXEL_TYPE color); + void SetDisplacement(int col, int row, float dx, float dy);//, int ref); + +private: + + static JRenderer *mRenderer; + Vertex* mVertices; + int mRows; + int mCols; + float mCellWidth; + float mCellHeight; + float mTexX; + float mTexY; + float mTexWidth; + float mTexHeight; + JTexture* mTexture; + JQuad* mQuad; + + +}; + + +#endif diff --git a/JGE/include/JFileSystem.h b/JGE/include/JFileSystem.h index 7c4b9c523..6c38207e2 100644 --- a/JGE/include/JFileSystem.h +++ b/JGE/include/JFileSystem.h @@ -1,143 +1,143 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _FILE_SYSTEM_H_ -#define _FILE_SYSTEM_H_ - -#define JGE_GET_RES(filename) JFileSystem::GetInstance()->GetResourceFile(filename) -#define JGE_GET_RESPATH() JFileSystem::GetInstance()->GetResourceRoot() - -#include -#include -#include -#include - -#if defined (WIN32) || defined (LINUX) || defined(IOS) - -#else - #include - #include -#endif - -#include "unzip/unzip.h" - -using namespace std; - -////////////////////////////////////////////////////////////////////////// -/// Interface for low level file access with ZIP archive support. All -/// file operations in JGE are handled through this class so if a ZIP -/// archive is attached, all the resources will be loaded from the -/// archive file. -/// -////////////////////////////////////////////////////////////////////////// - -class JZipCache { -public: - JZipCache(); - ~JZipCache(); - map dir; - -}; - -class JFileSystem -{ -public: - - ////////////////////////////////////////////////////////////////////////// - /// Get the singleton instance - /// - ////////////////////////////////////////////////////////////////////////// - static JFileSystem* GetInstance(); - - static void Destroy(); - - - ////////////////////////////////////////////////////////////////////////// - /// Attach ZIP archive to the file system. - /// - /// @param zipfile - Name of ZIP archive. - /// @param password - Password for the ZIP archive. Default is NULL. - /// - /// @return Status of the attach operation. - /// - ////////////////////////////////////////////////////////////////////////// - bool AttachZipFile(const string &zipfile, char *password = NULL); - - ////////////////////////////////////////////////////////////////////////// - /// Release the attached ZIP archive. - /// - ////////////////////////////////////////////////////////////////////////// - void DetachZipFile(); - - ////////////////////////////////////////////////////////////////////////// - /// Open file for reading. - /// - ////////////////////////////////////////////////////////////////////////// - bool OpenFile(const string &filename); - - ////////////////////////////////////////////////////////////////////////// - /// Read data from file. - /// - /// @param buffer - Buffer for reading. - /// @param size - Number of bytes to read. - /// - /// @return Number of bytes read. - /// - ////////////////////////////////////////////////////////////////////////// - int ReadFile(void *buffer, int size); - - ////////////////////////////////////////////////////////////////////////// - /// Get size of file. - /// - ////////////////////////////////////////////////////////////////////////// - int GetFileSize(); - - ////////////////////////////////////////////////////////////////////////// - /// Close file. - /// - ////////////////////////////////////////////////////////////////////////// - void CloseFile(); - - ////////////////////////////////////////////////////////////////////////// - /// Set root for all the following file operations - /// - /// @resourceRoot - New root. - /// - ////////////////////////////////////////////////////////////////////////// - void SetResourceRoot(const string& resourceRoot); - string GetResourceRoot(); - - // Returns a string prefixed with the resource path - string GetResourceFile(string filename); - -protected: - JFileSystem(); - ~JFileSystem(); - -private: - static JFileSystem* mInstance; - - mapmZipCache; - string mResourceRoot; - string mZipFileName; - char *mPassword; - bool mZipAvailable; - void preloadZip(string filename); -#if defined (WIN32) || defined (LINUX) || defined(IOS) - FILE *mFile; -#else - SceUID mFile; -#endif - unzFile mZipFile; - int mFileSize; - -}; - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _FILE_SYSTEM_H_ +#define _FILE_SYSTEM_H_ + +#define JGE_GET_RES(filename) JFileSystem::GetInstance()->GetResourceFile(filename) +#define JGE_GET_RESPATH() JFileSystem::GetInstance()->GetResourceRoot() + +#include +#include +#include +#include + +#if defined (WIN32) || defined (LINUX) || defined(IOS) + +#else + #include + #include +#endif + +#include "unzip/unzip.h" + +using namespace std; + +////////////////////////////////////////////////////////////////////////// +/// Interface for low level file access with ZIP archive support. All +/// file operations in JGE are handled through this class so if a ZIP +/// archive is attached, all the resources will be loaded from the +/// archive file. +/// +////////////////////////////////////////////////////////////////////////// + +class JZipCache { +public: + JZipCache(); + ~JZipCache(); + map dir; + +}; + +class JFileSystem +{ +public: + + ////////////////////////////////////////////////////////////////////////// + /// Get the singleton instance + /// + ////////////////////////////////////////////////////////////////////////// + static JFileSystem* GetInstance(); + + static void Destroy(); + + + ////////////////////////////////////////////////////////////////////////// + /// Attach ZIP archive to the file system. + /// + /// @param zipfile - Name of ZIP archive. + /// @param password - Password for the ZIP archive. Default is NULL. + /// + /// @return Status of the attach operation. + /// + ////////////////////////////////////////////////////////////////////////// + bool AttachZipFile(const string &zipfile, char *password = NULL); + + ////////////////////////////////////////////////////////////////////////// + /// Release the attached ZIP archive. + /// + ////////////////////////////////////////////////////////////////////////// + void DetachZipFile(); + + ////////////////////////////////////////////////////////////////////////// + /// Open file for reading. + /// + ////////////////////////////////////////////////////////////////////////// + bool OpenFile(const string &filename); + + ////////////////////////////////////////////////////////////////////////// + /// Read data from file. + /// + /// @param buffer - Buffer for reading. + /// @param size - Number of bytes to read. + /// + /// @return Number of bytes read. + /// + ////////////////////////////////////////////////////////////////////////// + int ReadFile(void *buffer, int size); + + ////////////////////////////////////////////////////////////////////////// + /// Get size of file. + /// + ////////////////////////////////////////////////////////////////////////// + int GetFileSize(); + + ////////////////////////////////////////////////////////////////////////// + /// Close file. + /// + ////////////////////////////////////////////////////////////////////////// + void CloseFile(); + + ////////////////////////////////////////////////////////////////////////// + /// Set root for all the following file operations + /// + /// @resourceRoot - New root. + /// + ////////////////////////////////////////////////////////////////////////// + void SetResourceRoot(const string& resourceRoot); + string GetResourceRoot(); + + // Returns a string prefixed with the resource path + string GetResourceFile(string filename); + +protected: + JFileSystem(); + ~JFileSystem(); + +private: + static JFileSystem* mInstance; + + mapmZipCache; + string mResourceRoot; + string mZipFileName; + char *mPassword; + bool mZipAvailable; + void preloadZip(string filename); +#if defined (WIN32) || defined (LINUX) || defined(IOS) + FILE *mFile; +#else + SceUID mFile; +#endif + unzFile mZipFile; + int mFileSize; + +}; + +#endif diff --git a/JGE/include/JGBKFont.h b/JGE/include/JGBKFont.h index d28480a63..973d497f8 100644 --- a/JGE/include/JGBKFont.h +++ b/JGE/include/JGBKFont.h @@ -1,192 +1,192 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _JBGK_FONT_H_ -#define _JBGK_FONT_H_ - - -#include "JTypes.h" - -#include "JRenderer.h" -#include "JSprite.h" - -#define BYTE u8 -#define DWORD u32 -#define BOOL int - - -// #define GB_FONT_SIZE 16 -// #define GB_FONT_DATA_SIZE GB_FONT_SIZE*GB_FONT_SIZE/8 -// #define GB_FONT_BYTE_COUNT GB_FONT_SIZE/8 -// -#define MAX_CACHE_SIZE 256 -// -// #define CFONT_TEX_WIDTH 256 -// #define CFONT_TEX_HEIGHT 256 - -////////////////////////////////////////////////////////////////////////// -/// Chinese bitmap font encoded with GBK encoding. All popurlar font sizes -/// are supported and the following have been tested: -/// 12x12, 16x16, 18x18, 20x20, 24x24, 28x28 and 32x32. -/// -////////////////////////////////////////////////////////////////////////// -class JGBKFont -{ -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - ////////////////////////////////////////////////////////////////////////// - JGBKFont(); - - ~JGBKFont(); - - ////////////////////////////////////////////////////////////////////////// - /// Initialization of the font class. You need to provide both a Chinese - /// font file and an English one as well. - /// - /// For example: - /// @code - /// mChineseFont = new JGBKFont(); - /// mChineseFont->Init("Res/ASC16", "Res/GBK16"); - /// @endcode - /// - /// @param engFileName - Name of the English font file. - /// @param chnFileName - Name of the Chinese font file. - /// @param fontsize - Font size. - /// @param smallEnglishFont - Indicate to use half width when rendering English characters. - /// - ////////////////////////////////////////////////////////////////////////// - bool Init(const char* engFileName, const char* chnFileName, int fontsize=16, bool smallEnglishFont=false); - - ////////////////////////////////////////////////////////////////////////// - /// Rendering character into cache. - /// - /// @param ch - Single byte or word of character code. - /// - /// @return Index of the character in cache. - /// - ////////////////////////////////////////////////////////////////////////// - int PreCacheChar(const BYTE *ch); - - ////////////////////////////////////////////////////////////////////////// - /// Scan through the string and look up the index of each character in the - /// cache and then return all indexes in an array to be rendered later on. - /// - /// @param str - String to look for cache indexes. - /// @return dest - Indexes of characters in cache. - /// @return Number of characters processed. - /// - ////////////////////////////////////////////////////////////////////////// - int PrepareString(BYTE* str, int* dest); - - ////////////////////////////////////////////////////////////////////////// - /// Render string by using the indexes returned from PrepareString. - /// - /// @param text - Cache indexes for rendering. - /// @param count - Number of characters to render. - /// @param x - X screen position for rendering. - /// @param y - Y screen position for rendering. - /// - ////////////////////////////////////////////////////////////////////////// - void RenderEncodedString(const int* text, int count, float x, float y); - - ////////////////////////////////////////////////////////////////////////// - /// Render string to screen. - /// - /// @param str - String to render. - /// @param x - X screen position for rendering. - /// @param y - Y screen position for rendering. - /// - ////////////////////////////////////////////////////////////////////////// - void RenderString(BYTE* str, float x, float y, int alignment=JGETEXT_LEFT); - - int GetStringWidth(BYTE* str); - int GetStringHeight(BYTE* str); - - ////////////////////////////////////////////////////////////////////////// - /// Set scale for rendering. - /// - /// @param scale - Scale for rendering characters. - /// - ////////////////////////////////////////////////////////////////////////// - void SetScale(float scale); - - - ////////////////////////////////////////////////////////////////////////// - /// Set angle for rendering. - /// - /// @param rot - Rotation angle in radian. - /// - ////////////////////////////////////////////////////////////////////////// - void SetRotation(float rot); - - ////////////////////////////////////////////////////////////////////////// - /// Set font color. - /// - /// @param color - color of font. - /// - ////////////////////////////////////////////////////////////////////////// - void SetColor(PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Set background color. - /// - /// @param color - Background color. - /// - ////////////////////////////////////////////////////////////////////////// - void SetBgColor(PIXEL_TYPE color); - - -private: - - static JRenderer* mRenderer; - - BYTE* mChnFont; - BYTE* mEngFont; - - DWORD* mCharBuffer; - - PIXEL_TYPE mColor; - PIXEL_TYPE mBgColor; - - int mFontSize; - int mBytesPerChar; - int mBytesPerRow; - - int mCacheSize; - int mCacheImageWidth; - int mCacheImageHeight; - - int mCol; - int mRow; - -//public: - - JTexture* mTexture; - JQuad** mSprites; - - int *mGBCode; - - int mCurr; - - float mScale; - float mRotation; - - int mCount; - - bool mSmallEnglishFont; - - void GetStringArea(BYTE* str, int *w, int *h); -}; - - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _JBGK_FONT_H_ +#define _JBGK_FONT_H_ + + +#include "JTypes.h" + +#include "JRenderer.h" +#include "JSprite.h" + +#define BYTE u8 +#define DWORD u32 +#define BOOL int + + +// #define GB_FONT_SIZE 16 +// #define GB_FONT_DATA_SIZE GB_FONT_SIZE*GB_FONT_SIZE/8 +// #define GB_FONT_BYTE_COUNT GB_FONT_SIZE/8 +// +#define MAX_CACHE_SIZE 256 +// +// #define CFONT_TEX_WIDTH 256 +// #define CFONT_TEX_HEIGHT 256 + +////////////////////////////////////////////////////////////////////////// +/// Chinese bitmap font encoded with GBK encoding. All popurlar font sizes +/// are supported and the following have been tested: +/// 12x12, 16x16, 18x18, 20x20, 24x24, 28x28 and 32x32. +/// +////////////////////////////////////////////////////////////////////////// +class JGBKFont +{ +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + ////////////////////////////////////////////////////////////////////////// + JGBKFont(); + + ~JGBKFont(); + + ////////////////////////////////////////////////////////////////////////// + /// Initialization of the font class. You need to provide both a Chinese + /// font file and an English one as well. + /// + /// For example: + /// @code + /// mChineseFont = new JGBKFont(); + /// mChineseFont->Init("Res/ASC16", "Res/GBK16"); + /// @endcode + /// + /// @param engFileName - Name of the English font file. + /// @param chnFileName - Name of the Chinese font file. + /// @param fontsize - Font size. + /// @param smallEnglishFont - Indicate to use half width when rendering English characters. + /// + ////////////////////////////////////////////////////////////////////////// + bool Init(const char* engFileName, const char* chnFileName, int fontsize=16, bool smallEnglishFont=false); + + ////////////////////////////////////////////////////////////////////////// + /// Rendering character into cache. + /// + /// @param ch - Single byte or word of character code. + /// + /// @return Index of the character in cache. + /// + ////////////////////////////////////////////////////////////////////////// + int PreCacheChar(const BYTE *ch); + + ////////////////////////////////////////////////////////////////////////// + /// Scan through the string and look up the index of each character in the + /// cache and then return all indexes in an array to be rendered later on. + /// + /// @param str - String to look for cache indexes. + /// @return dest - Indexes of characters in cache. + /// @return Number of characters processed. + /// + ////////////////////////////////////////////////////////////////////////// + int PrepareString(BYTE* str, int* dest); + + ////////////////////////////////////////////////////////////////////////// + /// Render string by using the indexes returned from PrepareString. + /// + /// @param text - Cache indexes for rendering. + /// @param count - Number of characters to render. + /// @param x - X screen position for rendering. + /// @param y - Y screen position for rendering. + /// + ////////////////////////////////////////////////////////////////////////// + void RenderEncodedString(const int* text, int count, float x, float y); + + ////////////////////////////////////////////////////////////////////////// + /// Render string to screen. + /// + /// @param str - String to render. + /// @param x - X screen position for rendering. + /// @param y - Y screen position for rendering. + /// + ////////////////////////////////////////////////////////////////////////// + void RenderString(BYTE* str, float x, float y, int alignment=JGETEXT_LEFT); + + int GetStringWidth(BYTE* str); + int GetStringHeight(BYTE* str); + + ////////////////////////////////////////////////////////////////////////// + /// Set scale for rendering. + /// + /// @param scale - Scale for rendering characters. + /// + ////////////////////////////////////////////////////////////////////////// + void SetScale(float scale); + + + ////////////////////////////////////////////////////////////////////////// + /// Set angle for rendering. + /// + /// @param rot - Rotation angle in radian. + /// + ////////////////////////////////////////////////////////////////////////// + void SetRotation(float rot); + + ////////////////////////////////////////////////////////////////////////// + /// Set font color. + /// + /// @param color - color of font. + /// + ////////////////////////////////////////////////////////////////////////// + void SetColor(PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Set background color. + /// + /// @param color - Background color. + /// + ////////////////////////////////////////////////////////////////////////// + void SetBgColor(PIXEL_TYPE color); + + +private: + + static JRenderer* mRenderer; + + BYTE* mChnFont; + BYTE* mEngFont; + + DWORD* mCharBuffer; + + PIXEL_TYPE mColor; + PIXEL_TYPE mBgColor; + + int mFontSize; + int mBytesPerChar; + int mBytesPerRow; + + int mCacheSize; + int mCacheImageWidth; + int mCacheImageHeight; + + int mCol; + int mRow; + +//public: + + JTexture* mTexture; + JQuad** mSprites; + + int *mGBCode; + + int mCurr; + + float mScale; + float mRotation; + + int mCount; + + bool mSmallEnglishFont; + + void GetStringArea(BYTE* str, int *w, int *h); +}; + + +#endif diff --git a/JGE/include/JGameLauncher.h b/JGE/include/JGameLauncher.h index 857af7e79..b5d401c9c 100644 --- a/JGE/include/JGameLauncher.h +++ b/JGE/include/JGameLauncher.h @@ -1,57 +1,57 @@ -//------------------------------------------------------------------------------------- -// -// JGE is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _GAME_LAUNCHER_H_ -#define _GAME_LAUNCHER_H_ - - -#include "JApp.h" -#include "JTypes.h" -#include "JFileSystem.h" - - -////////////////////////////////////////////////////////////////////////// -/// An interface for JGE to get the user defined JApp class. -/// -////////////////////////////////////////////////////////////////////////// -class JGameLauncher -{ -public: - - ////////////////////////////////////////////////////////////////////////// - /// Get user defined JApp instance. The function will be called when - /// JGE starts. - /// - /// @return - User defined JApp instance. - /// - ////////////////////////////////////////////////////////////////////////// - JApp* GetGameApp(); - - ////////////////////////////////////////////////////////////////////////// - /// Get application name. Mainly for Windows build to setup the name - /// on the title bar. - /// - /// @return - Application name. - /// - ////////////////////////////////////////////////////////////////////////// - char *GetName(); - - ////////////////////////////////////////////////////////////////////////// - /// Get initialization flags. - /// - /// @return - Initialization flags. - /// - ////////////////////////////////////////////////////////////////////////// - u32 GetInitFlags(); - -}; - - -#endif +//------------------------------------------------------------------------------------- +// +// JGE is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _GAME_LAUNCHER_H_ +#define _GAME_LAUNCHER_H_ + + +#include "JApp.h" +#include "JTypes.h" +#include "JFileSystem.h" + + +////////////////////////////////////////////////////////////////////////// +/// An interface for JGE to get the user defined JApp class. +/// +////////////////////////////////////////////////////////////////////////// +class JGameLauncher +{ +public: + + ////////////////////////////////////////////////////////////////////////// + /// Get user defined JApp instance. The function will be called when + /// JGE starts. + /// + /// @return - User defined JApp instance. + /// + ////////////////////////////////////////////////////////////////////////// + JApp* GetGameApp(); + + ////////////////////////////////////////////////////////////////////////// + /// Get application name. Mainly for Windows build to setup the name + /// on the title bar. + /// + /// @return - Application name. + /// + ////////////////////////////////////////////////////////////////////////// + char *GetName(); + + ////////////////////////////////////////////////////////////////////////// + /// Get initialization flags. + /// + /// @return - Initialization flags. + /// + ////////////////////////////////////////////////////////////////////////// + u32 GetInitFlags(); + +}; + + +#endif diff --git a/JGE/include/JGameObject.h b/JGE/include/JGameObject.h index c90baaf73..22cd0fbb5 100644 --- a/JGE/include/JGameObject.h +++ b/JGE/include/JGameObject.h @@ -1,259 +1,259 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _JGAME_OBJECT_H_ -#define _JGAME_OBJECT_H_ - -#include "JTypes.h" -#include "JRenderer.h" -#include "JSprite.h" - - -#define FLASH_TIME 0.10f -#define FLASHING_COUNT 6 - -#define RENDER_FLAG_ANGLE 0x0001 -#define RENDER_FLAG_SIZE 0x0002 -#define RENDER_FLAG_ROTATION 0x0004 - - -////////////////////////////////////////////////////////////////////////// -/// A super Sprite class for in-game entities. Extra functions are added -/// in addition to a normal Sprite for easier control of in-game -/// activities. -/// -////////////////////////////////////////////////////////////////////////// -class JGameObject: public JSprite -{ - - -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - /// @param tex - Texture for first frame. NULL for no starting frame. - /// @param x - X position of texture for the frame. - /// @param y - Y position of texture for the frame. - /// @param width - Width of the frame. - /// @param height - Height of the frame. - /// - ////////////////////////////////////////////////////////////////////////// - JGameObject(JTexture *tex, float x, float y, float width, float height); - - virtual ~JGameObject(); - - ////////////////////////////////////////////////////////////////////////// - /// Update function. - /// - /// @param dt - Delta time since last update (in second). - /// - ////////////////////////////////////////////////////////////////////////// - virtual void Update(float dt); - - ////////////////////////////////////////////////////////////////////////// - /// Render current frame. - /// - ////////////////////////////////////////////////////////////////////////// - virtual void Render(); - - ////////////////////////////////////////////////////////////////////////// - /// Function to handle collision. - /// - ////////////////////////////////////////////////////////////////////////// - virtual void OnCollide(); - - ////////////////////////////////////////////////////////////////////////// - /// Set bounding box for collision detection. All the following collision - /// detections will be done using bounding box. - /// - /// @param x - X position of the bounding box (relative to this sprite). - /// @param y - Y position of the bounding box (relative to this sprite). - /// @param width - Width of the bounding box. - /// @param height - Height of the bounding box. - /// - ////////////////////////////////////////////////////////////////////////// - void SetBBox(float x, float y, float width, float height); - - ////////////////////////////////////////////////////////////////////////// - /// Get bounding box relative to screen position. - /// - /// @param x - X of screen position. - /// @param y - Y of screen position. - /// - /// @return xNow - X position of the bounding box (relative to screen). - /// @return yNow - Y position of the bounding box (relative to screen). - /// @return width - Width of the bounding box. - /// @return height - Height of the bounding box. - /// - ////////////////////////////////////////////////////////////////////////// - void GetBBox(float x, float y, float* xNow, float* yNow, float* width, float *height); - - ////////////////////////////////////////////////////////////////////////// - /// Set up a circle for collision detection. All the following collision - /// detections will be done using circle to circle collision detection. - /// - /// @param cx - X of the circle center. - /// @param cy - Y of the circle center. - /// @param radius - Radius of the circle. - /// - ////////////////////////////////////////////////////////////////////////// - void SetCollisionCircle(float cx, float cy, float radius); - - ////////////////////////////////////////////////////////////////////////// - /// Check for collision. Either bounding box or circle to circle - /// collision detection will be used depending on which one is setup last. - /// - /// @param target - Target to check for collision. - /// - ////////////////////////////////////////////////////////////////////////// - bool Collide(JGameObject *target); - - ////////////////////////////////////////////////////////////////////////// - /// Set object that has collided with this object. - /// - /// @param target - Object that has collided with this object. - ////////////////////////////////////////////////////////////////////////// - void SetCollisionTarget(JGameObject *target); - - ////////////////////////////////////////////////////////////////////////// - /// Get object that has collided with this object. - /// - /// @return Object that has collided with this object. - ////////////////////////////////////////////////////////////////////////// - JGameObject *GetCollisionTarget(); - - ////////////////////////////////////////////////////////////////////////// - /// Set damage point of this object. - /// - /// @param pt - Damage point. - ////////////////////////////////////////////////////////////////////////// - void SetHitPoint(int pt); - - ////////////////////////////////////////////////////////////////////////// - /// Get damage point of this object. - /// - /// @return Damage point. - ////////////////////////////////////////////////////////////////////////// - int GetHitPoint(); - - ////////////////////////////////////////////////////////////////////////// - /// Set blood of this object. - /// - /// @param pt - Blood value. - ////////////////////////////////////////////////////////////////////////// - void SetBlood(int pt); - - ////////////////////////////////////////////////////////////////////////// - /// Get blood of this object. - /// - /// @return Blood value. - ////////////////////////////////////////////////////////////////////////// - int GetBlood(); - - ////////////////////////////////////////////////////////////////////////// - /// Enable alpha animation during update. - /// - /// @param flag - Enable flag. - /// @param delta - Rate of changing the alpha value. - /// - ////////////////////////////////////////////////////////////////////////// - void EnableAlpha(bool flag, float delta=0.0f); - - ////////////////////////////////////////////////////////////////////////// - /// Enable scaling during update. - /// - /// @param flag - Enable flag. - /// @param delta - Rate of changing the scaling value. - /// - ////////////////////////////////////////////////////////////////////////// - void EnableScaling(bool flag, float delta=0.0f); - - ////////////////////////////////////////////////////////////////////////// - /// Enable rotation during update. - /// - /// @param flag - Enable flag. - /// @param delta - Rate of rotation. - /// - ////////////////////////////////////////////////////////////////////////// - void EnableRotation(bool flag, float delta=0.0f); - - ////////////////////////////////////////////////////////////////////////// - /// Set rendering flags. - /// - /// @param flags - Rendering flags encoded in bits. - /// - ////////////////////////////////////////////////////////////////////////// - void SetRenderFlags(int flags); - - ////////////////////////////////////////////////////////////////////////// - /// Start flashing during render. - /// - ////////////////////////////////////////////////////////////////////////// - void StartFlashing(); - - ////////////////////////////////////////////////////////////////////////// - /// Start flashing during render. - /// - ////////////////////////////////////////////////////////////////////////// - void StopFlashing(); - - ////////////////////////////////////////////////////////////////////////// - /// Check if object is flashing. - /// - /// @return Flashing status. - /// - ////////////////////////////////////////////////////////////////////////// - bool IsFlashing(); - - - -private: - - u32 mRenderFlags; - - - bool mUseBoundingBox; - - float mBBoxX; - float mBBoxY; - float mBBoxWidth; - float mBBoxHeight; - - float mCenterX; - float mCenterY; - float mRadius; - - bool mDoAlpha; - float mAlphaDelta; - bool mDoScaling; - float mScaleDelta; - bool mDoRotation; - float mRotationDelta; - - bool mFlashing; - float mFlashTimer; - int mFlashCounter; - - -protected: - JGameObject *mCollisionTarget; - bool mCollided; - - int mHitPoint; - int mBlood; - int mOriginalBlood; - - -}; - - -#endif - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _JGAME_OBJECT_H_ +#define _JGAME_OBJECT_H_ + +#include "JTypes.h" +#include "JRenderer.h" +#include "JSprite.h" + + +#define FLASH_TIME 0.10f +#define FLASHING_COUNT 6 + +#define RENDER_FLAG_ANGLE 0x0001 +#define RENDER_FLAG_SIZE 0x0002 +#define RENDER_FLAG_ROTATION 0x0004 + + +////////////////////////////////////////////////////////////////////////// +/// A super Sprite class for in-game entities. Extra functions are added +/// in addition to a normal Sprite for easier control of in-game +/// activities. +/// +////////////////////////////////////////////////////////////////////////// +class JGameObject: public JSprite +{ + + +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + /// @param tex - Texture for first frame. NULL for no starting frame. + /// @param x - X position of texture for the frame. + /// @param y - Y position of texture for the frame. + /// @param width - Width of the frame. + /// @param height - Height of the frame. + /// + ////////////////////////////////////////////////////////////////////////// + JGameObject(JTexture *tex, float x, float y, float width, float height); + + virtual ~JGameObject(); + + ////////////////////////////////////////////////////////////////////////// + /// Update function. + /// + /// @param dt - Delta time since last update (in second). + /// + ////////////////////////////////////////////////////////////////////////// + virtual void Update(float dt); + + ////////////////////////////////////////////////////////////////////////// + /// Render current frame. + /// + ////////////////////////////////////////////////////////////////////////// + virtual void Render(); + + ////////////////////////////////////////////////////////////////////////// + /// Function to handle collision. + /// + ////////////////////////////////////////////////////////////////////////// + virtual void OnCollide(); + + ////////////////////////////////////////////////////////////////////////// + /// Set bounding box for collision detection. All the following collision + /// detections will be done using bounding box. + /// + /// @param x - X position of the bounding box (relative to this sprite). + /// @param y - Y position of the bounding box (relative to this sprite). + /// @param width - Width of the bounding box. + /// @param height - Height of the bounding box. + /// + ////////////////////////////////////////////////////////////////////////// + void SetBBox(float x, float y, float width, float height); + + ////////////////////////////////////////////////////////////////////////// + /// Get bounding box relative to screen position. + /// + /// @param x - X of screen position. + /// @param y - Y of screen position. + /// + /// @return xNow - X position of the bounding box (relative to screen). + /// @return yNow - Y position of the bounding box (relative to screen). + /// @return width - Width of the bounding box. + /// @return height - Height of the bounding box. + /// + ////////////////////////////////////////////////////////////////////////// + void GetBBox(float x, float y, float* xNow, float* yNow, float* width, float *height); + + ////////////////////////////////////////////////////////////////////////// + /// Set up a circle for collision detection. All the following collision + /// detections will be done using circle to circle collision detection. + /// + /// @param cx - X of the circle center. + /// @param cy - Y of the circle center. + /// @param radius - Radius of the circle. + /// + ////////////////////////////////////////////////////////////////////////// + void SetCollisionCircle(float cx, float cy, float radius); + + ////////////////////////////////////////////////////////////////////////// + /// Check for collision. Either bounding box or circle to circle + /// collision detection will be used depending on which one is setup last. + /// + /// @param target - Target to check for collision. + /// + ////////////////////////////////////////////////////////////////////////// + bool Collide(JGameObject *target); + + ////////////////////////////////////////////////////////////////////////// + /// Set object that has collided with this object. + /// + /// @param target - Object that has collided with this object. + ////////////////////////////////////////////////////////////////////////// + void SetCollisionTarget(JGameObject *target); + + ////////////////////////////////////////////////////////////////////////// + /// Get object that has collided with this object. + /// + /// @return Object that has collided with this object. + ////////////////////////////////////////////////////////////////////////// + JGameObject *GetCollisionTarget(); + + ////////////////////////////////////////////////////////////////////////// + /// Set damage point of this object. + /// + /// @param pt - Damage point. + ////////////////////////////////////////////////////////////////////////// + void SetHitPoint(int pt); + + ////////////////////////////////////////////////////////////////////////// + /// Get damage point of this object. + /// + /// @return Damage point. + ////////////////////////////////////////////////////////////////////////// + int GetHitPoint(); + + ////////////////////////////////////////////////////////////////////////// + /// Set blood of this object. + /// + /// @param pt - Blood value. + ////////////////////////////////////////////////////////////////////////// + void SetBlood(int pt); + + ////////////////////////////////////////////////////////////////////////// + /// Get blood of this object. + /// + /// @return Blood value. + ////////////////////////////////////////////////////////////////////////// + int GetBlood(); + + ////////////////////////////////////////////////////////////////////////// + /// Enable alpha animation during update. + /// + /// @param flag - Enable flag. + /// @param delta - Rate of changing the alpha value. + /// + ////////////////////////////////////////////////////////////////////////// + void EnableAlpha(bool flag, float delta=0.0f); + + ////////////////////////////////////////////////////////////////////////// + /// Enable scaling during update. + /// + /// @param flag - Enable flag. + /// @param delta - Rate of changing the scaling value. + /// + ////////////////////////////////////////////////////////////////////////// + void EnableScaling(bool flag, float delta=0.0f); + + ////////////////////////////////////////////////////////////////////////// + /// Enable rotation during update. + /// + /// @param flag - Enable flag. + /// @param delta - Rate of rotation. + /// + ////////////////////////////////////////////////////////////////////////// + void EnableRotation(bool flag, float delta=0.0f); + + ////////////////////////////////////////////////////////////////////////// + /// Set rendering flags. + /// + /// @param flags - Rendering flags encoded in bits. + /// + ////////////////////////////////////////////////////////////////////////// + void SetRenderFlags(int flags); + + ////////////////////////////////////////////////////////////////////////// + /// Start flashing during render. + /// + ////////////////////////////////////////////////////////////////////////// + void StartFlashing(); + + ////////////////////////////////////////////////////////////////////////// + /// Start flashing during render. + /// + ////////////////////////////////////////////////////////////////////////// + void StopFlashing(); + + ////////////////////////////////////////////////////////////////////////// + /// Check if object is flashing. + /// + /// @return Flashing status. + /// + ////////////////////////////////////////////////////////////////////////// + bool IsFlashing(); + + + +private: + + u32 mRenderFlags; + + + bool mUseBoundingBox; + + float mBBoxX; + float mBBoxY; + float mBBoxWidth; + float mBBoxHeight; + + float mCenterX; + float mCenterY; + float mRadius; + + bool mDoAlpha; + float mAlphaDelta; + bool mDoScaling; + float mScaleDelta; + bool mDoRotation; + float mRotationDelta; + + bool mFlashing; + float mFlashTimer; + int mFlashCounter; + + +protected: + JGameObject *mCollisionTarget; + bool mCollided; + + int mHitPoint; + int mBlood; + int mOriginalBlood; + + +}; + + +#endif + diff --git a/JGE/include/JLBFont.h b/JGE/include/JLBFont.h index 787c20473..24b846987 100644 --- a/JGE/include/JLBFont.h +++ b/JGE/include/JLBFont.h @@ -1,187 +1,187 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - - -#ifndef JLBF_H -#define JLBF_H - -#define PRINTF_BUFFER_SIZE 256 -#define MAX_CHAR 256 - -#include "JRenderer.h" -#include - -////////////////////////////////////////////////////////////////////////// -/// Bitmap font class for LMNOpc's Bitmap Font Builder: -/// http://www.lmnopc.com/bitmapfontbuilder/ -/// -/// Two files are used for each font: -/// 1: xxx.png, font bitmap. -/// 2: xxx.dat, widths for each character -/// Each font contains 2 sets of characters ASCII code (32-159). -/// -////////////////////////////////////////////////////////////////////////// -class JLBFont -{ -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - /// @param fontname - Name of the font WITHOUT extensions. - /// @param lineheight - Font height. - /// @param useVideoRAM - Indicate to use video RAM to store the font image or not (PSP only). - /// - ////////////////////////////////////////////////////////////////////////// - JLBFont(const char *fontname, int lineheight, bool useVideoRAM=false); - - ~JLBFont(); - - ////////////////////////////////////////////////////////////////////////// - /// Rendering text to screen. - /// - /// @param string - text for rendering. - /// @param x - X position of text. - /// @param y - Y position of text. - /// @align - Text aligment. - /// - ////////////////////////////////////////////////////////////////////////// - void DrawString(const char *string, float x, float y, int align=JGETEXT_LEFT, float leftOffset = 0, float width = 0); - void DrawString(std::string s, float x, float y, int align=JGETEXT_LEFT, float leftOffset = 0, float width = 0); - - ////////////////////////////////////////////////////////////////////////// - /// Rendering text to screen with syntax similar to printf of C/C++. - /// - /// @param x - X position of text. - /// @param y - Y position of text. - /// @param format - String formatting. - /// - ////////////////////////////////////////////////////////////////////////// - void printf(float x, float y, const char *format, ...); - - ////////////////////////////////////////////////////////////////////////// - /// Set font color. - /// - /// @param color - color of font. - /// - ////////////////////////////////////////////////////////////////////////// - void SetColor(PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Set scale for rendering. - /// - /// @param scale - Scale for rendering characters. - /// - ////////////////////////////////////////////////////////////////////////// - void SetScale(float scale); - - ////////////////////////////////////////////////////////////////////////// - /// Set angle for rendering. - /// - /// @param rot - Rotation angle in radian. - /// - ////////////////////////////////////////////////////////////////////////// - void SetRotation(float rot); - - ////////////////////////////////////////////////////////////////////////// - /// Set font tracking. - /// - /// @param tracking - Font tracking. - /// - ////////////////////////////////////////////////////////////////////////// - void SetTracking(float tracking); - - ////////////////////////////////////////////////////////////////////////// - /// Get font color. - /// - /// @return Font color. - /// - ////////////////////////////////////////////////////////////////////////// - PIXEL_TYPE GetColor() const; - - ////////////////////////////////////////////////////////////////////////// - /// Get rendering scale. - /// - /// @return Rendering scale. - /// - ////////////////////////////////////////////////////////////////////////// - float GetScale() const; - - ////////////////////////////////////////////////////////////////////////// - /// Get rendering angle. - /// - /// @return Rendering angle. - /// - ////////////////////////////////////////////////////////////////////////// - float GetRotation() const; - - ////////////////////////////////////////////////////////////////////////// - /// Get font tracking. - /// - /// @return Font tracking. - /// - ////////////////////////////////////////////////////////////////////////// - float GetTracking() const; - - ////////////////////////////////////////////////////////////////////////// - /// Get height of font. - /// - /// @return Height of font. - /// - ////////////////////////////////////////////////////////////////////////// - float GetHeight() const; - - ////////////////////////////////////////////////////////////////////////// - /// Get width of rendering string on screen. - /// - /// @param string - NULL terminated string. - /// - /// @return - Width in pixels - /// - ////////////////////////////////////////////////////////////////////////// - float GetStringWidth(const char *string) const; - - ////////////////////////////////////////////////////////////////////////// - /// There are usually 2 sets of characters in the font image. The first set - /// is from index 0-127 and the second from 128-255. You should use this - /// function to select which set of characters you want to use. The index - /// base should be either 0 or 128. - /// - /// @param base - Base for the character set to use. - /// - ////////////////////////////////////////////////////////////////////////// - void SetBase(int base); - - -private: - static JRenderer* mRenderer; - - JTexture* mTexture; - JQuad* mQuad; - - float mXPos[MAX_CHAR]; - float mYPos[MAX_CHAR]; - float mCharWidth[MAX_CHAR]; - - float mHeight; - float mScale; - float mRotation; - float mTracking; - float mSpacing; - - PIXEL_TYPE mColor; - int mBlend; - - int mBase; - -}; - - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + + +#ifndef JLBF_H +#define JLBF_H + +#define PRINTF_BUFFER_SIZE 256 +#define MAX_CHAR 256 + +#include "JRenderer.h" +#include + +////////////////////////////////////////////////////////////////////////// +/// Bitmap font class for LMNOpc's Bitmap Font Builder: +/// http://www.lmnopc.com/bitmapfontbuilder/ +/// +/// Two files are used for each font: +/// 1: xxx.png, font bitmap. +/// 2: xxx.dat, widths for each character +/// Each font contains 2 sets of characters ASCII code (32-159). +/// +////////////////////////////////////////////////////////////////////////// +class JLBFont +{ +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + /// @param fontname - Name of the font WITHOUT extensions. + /// @param lineheight - Font height. + /// @param useVideoRAM - Indicate to use video RAM to store the font image or not (PSP only). + /// + ////////////////////////////////////////////////////////////////////////// + JLBFont(const char *fontname, int lineheight, bool useVideoRAM=false); + + ~JLBFont(); + + ////////////////////////////////////////////////////////////////////////// + /// Rendering text to screen. + /// + /// @param string - text for rendering. + /// @param x - X position of text. + /// @param y - Y position of text. + /// @align - Text aligment. + /// + ////////////////////////////////////////////////////////////////////////// + void DrawString(const char *string, float x, float y, int align=JGETEXT_LEFT, float leftOffset = 0, float width = 0); + void DrawString(std::string s, float x, float y, int align=JGETEXT_LEFT, float leftOffset = 0, float width = 0); + + ////////////////////////////////////////////////////////////////////////// + /// Rendering text to screen with syntax similar to printf of C/C++. + /// + /// @param x - X position of text. + /// @param y - Y position of text. + /// @param format - String formatting. + /// + ////////////////////////////////////////////////////////////////////////// + void printf(float x, float y, const char *format, ...); + + ////////////////////////////////////////////////////////////////////////// + /// Set font color. + /// + /// @param color - color of font. + /// + ////////////////////////////////////////////////////////////////////////// + void SetColor(PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Set scale for rendering. + /// + /// @param scale - Scale for rendering characters. + /// + ////////////////////////////////////////////////////////////////////////// + void SetScale(float scale); + + ////////////////////////////////////////////////////////////////////////// + /// Set angle for rendering. + /// + /// @param rot - Rotation angle in radian. + /// + ////////////////////////////////////////////////////////////////////////// + void SetRotation(float rot); + + ////////////////////////////////////////////////////////////////////////// + /// Set font tracking. + /// + /// @param tracking - Font tracking. + /// + ////////////////////////////////////////////////////////////////////////// + void SetTracking(float tracking); + + ////////////////////////////////////////////////////////////////////////// + /// Get font color. + /// + /// @return Font color. + /// + ////////////////////////////////////////////////////////////////////////// + PIXEL_TYPE GetColor() const; + + ////////////////////////////////////////////////////////////////////////// + /// Get rendering scale. + /// + /// @return Rendering scale. + /// + ////////////////////////////////////////////////////////////////////////// + float GetScale() const; + + ////////////////////////////////////////////////////////////////////////// + /// Get rendering angle. + /// + /// @return Rendering angle. + /// + ////////////////////////////////////////////////////////////////////////// + float GetRotation() const; + + ////////////////////////////////////////////////////////////////////////// + /// Get font tracking. + /// + /// @return Font tracking. + /// + ////////////////////////////////////////////////////////////////////////// + float GetTracking() const; + + ////////////////////////////////////////////////////////////////////////// + /// Get height of font. + /// + /// @return Height of font. + /// + ////////////////////////////////////////////////////////////////////////// + float GetHeight() const; + + ////////////////////////////////////////////////////////////////////////// + /// Get width of rendering string on screen. + /// + /// @param string - NULL terminated string. + /// + /// @return - Width in pixels + /// + ////////////////////////////////////////////////////////////////////////// + float GetStringWidth(const char *string) const; + + ////////////////////////////////////////////////////////////////////////// + /// There are usually 2 sets of characters in the font image. The first set + /// is from index 0-127 and the second from 128-255. You should use this + /// function to select which set of characters you want to use. The index + /// base should be either 0 or 128. + /// + /// @param base - Base for the character set to use. + /// + ////////////////////////////////////////////////////////////////////////// + void SetBase(int base); + + +private: + static JRenderer* mRenderer; + + JTexture* mTexture; + JQuad* mQuad; + + float mXPos[MAX_CHAR]; + float mYPos[MAX_CHAR]; + float mCharWidth[MAX_CHAR]; + + float mHeight; + float mScale; + float mRotation; + float mTracking; + float mSpacing; + + PIXEL_TYPE mColor; + int mBlend; + + int mBase; + +}; + + +#endif diff --git a/JGE/include/JMD2Model.h b/JGE/include/JMD2Model.h index 52c1a67c5..2ef86dce0 100644 --- a/JGE/include/JMD2Model.h +++ b/JGE/include/JMD2Model.h @@ -1,255 +1,255 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _MD2MODEL_H -#define _MD2MODEL_H - -#if defined (WIN32) || defined (LINUX) || defined (IOS) - -#else - -#include -#include - - - -#endif - - -#include "JGE.h" -#include "Vector3D.h" - - -#define SMALLEST_FP 0.000001f - -#define MAX_FRAMES 512 -#define MAX_ANIMATION 16 - -//#pragma pack(push) -#pragma pack(1) -//#pragma pack(pop) - - - - -//------------------------------------------------------------------------------------------------- -enum MD2AnimationStates -{ - STATE_IDLE, - STATE_RUNNING, - STATE_SHOT_NOT_FALLING_DOWN, - STATE_SHOT_IN_SHOULDER, - STATE_JUMP, - STATE_IDLE2, - STATE_SHOT_FALLING_DOWN, - STATE_IDLE3, - STATE_IDLE4, - STATE_CROUCHING, - STATE_CROUCHING_CRAWL, - STATE_IDLE_CROUCHING, - STATE_KNEELING_DYING, - STATE_FALLING_BACK_DYING, - STATE_FALING_FORWARD_DYING, - STATE_FALLING_BACK_SLOWLY_DYING -}; - - -//------------------------------------------------------------------------------------------------- -class MD2Animation -{ -public: - int mStartFrame; - int mEndFrame; - - MD2Animation(int start, int end); - -}; - - -//------------------------------------------------------------------------------------------------- -// texture coordinate -typedef struct -{ - float s; - float t; -} texCoord_t; - - -//------------------------------------------------------------------------------------------------- -// texture coordinate index -typedef struct -{ - short s; - short t; -} stIndex_t; - - -//------------------------------------------------------------------------------------------------- -// info for a single frame point -typedef struct -{ - unsigned char v[3]; - unsigned char normalIndex; // not used -} framePoint_t; - - -//------------------------------------------------------------------------------------------------- -// information for a single frame -typedef struct -{ - float scale[3]; - float translate[3]; - char name[16]; - framePoint_t fp[1]; -} frame_t; - - -//------------------------------------------------------------------------------------------------- -// data for a single triangle -typedef struct -{ - unsigned short meshIndex[3]; // vertex indices - unsigned short stIndex[3]; // texture coordinate indices -} mesh_t; - - -//------------------------------------------------------------------------------------------------- -// the model data -typedef struct -{ - int numFrames; // number of frames - int numPoints; // number of points - int numTriangles; // number of triangles - int numST; // number of skins - int frameSize; // size of each frame in bytes - int texWidth, texHeight; // texture width, height - int currentFrame; // current frame # in animation - int nextFrame; // next frame # in animation - float interpol; // percent through current frame - mesh_t *triIndex; // triangle list - texCoord_t *st; // texture coordinate list - Vector3D *pointList; // vertex list - JTexture *modelTex; // texture -} modelData_t; - - -//------------------------------------------------------------------------------------------------- -typedef struct -{ - int ident; // identifies as MD2 file "IDP2" - int version; // - int skinwidth; // width of texture - int skinheight; // height of texture - int framesize; // number of bytes per frame - int numSkins; // number of textures - int numXYZ; // number of points - int numST; // number of texture - int numTris; // number of triangles - int numGLcmds; - int numFrames; // total number of frames - int offsetSkins; // offset to skin names (64 bytes each) - int offsetST; // offset of texture s-t values - int offsetTris; // offset of triangle mesh - int offsetFrames; // offset of frame data (points) - int offsetGLcmds; // type of OpenGL commands to use - int offsetEnd; // end of file -} modelHeader_t; - - -class JRenderer; - -////////////////////////////////////////////////////////////////////////// -/// Helper class to display Quake 2 MD2 model. -/// -////////////////////////////////////////////////////////////////////////// -class JMD2Model -{ -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - ////////////////////////////////////////////////////////////////////////// - JMD2Model(); - - ~JMD2Model(); - - ////////////////////////////////////////////////////////////////////////// - /// Set model state. - /// - /// @param newState - Model state. - /// - ////////////////////////////////////////////////////////////////////////// - void SetState(int newState); - - ////////////////////////////////////////////////////////////////////////// - /// Load MD2 model. - /// - /// @param filename - Name of MD2 file. - /// @param texturenName - Name of texture. - /// - ////////////////////////////////////////////////////////////////////////// - bool Load(char *filename, char *textureName); - - ////////////////////////////////////////////////////////////////////////// - /// Render a single frame of the model. - /// - /// @param frameNum - Frame to render. - /// - ////////////////////////////////////////////////////////////////////////// - void Render(int frameNum); - - ////////////////////////////////////////////////////////////////////////// - /// Update animation. - /// - /// @param dt - Time elpased since last update (in seconds). - /// - ////////////////////////////////////////////////////////////////////////// - void Update(float dt); - - ////////////////////////////////////////////////////////////////////////// - /// Set speed of animation. - /// - /// @param speed - Speed of animation. - /// - ////////////////////////////////////////////////////////////////////////// - void SetAnimationSpeed(float speed); - - ////////////////////////////////////////////////////////////////////////// - /// Render the model. - /// - /// @param percent - Interpolating percentage. - /// - ////////////////////////////////////////////////////////////////////////// - void Render(); - - - -private: - modelData_t *mModel; - - void CheckNextState(); - -#if defined (WIN32) || defined (LINUX) || defined (IOS) - void CalculateNormal(float *p1, float *p2, float *p3); -#else - void CalculateNormal(ScePspFVector3* normal, float *p1, float *p2, float *p3); -#endif - - MD2Animation **mAnimations; - int mState; - int mNextState; - - float mAnimationSpeed; - - static JRenderer* mRenderer; - -}; - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _MD2MODEL_H +#define _MD2MODEL_H + +#if defined (WIN32) || defined (LINUX) || defined (IOS) + +#else + +#include +#include + + + +#endif + + +#include "JGE.h" +#include "Vector3D.h" + + +#define SMALLEST_FP 0.000001f + +#define MAX_FRAMES 512 +#define MAX_ANIMATION 16 + +//#pragma pack(push) +#pragma pack(1) +//#pragma pack(pop) + + + + +//------------------------------------------------------------------------------------------------- +enum MD2AnimationStates +{ + STATE_IDLE, + STATE_RUNNING, + STATE_SHOT_NOT_FALLING_DOWN, + STATE_SHOT_IN_SHOULDER, + STATE_JUMP, + STATE_IDLE2, + STATE_SHOT_FALLING_DOWN, + STATE_IDLE3, + STATE_IDLE4, + STATE_CROUCHING, + STATE_CROUCHING_CRAWL, + STATE_IDLE_CROUCHING, + STATE_KNEELING_DYING, + STATE_FALLING_BACK_DYING, + STATE_FALING_FORWARD_DYING, + STATE_FALLING_BACK_SLOWLY_DYING +}; + + +//------------------------------------------------------------------------------------------------- +class MD2Animation +{ +public: + int mStartFrame; + int mEndFrame; + + MD2Animation(int start, int end); + +}; + + +//------------------------------------------------------------------------------------------------- +// texture coordinate +typedef struct +{ + float s; + float t; +} texCoord_t; + + +//------------------------------------------------------------------------------------------------- +// texture coordinate index +typedef struct +{ + short s; + short t; +} stIndex_t; + + +//------------------------------------------------------------------------------------------------- +// info for a single frame point +typedef struct +{ + unsigned char v[3]; + unsigned char normalIndex; // not used +} framePoint_t; + + +//------------------------------------------------------------------------------------------------- +// information for a single frame +typedef struct +{ + float scale[3]; + float translate[3]; + char name[16]; + framePoint_t fp[1]; +} frame_t; + + +//------------------------------------------------------------------------------------------------- +// data for a single triangle +typedef struct +{ + unsigned short meshIndex[3]; // vertex indices + unsigned short stIndex[3]; // texture coordinate indices +} mesh_t; + + +//------------------------------------------------------------------------------------------------- +// the model data +typedef struct +{ + int numFrames; // number of frames + int numPoints; // number of points + int numTriangles; // number of triangles + int numST; // number of skins + int frameSize; // size of each frame in bytes + int texWidth, texHeight; // texture width, height + int currentFrame; // current frame # in animation + int nextFrame; // next frame # in animation + float interpol; // percent through current frame + mesh_t *triIndex; // triangle list + texCoord_t *st; // texture coordinate list + Vector3D *pointList; // vertex list + JTexture *modelTex; // texture +} modelData_t; + + +//------------------------------------------------------------------------------------------------- +typedef struct +{ + int ident; // identifies as MD2 file "IDP2" + int version; // + int skinwidth; // width of texture + int skinheight; // height of texture + int framesize; // number of bytes per frame + int numSkins; // number of textures + int numXYZ; // number of points + int numST; // number of texture + int numTris; // number of triangles + int numGLcmds; + int numFrames; // total number of frames + int offsetSkins; // offset to skin names (64 bytes each) + int offsetST; // offset of texture s-t values + int offsetTris; // offset of triangle mesh + int offsetFrames; // offset of frame data (points) + int offsetGLcmds; // type of OpenGL commands to use + int offsetEnd; // end of file +} modelHeader_t; + + +class JRenderer; + +////////////////////////////////////////////////////////////////////////// +/// Helper class to display Quake 2 MD2 model. +/// +////////////////////////////////////////////////////////////////////////// +class JMD2Model +{ +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + ////////////////////////////////////////////////////////////////////////// + JMD2Model(); + + ~JMD2Model(); + + ////////////////////////////////////////////////////////////////////////// + /// Set model state. + /// + /// @param newState - Model state. + /// + ////////////////////////////////////////////////////////////////////////// + void SetState(int newState); + + ////////////////////////////////////////////////////////////////////////// + /// Load MD2 model. + /// + /// @param filename - Name of MD2 file. + /// @param texturenName - Name of texture. + /// + ////////////////////////////////////////////////////////////////////////// + bool Load(char *filename, char *textureName); + + ////////////////////////////////////////////////////////////////////////// + /// Render a single frame of the model. + /// + /// @param frameNum - Frame to render. + /// + ////////////////////////////////////////////////////////////////////////// + void Render(int frameNum); + + ////////////////////////////////////////////////////////////////////////// + /// Update animation. + /// + /// @param dt - Time elpased since last update (in seconds). + /// + ////////////////////////////////////////////////////////////////////////// + void Update(float dt); + + ////////////////////////////////////////////////////////////////////////// + /// Set speed of animation. + /// + /// @param speed - Speed of animation. + /// + ////////////////////////////////////////////////////////////////////////// + void SetAnimationSpeed(float speed); + + ////////////////////////////////////////////////////////////////////////// + /// Render the model. + /// + /// @param percent - Interpolating percentage. + /// + ////////////////////////////////////////////////////////////////////////// + void Render(); + + + +private: + modelData_t *mModel; + + void CheckNextState(); + +#if defined (WIN32) || defined (LINUX) || defined (IOS) + void CalculateNormal(float *p1, float *p2, float *p3); +#else + void CalculateNormal(ScePspFVector3* normal, float *p1, float *p2, float *p3); +#endif + + MD2Animation **mAnimations; + int mState; + int mNextState; + + float mAnimationSpeed; + + static JRenderer* mRenderer; + +}; + +#endif diff --git a/JGE/include/JOBJModel.h b/JGE/include/JOBJModel.h index ca5392f26..557da2726 100644 --- a/JGE/include/JOBJModel.h +++ b/JGE/include/JOBJModel.h @@ -1,82 +1,82 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _OBJMODEL_H -#define _OBJMODEL_H - -#include - -using namespace std; - -#if defined (WIN32) || defined (LINUX) || defined (IOS) - -#else - -#include -#include - - - -#endif - - -#include "JGE.h" -#include "Vector3D.h" - -class JTexture; - -////////////////////////////////////////////////////////////////////////// -/// Helper class to display Wavefront OBJ model. -/// -////////////////////////////////////////////////////////////////////////// -class JOBJModel -{ - -struct Face -{ - int mVertCount; - int mVertIdx[4]; - int mTexIdx[4]; - int mNormalIdx[4]; -}; - -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - ////////////////////////////////////////////////////////////////////////// - JOBJModel(); - - ~JOBJModel(); - - int ReadLine(char *output, const char *buffer, int start, int size); - - ////////////////////////////////////////////////////////////////////////// - /// Load OBJ model. - /// - /// @param modelName - Name of OBJ file. - /// @param texturenName - Name of texture. - /// - ////////////////////////////////////////////////////////////////////////// - bool Load(const char *modelName, const char *textureName); - - ////////////////////////////////////////////////////////////////////////// - /// Render the model to screen. - /// - ////////////////////////////////////////////////////////////////////////// - void Render(); - -private: - int mPolycount; - Vertex3D* mPolygons; - JTexture* mTexture; -}; - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _OBJMODEL_H +#define _OBJMODEL_H + +#include + +using namespace std; + +#if defined (WIN32) || defined (LINUX) || defined (IOS) + +#else + +#include +#include + + + +#endif + + +#include "JGE.h" +#include "Vector3D.h" + +class JTexture; + +////////////////////////////////////////////////////////////////////////// +/// Helper class to display Wavefront OBJ model. +/// +////////////////////////////////////////////////////////////////////////// +class JOBJModel +{ + +struct Face +{ + int mVertCount; + int mVertIdx[4]; + int mTexIdx[4]; + int mNormalIdx[4]; +}; + +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + ////////////////////////////////////////////////////////////////////////// + JOBJModel(); + + ~JOBJModel(); + + int ReadLine(char *output, const char *buffer, int start, int size); + + ////////////////////////////////////////////////////////////////////////// + /// Load OBJ model. + /// + /// @param modelName - Name of OBJ file. + /// @param texturenName - Name of texture. + /// + ////////////////////////////////////////////////////////////////////////// + bool Load(const char *modelName, const char *textureName); + + ////////////////////////////////////////////////////////////////////////// + /// Render the model to screen. + /// + ////////////////////////////////////////////////////////////////////////// + void Render(); + +private: + int mPolycount; + Vertex3D* mPolygons; + JTexture* mTexture; +}; + +#endif diff --git a/JGE/include/JParticle.h b/JGE/include/JParticle.h index 62bb788b0..0a3412e64 100644 --- a/JGE/include/JParticle.h +++ b/JGE/include/JParticle.h @@ -1,105 +1,105 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef __PARTICLE_H__ -#define __PARTICLE_H__ - -#include "JApp.h" -#include "JRenderer.h" -#include "Vector2D.h" - - -#define MAX_KEYS 8 - -class JParticleData -{ -public: - JParticleData(); - void Init(); - void Clear(); - void AddKey(float keyTime, float keyValue); - void Update(float dt); - void SetScale(float scale); - - float mCurr; - float mTarget; - float mDelta; - float mTimer; - int mKeyCount; - int mKeyIndex; - float mKeyTime[MAX_KEYS]; - float mKeyValue[MAX_KEYS]; - - float mScale; -}; - - -enum ParticleField -{ - FIELD_SPEED, - FIELD_SIZE, - FIELD_ROTATION, - FIELD_ALPHA, - FIELD_RED, - FIELD_GREEN, - FIELD_BLUE, - FIELD_RADIAL_ACCEL, - FIELD_TANGENTIAL_ACCEL, - FIELD_GRAVITY, - FIELD_COUNT -}; - -class JParticle -{ -public: - - bool mActive; - - JParticle(); - ~JParticle(); - - bool Update(float dt); - void Render(); - void Init(float lifeTime); - - void InitPosition(float ox, float oy, float xoffset, float yoffset); - void SetPosition(float x, float y); - void SetQuad(JQuad *quad); - - JParticleData* GetField(int index); - JParticleData* GetDataPtr(); - - void Move(float x, float y); - void SetVelocity(float x, float y); - void SetSize(float size); - - -private: - static JRenderer* mRenderer; - JQuad* mQuad; - - Vector2D mOrigin; - Vector2D mPos; - Vector2D mVelocity; - - //float mSpeed; - float mSize; - - float mLifetime; - - JParticleData mData[FIELD_COUNT]; - - - - -}; - - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef __PARTICLE_H__ +#define __PARTICLE_H__ + +#include "JApp.h" +#include "JRenderer.h" +#include "Vector2D.h" + + +#define MAX_KEYS 8 + +class JParticleData +{ +public: + JParticleData(); + void Init(); + void Clear(); + void AddKey(float keyTime, float keyValue); + void Update(float dt); + void SetScale(float scale); + + float mCurr; + float mTarget; + float mDelta; + float mTimer; + int mKeyCount; + int mKeyIndex; + float mKeyTime[MAX_KEYS]; + float mKeyValue[MAX_KEYS]; + + float mScale; +}; + + +enum ParticleField +{ + FIELD_SPEED, + FIELD_SIZE, + FIELD_ROTATION, + FIELD_ALPHA, + FIELD_RED, + FIELD_GREEN, + FIELD_BLUE, + FIELD_RADIAL_ACCEL, + FIELD_TANGENTIAL_ACCEL, + FIELD_GRAVITY, + FIELD_COUNT +}; + +class JParticle +{ +public: + + bool mActive; + + JParticle(); + ~JParticle(); + + bool Update(float dt); + void Render(); + void Init(float lifeTime); + + void InitPosition(float ox, float oy, float xoffset, float yoffset); + void SetPosition(float x, float y); + void SetQuad(JQuad *quad); + + JParticleData* GetField(int index); + JParticleData* GetDataPtr(); + + void Move(float x, float y); + void SetVelocity(float x, float y); + void SetSize(float size); + + +private: + static JRenderer* mRenderer; + JQuad* mQuad; + + Vector2D mOrigin; + Vector2D mPos; + Vector2D mVelocity; + + //float mSpeed; + float mSize; + + float mLifetime; + + JParticleData mData[FIELD_COUNT]; + + + + +}; + + +#endif diff --git a/JGE/include/JParticleEffect.h b/JGE/include/JParticleEffect.h index f69559e02..ab0fda163 100644 --- a/JGE/include/JParticleEffect.h +++ b/JGE/include/JParticleEffect.h @@ -1,146 +1,146 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef __PARTICLE_EFFECT_H__ -#define __PARTICLE_EFFECT_H__ - -#define MAX_EMITTER 5 - -class JParticleSystem; -class JParticleEmitter; -class JResourceManager; - - -////////////////////////////////////////////////////////////////////////// -/// Particle effect. Each particle effect can contain one or more emitters. -/// -////////////////////////////////////////////////////////////////////////// -class JParticleEffect -{ -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - /// @param mgr - Resource manager for retrieving image quads for the particles. - /// - ////////////////////////////////////////////////////////////////////////// - JParticleEffect(JResourceManager* mgr); - - ~JParticleEffect(); - - ////////////////////////////////////////////////////////////////////////// - /// Load effect from file. - /// - /// @param filename - Name of effect file. - /// - ////////////////////////////////////////////////////////////////////////// - bool Load(const char* filename); - - - ////////////////////////////////////////////////////////////////////////// - /// Update particle effect. - /// - /// @param dt - Time elapsed since last update (in second). - /// - ////////////////////////////////////////////////////////////////////////// - void Update(float dt); - - ////////////////////////////////////////////////////////////////////////// - /// Render particle effect. - /// - ////////////////////////////////////////////////////////////////////////// - void Render(); - - ////////////////////////////////////////////////////////////////////////// - /// Check if the particle effect is finished. - /// - /// @return True if done. - /// - ////////////////////////////////////////////////////////////////////////// - bool Done(); - - ////////////////////////////////////////////////////////////////////////// - /// Start playing. - /// - ////////////////////////////////////////////////////////////////////////// - void Start(); - - ////////////////////////////////////////////////////////////////////////// - /// Stop playing. - /// - ////////////////////////////////////////////////////////////////////////// - void Stop(); - - ////////////////////////////////////////////////////////////////////////// - /// Set particle system. - /// - /// @param particleSys - Particle system. - /// - ////////////////////////////////////////////////////////////////////////// - void SetParticleSystem(JParticleSystem* particleSys); - - ////////////////////////////////////////////////////////////////////////// - /// Get particle system. - /// - /// @return Particle system. - /// - ////////////////////////////////////////////////////////////////////////// - JParticleSystem* GetParticleSystem(); - - ////////////////////////////////////////////////////////////////////////// - /// Set position of the effect. New particles will be emitted from the - /// new position but the existing active particles will not be affected. - /// - /// @param x - X screen position. - /// @param y - Y screen position. - /// - ////////////////////////////////////////////////////////////////////////// - void SetPosition(float x, float y); - - ////////////////////////////////////////////////////////////////////////// - /// Get X position. - /// - /// @return X position. - /// - ////////////////////////////////////////////////////////////////////////// - float GetX(); - - ////////////////////////////////////////////////////////////////////////// - /// Get Y position. - /// - /// @return Y position. - /// - ////////////////////////////////////////////////////////////////////////// - float GetY(); - - ////////////////////////////////////////////////////////////////////////// - /// Move the particle effect over to a new position. All the existing - /// particles will be moved relatively. - /// - /// @param X - X screen position. - /// @param y - Y screen position. - /// - ////////////////////////////////////////////////////////////////////////// - void MoveTo(float x, float y); - -protected: - JParticleSystem* mParticleSystem; - JResourceManager* mResourceManager; - float mX; - float mY; - - int mEmitterCount; - JParticleEmitter* mParticleEmitters[MAX_EMITTER]; -}; - - -#endif - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef __PARTICLE_EFFECT_H__ +#define __PARTICLE_EFFECT_H__ + +#define MAX_EMITTER 5 + +class JParticleSystem; +class JParticleEmitter; +class JResourceManager; + + +////////////////////////////////////////////////////////////////////////// +/// Particle effect. Each particle effect can contain one or more emitters. +/// +////////////////////////////////////////////////////////////////////////// +class JParticleEffect +{ +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + /// @param mgr - Resource manager for retrieving image quads for the particles. + /// + ////////////////////////////////////////////////////////////////////////// + JParticleEffect(JResourceManager* mgr); + + ~JParticleEffect(); + + ////////////////////////////////////////////////////////////////////////// + /// Load effect from file. + /// + /// @param filename - Name of effect file. + /// + ////////////////////////////////////////////////////////////////////////// + bool Load(const char* filename); + + + ////////////////////////////////////////////////////////////////////////// + /// Update particle effect. + /// + /// @param dt - Time elapsed since last update (in second). + /// + ////////////////////////////////////////////////////////////////////////// + void Update(float dt); + + ////////////////////////////////////////////////////////////////////////// + /// Render particle effect. + /// + ////////////////////////////////////////////////////////////////////////// + void Render(); + + ////////////////////////////////////////////////////////////////////////// + /// Check if the particle effect is finished. + /// + /// @return True if done. + /// + ////////////////////////////////////////////////////////////////////////// + bool Done(); + + ////////////////////////////////////////////////////////////////////////// + /// Start playing. + /// + ////////////////////////////////////////////////////////////////////////// + void Start(); + + ////////////////////////////////////////////////////////////////////////// + /// Stop playing. + /// + ////////////////////////////////////////////////////////////////////////// + void Stop(); + + ////////////////////////////////////////////////////////////////////////// + /// Set particle system. + /// + /// @param particleSys - Particle system. + /// + ////////////////////////////////////////////////////////////////////////// + void SetParticleSystem(JParticleSystem* particleSys); + + ////////////////////////////////////////////////////////////////////////// + /// Get particle system. + /// + /// @return Particle system. + /// + ////////////////////////////////////////////////////////////////////////// + JParticleSystem* GetParticleSystem(); + + ////////////////////////////////////////////////////////////////////////// + /// Set position of the effect. New particles will be emitted from the + /// new position but the existing active particles will not be affected. + /// + /// @param x - X screen position. + /// @param y - Y screen position. + /// + ////////////////////////////////////////////////////////////////////////// + void SetPosition(float x, float y); + + ////////////////////////////////////////////////////////////////////////// + /// Get X position. + /// + /// @return X position. + /// + ////////////////////////////////////////////////////////////////////////// + float GetX(); + + ////////////////////////////////////////////////////////////////////////// + /// Get Y position. + /// + /// @return Y position. + /// + ////////////////////////////////////////////////////////////////////////// + float GetY(); + + ////////////////////////////////////////////////////////////////////////// + /// Move the particle effect over to a new position. All the existing + /// particles will be moved relatively. + /// + /// @param X - X screen position. + /// @param y - Y screen position. + /// + ////////////////////////////////////////////////////////////////////////// + void MoveTo(float x, float y); + +protected: + JParticleSystem* mParticleSystem; + JResourceManager* mResourceManager; + float mX; + float mY; + + int mEmitterCount; + JParticleEmitter* mParticleEmitters[MAX_EMITTER]; +}; + + +#endif + diff --git a/JGE/include/JParticleEmitter.h b/JGE/include/JParticleEmitter.h index aa0975d05..acdbc3068 100644 --- a/JGE/include/JParticleEmitter.h +++ b/JGE/include/JParticleEmitter.h @@ -1,221 +1,221 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef __PARTICLE_EMITTER_H__ -#define __PARTICLE_EMITTER_H__ - -#define INIT_PARTICLE_COUNT 32 -#define MAX_PARTICLE_COUNT 256 - -#include -#include - -using namespace std; - - -class JParticleEffect; -class JParticle; - - -////////////////////////////////////////////////////////////////////////// -/// Particle emitter. This is where the particles actually generated. -/// -////////////////////////////////////////////////////////////////////////// -class JParticleEmitter -{ -public: - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - /// @param parent - Particle effect that contains this emitter. - /// - ////////////////////////////////////////////////////////////////////////// - JParticleEmitter(JParticleEffect* parent); - - ~JParticleEmitter(); - - ////////////////////////////////////////////////////////////////////////// - /// Set blending mode for rendering. - /// - /// @param srcBlend - Blending mode for source. - /// @param destBlend - Blending mode for destination. - /// - ////////////////////////////////////////////////////////////////////////// - void SetBlending(int srcBlend, int destBlend); - - ////////////////////////////////////////////////////////////////////////// - /// Set image quad for particles. - /// - /// @param quad - Image quad. - /// - ////////////////////////////////////////////////////////////////////////// - void SetQuad(JQuad *quad); - - ////////////////////////////////////////////////////////////////////////// - /// Start emitting particles. - /// - ////////////////////////////////////////////////////////////////////////// - void Start(); - - ////////////////////////////////////////////////////////////////////////// - /// Restart the emitter. - /// - ////////////////////////////////////////////////////////////////////////// - void ReStart(); - - ////////////////////////////////////////////////////////////////////////// - /// Update the emitter. - /// - /// @param dt - Time elapsed since last update (in second). - /// - ////////////////////////////////////////////////////////////////////////// - void Update(float dt); - - ////////////////////////////////////////////////////////////////////////// - /// Render particles emitted by this emitter. - /// - ////////////////////////////////////////////////////////////////////////// - void Render(); - - ////////////////////////////////////////////////////////////////////////// - /// Check if the emitter is done. - /// - /// @return True if the emitter is done. - /// - ////////////////////////////////////////////////////////////////////////// - bool Done(); - - ////////////////////////////////////////////////////////////////////////// - /// Set active flag. - /// - /// @param flag - Active flag. - /// - ////////////////////////////////////////////////////////////////////////// - void SetActive(bool flag); - - ////////////////////////////////////////////////////////////////////////// - /// Move all particles to a distance. - /// - /// @param x - X distance to move. - /// @param y - Y distance to move - /// - ////////////////////////////////////////////////////////////////////////// - void MoveAllParticles(float x, float y); - - ////////////////////////////////////////////////////////////////////////// - /// Emit certain amount of particles. - /// - /// @param count - Number of particles to emit. - /// - ////////////////////////////////////////////////////////////////////////// - void EmitParticles(int count); - - ////////////////////////////////////////////////////////////////////////// - /// Get idle particle to reuse. - /// - /// @return Idel particle to use. - /// - ////////////////////////////////////////////////////////////////////////// - JParticle* GetIdleParticle(); - - ////////////////////////////////////////////////////////////////////////// - /// Put a particle in action. - /// - /// @param par - Particle to start playing. - /// - ////////////////////////////////////////////////////////////////////////// - void StartParticle(JParticle *par); - - ////////////////////////////////////////////////////////////////////////// - /// Set the maximum number of particles that this emitter can emit. - /// - /// @param count - Maximum number of particles. - /// - ////////////////////////////////////////////////////////////////////////// - void SetMaxParticleCount(int count); - - ////////////////////////////////////////////////////////////////////////// - /// \enum JParticleEmitterMode - /// - ////////////////////////////////////////////////////////////////////////// - enum JParticleEmitterMode - { - MODE_REPEAT, ///< Emit particles and repeat when done. - MODE_ONCE, ///< Emit once. - MODE_NTIMES, ///< Emit N times. - MODE_CONTINUOUS, ///< Emit particles continuously. - MODE_COUNT - }; - - ////////////////////////////////////////////////////////////////////////// - /// \enum JParticleEmitterType - /// - ////////////////////////////////////////////////////////////////////////// - enum JParticleEmitterType - { - TYPE_POINT, ///< Emit from one point. - TYPE_AREA, ///< Emit from a rectangle area. - TYPE_HORIZONTAL, ///< Emit from a horizontal line. - TYPE_VERTICAL, ///< Emit from a vertical line. - TYPE_CIRCLE, ///< Emit from a circle. - TYPE_COUNT - }; - -protected: - JParticleEffect* mParent; - JQuad* mQuad; - -public: - int mType; - int mId; - - JParticleData mQuantity; - JParticleData mData[FIELD_COUNT]; - - float mLifeBase; - float mLifeMax; - - float mAngleBase; - float mAngleMax; - - float mSpeedBase; - float mSpeedMax; - - float mSizeBase; - float mSizeMax; - - int mWidth; - int mHeight; - - int mQuadIndex; - - int mEmitterMode; - int mRepeatTimes; - - float mLife; - - -private: - bool mActive; - float mEmitTimer; - - int mRepeatCounter; - int mActiveParticleCount; - - int mSrcBlending; - int mDestBlending; - int mMaxParticleCount; - - vector mParticles; - -}; - -#endif - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef __PARTICLE_EMITTER_H__ +#define __PARTICLE_EMITTER_H__ + +#define INIT_PARTICLE_COUNT 32 +#define MAX_PARTICLE_COUNT 256 + +#include +#include + +using namespace std; + + +class JParticleEffect; +class JParticle; + + +////////////////////////////////////////////////////////////////////////// +/// Particle emitter. This is where the particles actually generated. +/// +////////////////////////////////////////////////////////////////////////// +class JParticleEmitter +{ +public: + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + /// @param parent - Particle effect that contains this emitter. + /// + ////////////////////////////////////////////////////////////////////////// + JParticleEmitter(JParticleEffect* parent); + + ~JParticleEmitter(); + + ////////////////////////////////////////////////////////////////////////// + /// Set blending mode for rendering. + /// + /// @param srcBlend - Blending mode for source. + /// @param destBlend - Blending mode for destination. + /// + ////////////////////////////////////////////////////////////////////////// + void SetBlending(int srcBlend, int destBlend); + + ////////////////////////////////////////////////////////////////////////// + /// Set image quad for particles. + /// + /// @param quad - Image quad. + /// + ////////////////////////////////////////////////////////////////////////// + void SetQuad(JQuad *quad); + + ////////////////////////////////////////////////////////////////////////// + /// Start emitting particles. + /// + ////////////////////////////////////////////////////////////////////////// + void Start(); + + ////////////////////////////////////////////////////////////////////////// + /// Restart the emitter. + /// + ////////////////////////////////////////////////////////////////////////// + void ReStart(); + + ////////////////////////////////////////////////////////////////////////// + /// Update the emitter. + /// + /// @param dt - Time elapsed since last update (in second). + /// + ////////////////////////////////////////////////////////////////////////// + void Update(float dt); + + ////////////////////////////////////////////////////////////////////////// + /// Render particles emitted by this emitter. + /// + ////////////////////////////////////////////////////////////////////////// + void Render(); + + ////////////////////////////////////////////////////////////////////////// + /// Check if the emitter is done. + /// + /// @return True if the emitter is done. + /// + ////////////////////////////////////////////////////////////////////////// + bool Done(); + + ////////////////////////////////////////////////////////////////////////// + /// Set active flag. + /// + /// @param flag - Active flag. + /// + ////////////////////////////////////////////////////////////////////////// + void SetActive(bool flag); + + ////////////////////////////////////////////////////////////////////////// + /// Move all particles to a distance. + /// + /// @param x - X distance to move. + /// @param y - Y distance to move + /// + ////////////////////////////////////////////////////////////////////////// + void MoveAllParticles(float x, float y); + + ////////////////////////////////////////////////////////////////////////// + /// Emit certain amount of particles. + /// + /// @param count - Number of particles to emit. + /// + ////////////////////////////////////////////////////////////////////////// + void EmitParticles(int count); + + ////////////////////////////////////////////////////////////////////////// + /// Get idle particle to reuse. + /// + /// @return Idel particle to use. + /// + ////////////////////////////////////////////////////////////////////////// + JParticle* GetIdleParticle(); + + ////////////////////////////////////////////////////////////////////////// + /// Put a particle in action. + /// + /// @param par - Particle to start playing. + /// + ////////////////////////////////////////////////////////////////////////// + void StartParticle(JParticle *par); + + ////////////////////////////////////////////////////////////////////////// + /// Set the maximum number of particles that this emitter can emit. + /// + /// @param count - Maximum number of particles. + /// + ////////////////////////////////////////////////////////////////////////// + void SetMaxParticleCount(int count); + + ////////////////////////////////////////////////////////////////////////// + /// \enum JParticleEmitterMode + /// + ////////////////////////////////////////////////////////////////////////// + enum JParticleEmitterMode + { + MODE_REPEAT, ///< Emit particles and repeat when done. + MODE_ONCE, ///< Emit once. + MODE_NTIMES, ///< Emit N times. + MODE_CONTINUOUS, ///< Emit particles continuously. + MODE_COUNT + }; + + ////////////////////////////////////////////////////////////////////////// + /// \enum JParticleEmitterType + /// + ////////////////////////////////////////////////////////////////////////// + enum JParticleEmitterType + { + TYPE_POINT, ///< Emit from one point. + TYPE_AREA, ///< Emit from a rectangle area. + TYPE_HORIZONTAL, ///< Emit from a horizontal line. + TYPE_VERTICAL, ///< Emit from a vertical line. + TYPE_CIRCLE, ///< Emit from a circle. + TYPE_COUNT + }; + +protected: + JParticleEffect* mParent; + JQuad* mQuad; + +public: + int mType; + int mId; + + JParticleData mQuantity; + JParticleData mData[FIELD_COUNT]; + + float mLifeBase; + float mLifeMax; + + float mAngleBase; + float mAngleMax; + + float mSpeedBase; + float mSpeedMax; + + float mSizeBase; + float mSizeMax; + + int mWidth; + int mHeight; + + int mQuadIndex; + + int mEmitterMode; + int mRepeatTimes; + + float mLife; + + +private: + bool mActive; + float mEmitTimer; + + int mRepeatCounter; + int mActiveParticleCount; + + int mSrcBlending; + int mDestBlending; + int mMaxParticleCount; + + vector mParticles; + +}; + +#endif + diff --git a/JGE/include/JParticleSystem.h b/JGE/include/JParticleSystem.h index dd79cd9c6..52b5c7854 100644 --- a/JGE/include/JParticleSystem.h +++ b/JGE/include/JParticleSystem.h @@ -1,114 +1,114 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef __PARTICLE_SYSTEM_H__ -#define __PARTICLE_SYSTEM_H__ - -#include -#include -#include - - -#include "JGE.h" - -#include "JParticle.h" - - -class JParticleEffect; -class JParticleEmitter; - -using namespace std; - - -////////////////////////////////////////////////////////////////////////// -/// The particle system of JGE++ is built on a key frame concept with -/// multiple emitters for each effect. It's inspired by the particle system -/// of Torque Game Builder. At each key frame, you can specify the value -/// of the changeable states of the particle. This gives you lots of -/// control over the particles and making it possible to create -/// almost all of the spectacular effects out of your imagination. -/// -////////////////////////////////////////////////////////////////////////// -class JParticleSystem -{ -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - ////////////////////////////////////////////////////////////////////////// - JParticleSystem(); - - ~JParticleSystem(); - - - ////////////////////////////////////////////////////////////////////////// - /// Update all active effects. - /// - /// @param dt - Delta time since last update (in second). - /// - ////////////////////////////////////////////////////////////////////////// - void Update(float dt); - - ////////////////////////////////////////////////////////////////////////// - /// Render all active effects. - /// - ////////////////////////////////////////////////////////////////////////// - void Render(); - - ////////////////////////////////////////////////////////////////////////// - /// Start an effect. - /// - /// @param effect - Effect to start playing. - /// - ////////////////////////////////////////////////////////////////////////// - void StartEffect(JParticleEffect* effect); - - ////////////////////////////////////////////////////////////////////////// - /// Stop all effects. - /// - ////////////////////////////////////////////////////////////////////////// - void StopAllEffects(); - - ////////////////////////////////////////////////////////////////////////// - /// Delete all effects from memory. - /// - ////////////////////////////////////////////////////////////////////////// - void ClearAll(); - - ////////////////////////////////////////////////////////////////////////// - /// Check if the particle system is active or not. - /// - /// @return True if active. - /// - ////////////////////////////////////////////////////////////////////////// - bool IsActive(); - - ////////////////////////////////////////////////////////////////////////// - /// Set active flag. - /// - /// @param flag - Active flag. - /// - ////////////////////////////////////////////////////////////////////////// - void SetActive(bool flag); - - -private: - - bool mActive; - - list mEffects; - - -}; - - - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef __PARTICLE_SYSTEM_H__ +#define __PARTICLE_SYSTEM_H__ + +#include +#include +#include + + +#include "JGE.h" + +#include "JParticle.h" + + +class JParticleEffect; +class JParticleEmitter; + +using namespace std; + + +////////////////////////////////////////////////////////////////////////// +/// The particle system of JGE++ is built on a key frame concept with +/// multiple emitters for each effect. It's inspired by the particle system +/// of Torque Game Builder. At each key frame, you can specify the value +/// of the changeable states of the particle. This gives you lots of +/// control over the particles and making it possible to create +/// almost all of the spectacular effects out of your imagination. +/// +////////////////////////////////////////////////////////////////////////// +class JParticleSystem +{ +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + ////////////////////////////////////////////////////////////////////////// + JParticleSystem(); + + ~JParticleSystem(); + + + ////////////////////////////////////////////////////////////////////////// + /// Update all active effects. + /// + /// @param dt - Delta time since last update (in second). + /// + ////////////////////////////////////////////////////////////////////////// + void Update(float dt); + + ////////////////////////////////////////////////////////////////////////// + /// Render all active effects. + /// + ////////////////////////////////////////////////////////////////////////// + void Render(); + + ////////////////////////////////////////////////////////////////////////// + /// Start an effect. + /// + /// @param effect - Effect to start playing. + /// + ////////////////////////////////////////////////////////////////////////// + void StartEffect(JParticleEffect* effect); + + ////////////////////////////////////////////////////////////////////////// + /// Stop all effects. + /// + ////////////////////////////////////////////////////////////////////////// + void StopAllEffects(); + + ////////////////////////////////////////////////////////////////////////// + /// Delete all effects from memory. + /// + ////////////////////////////////////////////////////////////////////////// + void ClearAll(); + + ////////////////////////////////////////////////////////////////////////// + /// Check if the particle system is active or not. + /// + /// @return True if active. + /// + ////////////////////////////////////////////////////////////////////////// + bool IsActive(); + + ////////////////////////////////////////////////////////////////////////// + /// Set active flag. + /// + /// @param flag - Active flag. + /// + ////////////////////////////////////////////////////////////////////////// + void SetActive(bool flag); + + +private: + + bool mActive; + + list mEffects; + + +}; + + + +#endif diff --git a/JGE/include/JRenderer.h b/JGE/include/JRenderer.h index b84daf26c..20cd74bbd 100644 --- a/JGE/include/JRenderer.h +++ b/JGE/include/JRenderer.h @@ -1,648 +1,648 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _JRENDERER_H_ -#define _JRENDERER_H_ - -#include -#include -#include -#include - -#if (!defined IOS) -#include -#endif //IOS - -#include "JTypes.h" - - -#if defined (WIN32) - - #include - -#elif defined (LINUX) || defined(IOS) - -#else - - #include - #include - #include - #include - #include - #include - #include - #include - #include - -#endif - -#include "Vector2D.h" - -#define USING_MATH_TABLE - -#ifdef USING_MATCH_TABLE - #define SINF(x) mSinTable[x] - #define COSF(x) mCosTable[x] -#else - #define SINF(x) sinf(x*DEG2RAD) - #define COSF(x) cosf(x*DEG2RAD) -#endif - -#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32) -typedef struct -{ - GLfloat m[4][4]; -} ESMatrix; -#endif // (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - -////////////////////////////////////////////////////////////////////////// -/// A collection of core rendering functions. -/// -////////////////////////////////////////////////////////////////////////// -class JRenderer -{ -protected: - - JRenderer(); - ~JRenderer(); - void InitRenderer(); - void DestroyRenderer(); - - float mActualWidth; - float mActualHeight; - -public: - -#if defined (WIN32) || defined (LINUX) || defined (IOS) -#else - int PixelSize(int textureMode); -#endif - - ////////////////////////////////////////////////////////////////////////// - /// Get the singleton instance - /// - ////////////////////////////////////////////////////////////////////////// - static JRenderer* GetInstance(); - - /* -//START PurpleScreen Debug - static int debugged; -//END PurpleScreen Debug -*/ - static void Destroy(); - - static void Set3DFlag(bool flag); - - void BeginScene(); - void EndScene(); - - ////////////////////////////////////////////////////////////////////////// - /// Render a textured quad with rotation and scaling. - /// - /// @param quad - Quad with texturing info. - /// @param xo - x position. - /// @param yo - y position. - /// @param angle - Rotation (radian). - /// @param xScale - Horizontal rendering scale. - /// @param yScale - Vertical rendering scale. - /// - ////////////////////////////////////////////////////////////////////////// - void RenderQuad(JQuad* quad, float xo, float yo, float angle=0.0f, float xScale=1.0f, float yScale=1.0f); - - - ////////////////////////////////////////////////////////////////////////// - /// Render a textured quad with new texture mapping information. - /// - /// @param quad - Quad with texturing information. - /// @param points - Array of vertices with new texture mapping information. - /// - ////////////////////////////////////////////////////////////////////////// - void RenderQuad(JQuad* quad, VertexColor* points); - - ////////////////////////////////////////////////////////////////////////// - /// Taking a screen shot. - /// - /// @note This function works on PSP only. A PNG file will be saved in - /// the current folder of the game applicaton. - /// - ////////////////////////////////////////////////////////////////////////// - void ScreenShot(const char* filename); - - ////////////////////////////////////////////////////////////////////////// - /// Load a texture from file. - /// - /// @param filename - Name of file. - /// @param mode - Choose to put texture in VRAM (PSP only). - /// - ////////////////////////////////////////////////////////////////////////// - JTexture* LoadTexture(const char* filename, int mode = 0, int textureFormat = TEXTURE_FORMAT); - - /* - ** Helper function - on Win, LoadTexture previously performed the image transfer into GL memory. - ** However, this doesn't work if you want to call LoadTexture in a separate worker thread, as - ** OpenGL has a limitation where only one thread can run the context. Now, the image loading/decompression - ** happens in LoadTexture, and the JQuad constructor will complete the texture binding with this helper function. - ** - ** On PSP, this is a no-op. - */ - void TransferTextureToGLContext(JTexture& inTexture); - - ////////////////////////////////////////////////////////////////////////// - /// Create texture from memory on the fly. - /// - /// @param width - Width of texture. - /// @param height - Height of texture. - /// @param mode - Choose to put texture in VRAM (PSP only) - /// - ////////////////////////////////////////////////////////////////////////// - JTexture* CreateTexture(int width, int height, int mode = 0); - - ////////////////////////////////////////////////////////////////////////// - /// Clear entire screen to a particular color. - /// - /// @param color - Color to fill the screen. - /// - ////////////////////////////////////////////////////////////////////////// - void ClearScreen(PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Enable VSync for the smoothness of moving objects. (PSP only) - /// - /// @param flag - true to enable, false to disable. - /// - ////////////////////////////////////////////////////////////////////////// - void EnableVSync(bool flag); - - ////////////////////////////////////////////////////////////////////////// - /// Enable bi-linear filtering for better looking on-screen images. - /// - /// @param flag - true to enable, false to disable. - /// - ////////////////////////////////////////////////////////////////////////// - void EnableTextureFilter(bool flag); - - ////////////////////////////////////////////////////////////////////////// - /// Enable/disable swizzle optimization. (PSP only) - /// - /// @param s - 1 to enable, 0 to disable. - /// - ////////////////////////////////////////////////////////////////////////// - void SetSwizzle(int s) { mSwizzle = s; } - - ////////////////////////////////////////////////////////////////////////// - /// Bind texture to be used for the rendering followed. - /// - /// @param tex - Texture to use. - /// - ////////////////////////////////////////////////////////////////////////// - void BindTexture(JTexture *tex); - - ////////////////////////////////////////////////////////////////////////// - /// Set texture blending options. - /// - /// @par Blending options: - /// - /// @code - /// - /// BLEND_ZERO - /// BLEND_ONE - /// BLEND_SRC_COLOR - /// BLEND_ONE_MINUS_SRC_COLOR - /// BLEND_SRC_ALPHA - /// BLEND_ONE_MINUS_SRC_ALPHA - /// BLEND_DST_ALPHA - /// BLEND_ONE_MINUS_DST_ALPHA - /// BLEND_DST_COLOR - /// BLEND_ONE_MINUS_DST_COLOR - /// BLEND_SRC_ALPHA_SATURATE - /// - /// @endcode - /// - /// @param src - Blending option for source image. - /// @param dest - Blending option for destination image. - /// - ////////////////////////////////////////////////////////////////////////// - void SetTexBlend(int src, int dest); - - ////////////////////////////////////////////////////////////////////////// - /// Set texture blending option for source image. - /// - /// @param src - Blending option for source image. - /// - ////////////////////////////////////////////////////////////////////////// - void SetTexBlendSrc(int src); - - ////////////////////////////////////////////////////////////////////////// - /// Set texture blending option for destination image. - /// - /// @param dest - Blending option for destination image. - /// - ////////////////////////////////////////////////////////////////////////// - void SetTexBlendDest(int dest); - - ////////////////////////////////////////////////////////////////////////// - /// Enable rendering in 2D mode. - /// - /// @note To be implemented. - /// - ////////////////////////////////////////////////////////////////////////// - void Enable2D(); - - - ////////////////////////////////////////////////////////////////////////// - /// Enable rendering in 3D mode. - /// - /// @note To be implemented. - /// - ////////////////////////////////////////////////////////////////////////// - void Enable3D(); - - ////////////////////////////////////////////////////////////////////////// - /// Restrict all rendering to a rectangular area. - /// - /// @note This is just the glScissor() function of OpenGL. - /// - /// @param x - Left of the clipping area. - /// @param y - Top of the clipping area. - /// @param width - Width of the clipping area. - /// @param height - Height of the clipping area. - /// - ////////////////////////////////////////////////////////////////////////// - void SetClip(int x, int y, int width, int height); - - ////////////////////////////////////////////////////////////////////////// - /// Reset Modelview Identity. - /// - ////////////////////////////////////////////////////////////////////////// - void LoadIdentity(); - - ////////////////////////////////////////////////////////////////////////// - /// Tranlate position in 3D space. - /// - /// @param x - X position. - /// @param y - Y position. - /// @param z - Z position. - /// - ////////////////////////////////////////////////////////////////////////// - void Translate(float x, float y, float z); - - ////////////////////////////////////////////////////////////////////////// - /// Rotate along X axis. - /// - /// @param angle - Angle to rotate ( in radians). - /// - ////////////////////////////////////////////////////////////////////////// - void RotateX(float angle); - - ////////////////////////////////////////////////////////////////////////// - /// Rotate along Y axis. - /// - /// @param angle - Angle to rotate ( in radians). - /// - ////////////////////////////////////////////////////////////////////////// - void RotateY(float angle); - - ////////////////////////////////////////////////////////////////////////// - /// Rotate along Z axis. - /// - /// @param angle - Angle to rotate ( in radians). - /// - ////////////////////////////////////////////////////////////////////////// - void RotateZ(float angle); - - ////////////////////////////////////////////////////////////////////////// - /// Push matrix. - /// - ////////////////////////////////////////////////////////////////////////// - void PushMatrix(); - - ////////////////////////////////////////////////////////////////////////// - /// Pop matrix. - /// - ////////////////////////////////////////////////////////////////////////// - void PopMatrix(); - - ////////////////////////////////////////////////////////////////////////// - /// Set the field of view angle (in degrees), effective at the next - /// Enable3D() call. - /// - /// @param fov - The field of view angle (in degrees). - /// - ////////////////////////////////////////////////////////////////////////// - void SetFOV(float fov); - - ////////////////////////////////////////////////////////////////////////// - /// Render triangles. - /// - /// @param texture - Texture for the triangles. - /// @param tris - List of triangles. - /// @param start - starting index (Note: Index of triangles, NOT vertices). - /// @param count - Number of triangles (Note: NOT number of vertices). - /// - ////////////////////////////////////////////////////////////////////////// - void RenderTriangles(JTexture* texture, Vertex3D *tris, int start, int count); - - ////////////////////////////////////////////////////////////////////////// - /// Fill a rectangular area with a specified color. - /// - /// @param x - Starting x position. - /// @param y - Starting y position. - /// @param width - Width of the rectangle. - /// @param height - Height of the rectangle. - /// @param color - Filling color. - /// - ////////////////////////////////////////////////////////////////////////// - void FillRect(float x, float y, float width, float height, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Fill a rectangular area with a single color for each vertex. - /// - /// @param x - Starting x position. - /// @param y - Starting y position. - /// @param width - Width of the rectangle. - /// @param height - Height of the rectangle. - /// @param color - Array of colors. - /// - ////////////////////////////////////////////////////////////////////////// - void FillRect(float x, float y, float width, float height, JColor* color); - void FillRect(float x, float y, float width, float height, PIXEL_TYPE* color); - - ////////////////////////////////////////////////////////////////////////// - /// Draw a rectangle. - /// - /// @param x - Starting x position. - /// @param y - Starting y position. - /// @param width - Width of the rectangle. - /// @param height - Height of the rectangle. - /// @param color - Filling color. - /// - ////////////////////////////////////////////////////////////////////////// - void DrawRect(float x, float y, float width, float height, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Draw a single line. - /// - /// @param x1 - Starting vertex, x. - /// @param y1 - Starting vertex, y. - /// @param x2 - Ending vertex, x. - /// @param y2 - Ending vertex, y. - /// @param color - Filling color. - /// - ////////////////////////////////////////////////////////////////////////// - void DrawLine(float x1, float y1, float x2, float y2, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Draw thick line. - /// - /// @param x1 - Starting vertex, x. - /// @param y1 - Starting vertex, y. - /// @param x2 - Ending vertex, x. - /// @param y2 - Ending vertex, y. - /// @param lineWidth - Line width. - /// @param color - Filling color. - /// - ////////////////////////////////////////////////////////////////////////// - void DrawLine(float x1, float y1, float x2, float y2, float lineWidth, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Plot a pixel on screen. - /// - /// @param x - X position of the pixel. - /// @param y - Y position of the pixel. - /// @param color - Draw colour. - /// - ////////////////////////////////////////////////////////////////////////// - void Plot(float x, float y, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Plot an array of pixels. - /// - /// @param x - Array of X positions. - /// @param y - Array of Y positions. - /// @param count - Number of pixels to plot. - /// @param color - Color of pixel. - /// - ////////////////////////////////////////////////////////////////////////// - void PlotArray(float *x, float *y, int count, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Draw polygon with filled colour. - /// - /// @param x - Array of X positions. - /// @param y - Array of Y positions. - /// @param count - Side count of the polygon. - /// @param color - Filling colour. - /// - ////////////////////////////////////////////////////////////////////////// - void FillPolygon(float* x, float* y, int count, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Draw polygon. - /// - /// @param x - Array of X positions. - /// @param y - Array of Y positions. - /// @param count - Side count of the polygon. - /// @param color - Draw colour. - /// - ////////////////////////////////////////////////////////////////////////// - void DrawPolygon(float* x, float* y, int count, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Draw symmetric polygon with certain number of sides. - /// - /// @param x - X positions of center of the polygon. - /// @param y - Y positions of center of the polygon. - /// @param size - Size of polygon. - /// @param count - Side count of the polygon. - /// @param startingAngle - Rotation angle of the polygon. - /// @param color - Draw colour. - /// - ////////////////////////////////////////////////////////////////////////// - void DrawPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Draw solid symmetric polygon with certain number of sides. - /// - /// @param x - X positions of center of the polygon. - /// @param y - Y positions of center of the polygon. - /// @param size - Size of polygon. - /// @param count - Side count of the polygon. - /// @param startingAngle - Rotation angle of the polygon. - /// @param color - Filling colour. - /// - ////////////////////////////////////////////////////////////////////////// - void FillPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Draw circle with filled colour. - /// - /// @param x - X positions of center of the circle. - /// @param y - Y positions of center of the circle. - /// @param radius - Radius of circle. - /// @param color - Filling colour. - /// - ////////////////////////////////////////////////////////////////////////// - void FillCircle(float x, float y, float radius, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Draw circle. - /// - /// @param x - X positions of center of the circle. - /// @param y - Y positions of center of the circle. - /// @param radius - Radius of circle. - /// @param color - Draw colour. - /// - ////////////////////////////////////////////////////////////////////////// - void DrawCircle(float x, float y, float radius, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Draw a rectangle with round corners. - /// - /// @param x - Starting x position. - /// @param y - Starting y position. - /// @param w - Width of the rectangle. - /// @param h - Height of the rectangle. - /// @param radius - Radius of the round corners. - /// @param color - Drawing color. - /// - ////////////////////////////////////////////////////////////////////////// - void DrawRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Draw filled rectangle with round corners. - /// - /// @param x - Starting x position. - /// @param y - Starting y position. - /// @param w - Width of the rectangle. - /// @param h - Height of the rectangle. - /// @param radius - Radius of the round corners. - /// @param color - Filling color. - /// - ////////////////////////////////////////////////////////////////////////// - void FillRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color); - - - ////////////////////////////////////////////////////////////////////////// - /// Set custom image filter to be used at texture loading. - /// - /// @param imageFilter - Custom image filter. - /// - ////////////////////////////////////////////////////////////////////////// - void SetImageFilter(JImageFilter* imageFilter); - - /** - ** Set/Get methods for the actual display screen size. - */ - inline void SetActualWidth(float inWidth) - { - mActualWidth = inWidth; - } - - inline void SetActualHeight(float inHeight) - { - mActualHeight = inHeight; - } - - inline float GetActualWidth() - { - return mActualWidth; - } - - inline float GetActualHeight() - { - return mActualHeight; - } - -private: - - struct TextureInfo - { - u8 *mBits; - int mWidth; - int mHeight; - int mTexWidth; - int mTexHeight; - bool mVRAM; - }; - -#if (!defined IOS) - void LoadJPG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT); - int LoadPNG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT); - void LoadGIF(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT); - int image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bgcolor, InputFunc readFunc,int mode = 0, int TextureFormat = TEXTURE_FORMAT); -#endif //(IOS) - - static JRenderer* mInstance; - -#if defined (WIN32) || defined (LINUX) || defined (IOS) - - GLuint mCurrentTex; -#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32) - // MVP matrix - ESMatrix theMvpMatrix; - - // Handle to a program object - GLuint prog1; - // Attribute locations - GLint prog1_positionLoc; - GLint prog1_colorLoc; - // Uniform locations - GLint prog1_mvpLoc; - - // Handle to a program object - GLuint prog2; - // Sampler location - GLint prog2_samplerLoc; - // Attribute locations - GLint prog2_positionLoc; - GLint prog2_texCoordLoc; - GLint prog2_colorLoc; - // MVP matrix - ESMatrix prog2_mvpMatrix; - // Uniform locations - GLint prog2_mvpLoc; - -#endif // (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) -#else - void *fbp0, *fbp1, *zbp; - PIXEL_TYPE* mVRAM; - int mCurrentTex; - int mCurrentBlend; - int mCurrentTextureFormat; -#endif - - bool mVsync; - - int mSwizzle; - int mTexCounter; - - - - int mCurrentTextureFilter; - - int mCurrTexBlendSrc; - int mCurrTexBlendDest; - - JImageFilter* mImageFilter; - - int mCurrentRenderMode; - - float mFOV; - -#ifdef USING_MATH_TABLE - float mSinTable[360]; - float mCosTable[360]; -#endif - - static bool m3DEnabled; -}; - - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _JRENDERER_H_ +#define _JRENDERER_H_ + +#include +#include +#include +#include + +#if (!defined IOS) +#include +#endif //IOS + +#include "JTypes.h" + + +#if defined (WIN32) + + #include + +#elif defined (LINUX) || defined(IOS) + +#else + + #include + #include + #include + #include + #include + #include + #include + #include + #include + +#endif + +#include "Vector2D.h" + +#define USING_MATH_TABLE + +#ifdef USING_MATCH_TABLE + #define SINF(x) mSinTable[x] + #define COSF(x) mCosTable[x] +#else + #define SINF(x) sinf(x*DEG2RAD) + #define COSF(x) cosf(x*DEG2RAD) +#endif + +#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32) +typedef struct +{ + GLfloat m[4][4]; +} ESMatrix; +#endif // (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + +////////////////////////////////////////////////////////////////////////// +/// A collection of core rendering functions. +/// +////////////////////////////////////////////////////////////////////////// +class JRenderer +{ +protected: + + JRenderer(); + ~JRenderer(); + void InitRenderer(); + void DestroyRenderer(); + + float mActualWidth; + float mActualHeight; + +public: + +#if defined (WIN32) || defined (LINUX) || defined (IOS) +#else + int PixelSize(int textureMode); +#endif + + ////////////////////////////////////////////////////////////////////////// + /// Get the singleton instance + /// + ////////////////////////////////////////////////////////////////////////// + static JRenderer* GetInstance(); + + /* +//START PurpleScreen Debug + static int debugged; +//END PurpleScreen Debug +*/ + static void Destroy(); + + static void Set3DFlag(bool flag); + + void BeginScene(); + void EndScene(); + + ////////////////////////////////////////////////////////////////////////// + /// Render a textured quad with rotation and scaling. + /// + /// @param quad - Quad with texturing info. + /// @param xo - x position. + /// @param yo - y position. + /// @param angle - Rotation (radian). + /// @param xScale - Horizontal rendering scale. + /// @param yScale - Vertical rendering scale. + /// + ////////////////////////////////////////////////////////////////////////// + void RenderQuad(JQuad* quad, float xo, float yo, float angle=0.0f, float xScale=1.0f, float yScale=1.0f); + + + ////////////////////////////////////////////////////////////////////////// + /// Render a textured quad with new texture mapping information. + /// + /// @param quad - Quad with texturing information. + /// @param points - Array of vertices with new texture mapping information. + /// + ////////////////////////////////////////////////////////////////////////// + void RenderQuad(JQuad* quad, VertexColor* points); + + ////////////////////////////////////////////////////////////////////////// + /// Taking a screen shot. + /// + /// @note This function works on PSP only. A PNG file will be saved in + /// the current folder of the game applicaton. + /// + ////////////////////////////////////////////////////////////////////////// + void ScreenShot(const char* filename); + + ////////////////////////////////////////////////////////////////////////// + /// Load a texture from file. + /// + /// @param filename - Name of file. + /// @param mode - Choose to put texture in VRAM (PSP only). + /// + ////////////////////////////////////////////////////////////////////////// + JTexture* LoadTexture(const char* filename, int mode = 0, int textureFormat = TEXTURE_FORMAT); + + /* + ** Helper function - on Win, LoadTexture previously performed the image transfer into GL memory. + ** However, this doesn't work if you want to call LoadTexture in a separate worker thread, as + ** OpenGL has a limitation where only one thread can run the context. Now, the image loading/decompression + ** happens in LoadTexture, and the JQuad constructor will complete the texture binding with this helper function. + ** + ** On PSP, this is a no-op. + */ + void TransferTextureToGLContext(JTexture& inTexture); + + ////////////////////////////////////////////////////////////////////////// + /// Create texture from memory on the fly. + /// + /// @param width - Width of texture. + /// @param height - Height of texture. + /// @param mode - Choose to put texture in VRAM (PSP only) + /// + ////////////////////////////////////////////////////////////////////////// + JTexture* CreateTexture(int width, int height, int mode = 0); + + ////////////////////////////////////////////////////////////////////////// + /// Clear entire screen to a particular color. + /// + /// @param color - Color to fill the screen. + /// + ////////////////////////////////////////////////////////////////////////// + void ClearScreen(PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Enable VSync for the smoothness of moving objects. (PSP only) + /// + /// @param flag - true to enable, false to disable. + /// + ////////////////////////////////////////////////////////////////////////// + void EnableVSync(bool flag); + + ////////////////////////////////////////////////////////////////////////// + /// Enable bi-linear filtering for better looking on-screen images. + /// + /// @param flag - true to enable, false to disable. + /// + ////////////////////////////////////////////////////////////////////////// + void EnableTextureFilter(bool flag); + + ////////////////////////////////////////////////////////////////////////// + /// Enable/disable swizzle optimization. (PSP only) + /// + /// @param s - 1 to enable, 0 to disable. + /// + ////////////////////////////////////////////////////////////////////////// + void SetSwizzle(int s) { mSwizzle = s; } + + ////////////////////////////////////////////////////////////////////////// + /// Bind texture to be used for the rendering followed. + /// + /// @param tex - Texture to use. + /// + ////////////////////////////////////////////////////////////////////////// + void BindTexture(JTexture *tex); + + ////////////////////////////////////////////////////////////////////////// + /// Set texture blending options. + /// + /// @par Blending options: + /// + /// @code + /// + /// BLEND_ZERO + /// BLEND_ONE + /// BLEND_SRC_COLOR + /// BLEND_ONE_MINUS_SRC_COLOR + /// BLEND_SRC_ALPHA + /// BLEND_ONE_MINUS_SRC_ALPHA + /// BLEND_DST_ALPHA + /// BLEND_ONE_MINUS_DST_ALPHA + /// BLEND_DST_COLOR + /// BLEND_ONE_MINUS_DST_COLOR + /// BLEND_SRC_ALPHA_SATURATE + /// + /// @endcode + /// + /// @param src - Blending option for source image. + /// @param dest - Blending option for destination image. + /// + ////////////////////////////////////////////////////////////////////////// + void SetTexBlend(int src, int dest); + + ////////////////////////////////////////////////////////////////////////// + /// Set texture blending option for source image. + /// + /// @param src - Blending option for source image. + /// + ////////////////////////////////////////////////////////////////////////// + void SetTexBlendSrc(int src); + + ////////////////////////////////////////////////////////////////////////// + /// Set texture blending option for destination image. + /// + /// @param dest - Blending option for destination image. + /// + ////////////////////////////////////////////////////////////////////////// + void SetTexBlendDest(int dest); + + ////////////////////////////////////////////////////////////////////////// + /// Enable rendering in 2D mode. + /// + /// @note To be implemented. + /// + ////////////////////////////////////////////////////////////////////////// + void Enable2D(); + + + ////////////////////////////////////////////////////////////////////////// + /// Enable rendering in 3D mode. + /// + /// @note To be implemented. + /// + ////////////////////////////////////////////////////////////////////////// + void Enable3D(); + + ////////////////////////////////////////////////////////////////////////// + /// Restrict all rendering to a rectangular area. + /// + /// @note This is just the glScissor() function of OpenGL. + /// + /// @param x - Left of the clipping area. + /// @param y - Top of the clipping area. + /// @param width - Width of the clipping area. + /// @param height - Height of the clipping area. + /// + ////////////////////////////////////////////////////////////////////////// + void SetClip(int x, int y, int width, int height); + + ////////////////////////////////////////////////////////////////////////// + /// Reset Modelview Identity. + /// + ////////////////////////////////////////////////////////////////////////// + void LoadIdentity(); + + ////////////////////////////////////////////////////////////////////////// + /// Tranlate position in 3D space. + /// + /// @param x - X position. + /// @param y - Y position. + /// @param z - Z position. + /// + ////////////////////////////////////////////////////////////////////////// + void Translate(float x, float y, float z); + + ////////////////////////////////////////////////////////////////////////// + /// Rotate along X axis. + /// + /// @param angle - Angle to rotate ( in radians). + /// + ////////////////////////////////////////////////////////////////////////// + void RotateX(float angle); + + ////////////////////////////////////////////////////////////////////////// + /// Rotate along Y axis. + /// + /// @param angle - Angle to rotate ( in radians). + /// + ////////////////////////////////////////////////////////////////////////// + void RotateY(float angle); + + ////////////////////////////////////////////////////////////////////////// + /// Rotate along Z axis. + /// + /// @param angle - Angle to rotate ( in radians). + /// + ////////////////////////////////////////////////////////////////////////// + void RotateZ(float angle); + + ////////////////////////////////////////////////////////////////////////// + /// Push matrix. + /// + ////////////////////////////////////////////////////////////////////////// + void PushMatrix(); + + ////////////////////////////////////////////////////////////////////////// + /// Pop matrix. + /// + ////////////////////////////////////////////////////////////////////////// + void PopMatrix(); + + ////////////////////////////////////////////////////////////////////////// + /// Set the field of view angle (in degrees), effective at the next + /// Enable3D() call. + /// + /// @param fov - The field of view angle (in degrees). + /// + ////////////////////////////////////////////////////////////////////////// + void SetFOV(float fov); + + ////////////////////////////////////////////////////////////////////////// + /// Render triangles. + /// + /// @param texture - Texture for the triangles. + /// @param tris - List of triangles. + /// @param start - starting index (Note: Index of triangles, NOT vertices). + /// @param count - Number of triangles (Note: NOT number of vertices). + /// + ////////////////////////////////////////////////////////////////////////// + void RenderTriangles(JTexture* texture, Vertex3D *tris, int start, int count); + + ////////////////////////////////////////////////////////////////////////// + /// Fill a rectangular area with a specified color. + /// + /// @param x - Starting x position. + /// @param y - Starting y position. + /// @param width - Width of the rectangle. + /// @param height - Height of the rectangle. + /// @param color - Filling color. + /// + ////////////////////////////////////////////////////////////////////////// + void FillRect(float x, float y, float width, float height, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Fill a rectangular area with a single color for each vertex. + /// + /// @param x - Starting x position. + /// @param y - Starting y position. + /// @param width - Width of the rectangle. + /// @param height - Height of the rectangle. + /// @param color - Array of colors. + /// + ////////////////////////////////////////////////////////////////////////// + void FillRect(float x, float y, float width, float height, JColor* color); + void FillRect(float x, float y, float width, float height, PIXEL_TYPE* color); + + ////////////////////////////////////////////////////////////////////////// + /// Draw a rectangle. + /// + /// @param x - Starting x position. + /// @param y - Starting y position. + /// @param width - Width of the rectangle. + /// @param height - Height of the rectangle. + /// @param color - Filling color. + /// + ////////////////////////////////////////////////////////////////////////// + void DrawRect(float x, float y, float width, float height, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Draw a single line. + /// + /// @param x1 - Starting vertex, x. + /// @param y1 - Starting vertex, y. + /// @param x2 - Ending vertex, x. + /// @param y2 - Ending vertex, y. + /// @param color - Filling color. + /// + ////////////////////////////////////////////////////////////////////////// + void DrawLine(float x1, float y1, float x2, float y2, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Draw thick line. + /// + /// @param x1 - Starting vertex, x. + /// @param y1 - Starting vertex, y. + /// @param x2 - Ending vertex, x. + /// @param y2 - Ending vertex, y. + /// @param lineWidth - Line width. + /// @param color - Filling color. + /// + ////////////////////////////////////////////////////////////////////////// + void DrawLine(float x1, float y1, float x2, float y2, float lineWidth, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Plot a pixel on screen. + /// + /// @param x - X position of the pixel. + /// @param y - Y position of the pixel. + /// @param color - Draw colour. + /// + ////////////////////////////////////////////////////////////////////////// + void Plot(float x, float y, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Plot an array of pixels. + /// + /// @param x - Array of X positions. + /// @param y - Array of Y positions. + /// @param count - Number of pixels to plot. + /// @param color - Color of pixel. + /// + ////////////////////////////////////////////////////////////////////////// + void PlotArray(float *x, float *y, int count, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Draw polygon with filled colour. + /// + /// @param x - Array of X positions. + /// @param y - Array of Y positions. + /// @param count - Side count of the polygon. + /// @param color - Filling colour. + /// + ////////////////////////////////////////////////////////////////////////// + void FillPolygon(float* x, float* y, int count, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Draw polygon. + /// + /// @param x - Array of X positions. + /// @param y - Array of Y positions. + /// @param count - Side count of the polygon. + /// @param color - Draw colour. + /// + ////////////////////////////////////////////////////////////////////////// + void DrawPolygon(float* x, float* y, int count, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Draw symmetric polygon with certain number of sides. + /// + /// @param x - X positions of center of the polygon. + /// @param y - Y positions of center of the polygon. + /// @param size - Size of polygon. + /// @param count - Side count of the polygon. + /// @param startingAngle - Rotation angle of the polygon. + /// @param color - Draw colour. + /// + ////////////////////////////////////////////////////////////////////////// + void DrawPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Draw solid symmetric polygon with certain number of sides. + /// + /// @param x - X positions of center of the polygon. + /// @param y - Y positions of center of the polygon. + /// @param size - Size of polygon. + /// @param count - Side count of the polygon. + /// @param startingAngle - Rotation angle of the polygon. + /// @param color - Filling colour. + /// + ////////////////////////////////////////////////////////////////////////// + void FillPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Draw circle with filled colour. + /// + /// @param x - X positions of center of the circle. + /// @param y - Y positions of center of the circle. + /// @param radius - Radius of circle. + /// @param color - Filling colour. + /// + ////////////////////////////////////////////////////////////////////////// + void FillCircle(float x, float y, float radius, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Draw circle. + /// + /// @param x - X positions of center of the circle. + /// @param y - Y positions of center of the circle. + /// @param radius - Radius of circle. + /// @param color - Draw colour. + /// + ////////////////////////////////////////////////////////////////////////// + void DrawCircle(float x, float y, float radius, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Draw a rectangle with round corners. + /// + /// @param x - Starting x position. + /// @param y - Starting y position. + /// @param w - Width of the rectangle. + /// @param h - Height of the rectangle. + /// @param radius - Radius of the round corners. + /// @param color - Drawing color. + /// + ////////////////////////////////////////////////////////////////////////// + void DrawRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Draw filled rectangle with round corners. + /// + /// @param x - Starting x position. + /// @param y - Starting y position. + /// @param w - Width of the rectangle. + /// @param h - Height of the rectangle. + /// @param radius - Radius of the round corners. + /// @param color - Filling color. + /// + ////////////////////////////////////////////////////////////////////////// + void FillRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color); + + + ////////////////////////////////////////////////////////////////////////// + /// Set custom image filter to be used at texture loading. + /// + /// @param imageFilter - Custom image filter. + /// + ////////////////////////////////////////////////////////////////////////// + void SetImageFilter(JImageFilter* imageFilter); + + /** + ** Set/Get methods for the actual display screen size. + */ + inline void SetActualWidth(float inWidth) + { + mActualWidth = inWidth; + } + + inline void SetActualHeight(float inHeight) + { + mActualHeight = inHeight; + } + + inline float GetActualWidth() + { + return mActualWidth; + } + + inline float GetActualHeight() + { + return mActualHeight; + } + +private: + + struct TextureInfo + { + u8 *mBits; + int mWidth; + int mHeight; + int mTexWidth; + int mTexHeight; + bool mVRAM; + }; + +#if (!defined IOS) + void LoadJPG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT); + int LoadPNG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT); + void LoadGIF(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT); + int image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bgcolor, InputFunc readFunc,int mode = 0, int TextureFormat = TEXTURE_FORMAT); +#endif //(IOS) + + static JRenderer* mInstance; + +#if defined (WIN32) || defined (LINUX) || defined (IOS) + + GLuint mCurrentTex; +#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32) + // MVP matrix + ESMatrix theMvpMatrix; + + // Handle to a program object + GLuint prog1; + // Attribute locations + GLint prog1_positionLoc; + GLint prog1_colorLoc; + // Uniform locations + GLint prog1_mvpLoc; + + // Handle to a program object + GLuint prog2; + // Sampler location + GLint prog2_samplerLoc; + // Attribute locations + GLint prog2_positionLoc; + GLint prog2_texCoordLoc; + GLint prog2_colorLoc; + // MVP matrix + ESMatrix prog2_mvpMatrix; + // Uniform locations + GLint prog2_mvpLoc; + +#endif // (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) +#else + void *fbp0, *fbp1, *zbp; + PIXEL_TYPE* mVRAM; + int mCurrentTex; + int mCurrentBlend; + int mCurrentTextureFormat; +#endif + + bool mVsync; + + int mSwizzle; + int mTexCounter; + + + + int mCurrentTextureFilter; + + int mCurrTexBlendSrc; + int mCurrTexBlendDest; + + JImageFilter* mImageFilter; + + int mCurrentRenderMode; + + float mFOV; + +#ifdef USING_MATH_TABLE + float mSinTable[360]; + float mCosTable[360]; +#endif + + static bool m3DEnabled; +}; + + +#endif diff --git a/JGE/include/JSocket.h b/JGE/include/JSocket.h index 40903f84b..9a7fd3333 100644 --- a/JGE/include/JSocket.h +++ b/JGE/include/JSocket.h @@ -1,30 +1,30 @@ -#ifndef _JSOCKET_H_ -#define _JSOCKET_H_ - -#include -using namespace std; - -//TODO config ? -#define SERVER_PORT 20666 - -class JSocket{ -public: - queue received_data; - queue tosend_data; - static JSocket * mInstance; - int start_server(const char *szIpAddr); - int start_client(const char *szIpAddr); - - JSocket(); - ~JSocket(); - static int connected; -private: - void init(); - void readWrite(int sock); -#if defined (WIN32) || defined (LINUX) -#else - int make_socket(uint16_t port); -#endif -}; - -#endif +#ifndef _JSOCKET_H_ +#define _JSOCKET_H_ + +#include +using namespace std; + +//TODO config ? +#define SERVER_PORT 20666 + +class JSocket{ +public: + queue received_data; + queue tosend_data; + static JSocket * mInstance; + int start_server(const char *szIpAddr); + int start_client(const char *szIpAddr); + + JSocket(); + ~JSocket(); + static int connected; +private: + void init(); + void readWrite(int sock); +#if defined (WIN32) || defined (LINUX) +#else + int make_socket(uint16_t port); +#endif +}; + +#endif diff --git a/JGE/include/JSpline.h b/JGE/include/JSpline.h index 11ab8d3e7..e5b6f28e2 100644 --- a/JGE/include/JSpline.h +++ b/JGE/include/JSpline.h @@ -1,167 +1,167 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _JSPLINE_H -#define _JSPLINE_H - -#include "JRenderer.h" -#include - -using namespace std; - -#define MID_POINT_THRESHOLD 1.0f - - -////////////////////////////////////////////////////////////////////////// -/// Position of a single dot on screen. -/// -////////////////////////////////////////////////////////////////////////// -class Point -{ -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - /// @param _x - X position. - /// @param _y - Y position. - /// - ////////////////////////////////////////////////////////////////////////// - Point(float _x, float _y) { x = _x; y = _y; } - - ////////////////////////////////////////////////////////////////////////// - /// Constructor, set position to default (0.0f, 0.0f) - /// - ////////////////////////////////////////////////////////////////////////// - Point() { x = 0.0f; y = 0.0f; } - - float x; ///< X position. - float y; ///< Y position. -}; - - -////////////////////////////////////////////////////////////////////////// -/// Catmull Rom spline. -/// -////////////////////////////////////////////////////////////////////////// -class JSpline -{ - -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - /// - ////////////////////////////////////////////////////////////////////////// - JSpline(); - ~JSpline(); - - ////////////////////////////////////////////////////////////////////////// - /// Load spline from a file. - /// - /// Here is a sample spline definition file: - /// - /// @code - /// - /// - /// - /// - /// - /// - /// - /// - /// @endcode - /// - /// @param filename - Name of spline definition file. - /// @param xscale - Scaling factor for X of all control points. - /// @param yscale - Scaling factor for Y of all control points. - /// - /// @return True if loaded. - /// - ////////////////////////////////////////////////////////////////////////// - bool Load(const char *filename, float xscale=1.0f, float yscale=1.0f); - - ////////////////////////////////////////////////////////////////////////// - /// Add a control point to the spline. - /// - /// @param pt - Control point. - /// - ////////////////////////////////////////////////////////////////////////// - void AddControlPoint(const Point &pt); - - ////////////////////////////////////////////////////////////////////////// - /// Get a control point of the spline. - /// - /// @param index - Control point index. - /// - /// @return Control point. - /// - ////////////////////////////////////////////////////////////////////////// - void GetControlPoint(Point &point, int index); - - ////////////////////////////////////////////////////////////////////////// - /// Work out all pixels of the spline. - /// - /// @note Have to call this function before calling GetPixel, GetPixelCount - /// and Render. - /// - ////////////////////////////////////////////////////////////////////////// - void GeneratePixels(); - - ////////////////////////////////////////////////////////////////////////// - /// Get a point between 2nd and 3rd control point. - /// - /// @param t - Fraction of the curve between 2nd and 3rd control point. (0.0f ~ 1.0f) - /// @param p0 - 1st control point. - /// @param p1 - 2nd control point. - /// @param p2 - 3rd control point. - /// @param p3 - 4th control point. - /// - /// @return Position of the desire point. - /// - ////////////////////////////////////////////////////////////////////////// - void PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3); - - ////////////////////////////////////////////////////////////////////////// - /// Get a number of pixels for this spline. - /// - /// @return Number of pixels for this spline. - /// - ////////////////////////////////////////////////////////////////////////// - int GetPixelCount(); - - ////////////////////////////////////////////////////////////////////////// - /// Get a pixel on the spline. - /// - /// @param index - Pixel index. - /// - /// @return Position of the desire point. - /// - ////////////////////////////////////////////////////////////////////////// - void GetPixel(Point &point, int index); - - ////////////////////////////////////////////////////////////////////////// - /// Render the spline to screen. - /// - ////////////////////////////////////////////////////////////////////////// - void Render(float x, float y, PIXEL_TYPE color=ARGB(255,255,255,255), PIXEL_TYPE controlColor=ARGB(192,0,192,0)); - -private: - - vector mMidPoints; - vector mPixels; - int mCount; - -}; - - -#endif - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _JSPLINE_H +#define _JSPLINE_H + +#include "JRenderer.h" +#include + +using namespace std; + +#define MID_POINT_THRESHOLD 1.0f + + +////////////////////////////////////////////////////////////////////////// +/// Position of a single dot on screen. +/// +////////////////////////////////////////////////////////////////////////// +class Point +{ +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + /// @param _x - X position. + /// @param _y - Y position. + /// + ////////////////////////////////////////////////////////////////////////// + Point(float _x, float _y) { x = _x; y = _y; } + + ////////////////////////////////////////////////////////////////////////// + /// Constructor, set position to default (0.0f, 0.0f) + /// + ////////////////////////////////////////////////////////////////////////// + Point() { x = 0.0f; y = 0.0f; } + + float x; ///< X position. + float y; ///< Y position. +}; + + +////////////////////////////////////////////////////////////////////////// +/// Catmull Rom spline. +/// +////////////////////////////////////////////////////////////////////////// +class JSpline +{ + +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + /// + ////////////////////////////////////////////////////////////////////////// + JSpline(); + ~JSpline(); + + ////////////////////////////////////////////////////////////////////////// + /// Load spline from a file. + /// + /// Here is a sample spline definition file: + /// + /// @code + /// + /// + /// + /// + /// + /// + /// + /// + /// @endcode + /// + /// @param filename - Name of spline definition file. + /// @param xscale - Scaling factor for X of all control points. + /// @param yscale - Scaling factor for Y of all control points. + /// + /// @return True if loaded. + /// + ////////////////////////////////////////////////////////////////////////// + bool Load(const char *filename, float xscale=1.0f, float yscale=1.0f); + + ////////////////////////////////////////////////////////////////////////// + /// Add a control point to the spline. + /// + /// @param pt - Control point. + /// + ////////////////////////////////////////////////////////////////////////// + void AddControlPoint(const Point &pt); + + ////////////////////////////////////////////////////////////////////////// + /// Get a control point of the spline. + /// + /// @param index - Control point index. + /// + /// @return Control point. + /// + ////////////////////////////////////////////////////////////////////////// + void GetControlPoint(Point &point, int index); + + ////////////////////////////////////////////////////////////////////////// + /// Work out all pixels of the spline. + /// + /// @note Have to call this function before calling GetPixel, GetPixelCount + /// and Render. + /// + ////////////////////////////////////////////////////////////////////////// + void GeneratePixels(); + + ////////////////////////////////////////////////////////////////////////// + /// Get a point between 2nd and 3rd control point. + /// + /// @param t - Fraction of the curve between 2nd and 3rd control point. (0.0f ~ 1.0f) + /// @param p0 - 1st control point. + /// @param p1 - 2nd control point. + /// @param p2 - 3rd control point. + /// @param p3 - 4th control point. + /// + /// @return Position of the desire point. + /// + ////////////////////////////////////////////////////////////////////////// + void PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3); + + ////////////////////////////////////////////////////////////////////////// + /// Get a number of pixels for this spline. + /// + /// @return Number of pixels for this spline. + /// + ////////////////////////////////////////////////////////////////////////// + int GetPixelCount(); + + ////////////////////////////////////////////////////////////////////////// + /// Get a pixel on the spline. + /// + /// @param index - Pixel index. + /// + /// @return Position of the desire point. + /// + ////////////////////////////////////////////////////////////////////////// + void GetPixel(Point &point, int index); + + ////////////////////////////////////////////////////////////////////////// + /// Render the spline to screen. + /// + ////////////////////////////////////////////////////////////////////////// + void Render(float x, float y, PIXEL_TYPE color=ARGB(255,255,255,255), PIXEL_TYPE controlColor=ARGB(192,0,192,0)); + +private: + + vector mMidPoints; + vector mPixels; + int mCount; + +}; + + +#endif + diff --git a/JGE/include/JSprite.h b/JGE/include/JSprite.h index d515b9f61..8a7f8fd8c 100644 --- a/JGE/include/JSprite.h +++ b/JGE/include/JSprite.h @@ -1,487 +1,487 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _SPRITE_H_ -#define _SPRITE_H_ - -#if defined (WIN32) || defined(LINUX) || defined(IOS) -#include -#else -#include -#endif - -#include - -#include "JRenderer.h" - - -using namespace std; - - -////////////////////////////////////////////////////////////////////////// -/// Sprite is a container of single static image or animation frames. -/// -////////////////////////////////////////////////////////////////////////// -class JSprite -{ - -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - /// @param tex - Texture for the first frame and the following frames. - /// NULL to indicate no starting frame. - /// @param x - X of the frame in texture. - /// @param y - Y of the frame in texture. - /// @param width - Width of the frame. - /// @param height - Height of the frame. - /// @param flipped - Indicate if the frame is horizontally flipped. - /// - ////////////////////////////////////////////////////////////////////////// - JSprite(JTexture *tex=NULL, float x=0.0f, float y=0.0f, float width=0.0f, float height=0.0f, bool flipped = false); - - virtual ~JSprite(); - - ////////////////////////////////////////////////////////////////////////// - /// Update animation. - /// - /// @param dt - Delta time since last update (in second). - /// - ////////////////////////////////////////////////////////////////////////// - virtual void Update(float dt); - - ////////////////////////////////////////////////////////////////////////// - /// Render current frame. - /// - ////////////////////////////////////////////////////////////////////////// - virtual void Render(); - - ////////////////////////////////////////////////////////////////////////// - /// Set animation type. - /// - /// @param type - Animation type. - /// - /// @code - /// ANIMATION_TYPE_LOOPING - Repeat playing (Default). - /// ANIMATION_TYPE_ONCE_AND_GONE - Play animation once only. - /// ANIMATION_TYPE_ONCE_AND_BACK - Play to end and then stay at first frame. - /// ANIMATION_TYPE_PINGPONG - Play forward then backward and repeat. - /// @endcode - /// - ////////////////////////////////////////////////////////////////////////// - void SetAnimationType(int type); - - ////////////////////////////////////////////////////////////////////////// - /// Enable/Disable sprite. - /// - /// @param f - True to enable, false to disable. - /// - ////////////////////////////////////////////////////////////////////////// - void SetActive(bool f); - - ////////////////////////////////////////////////////////////////////////// - /// Get current active status. - /// - /// @return Active status. - /// - ////////////////////////////////////////////////////////////////////////// - bool IsActive(); - - ////////////////////////////////////////////////////////////////////////// - /// Give sprite an id. - /// - /// @param id - Id. - /// - ////////////////////////////////////////////////////////////////////////// - void SetId(int id); - - ////////////////////////////////////////////////////////////////////////// - /// Get sprite id. - /// - /// @return Sprite id. - ////////////////////////////////////////////////////////////////////////// - int GetId(); - - ////////////////////////////////////////////////////////////////////////// - /// Flip a frame or all frames horizontally when rendering. - /// - /// @param flip - True to flip. - /// @param index - Frame index, -1 to flip all frames. - /// - ////////////////////////////////////////////////////////////////////////// - void SetFlip(bool flip, int index = -1); - - - ////////////////////////////////////////////////////////////////////////// - /// Add new animation frame. - /// - /// @param x - X of the frame in texture. - /// @param y - Y of the frame in texture. - /// @param width - Width of the frame. - /// @param height - Height of the frame. - /// @param flipped - Indicate if the frame is horizontally flipped. - /// - ////////////////////////////////////////////////////////////////////////// - void AddFrame(float x, float y, float width, float height, bool flipped = false); - - ////////////////////////////////////////////////////////////////////////// - /// Add new animation frame. - /// - /// @param tex - Texture for this frame and the following frames. - /// @param x - X of the frame in texture. - /// @param y - Y of the frame in texture. - /// @param width - Width of the frame. - /// @param height - Height of the frame. - /// @param flipped - Indicate if the frame is horizontally flipped. - /// - ////////////////////////////////////////////////////////////////////////// - void AddFrame(JTexture *tex, float x, float y, float width, float height, bool flipped = false); - - ////////////////////////////////////////////////////////////////////////// - /// Set playback duration for each frame. - /// - /// @param duration - Playback duration (in second) for each frame. - /// - ////////////////////////////////////////////////////////////////////////// - void SetDuration(float duration); - - ////////////////////////////////////////////////////////////////////////// - /// Get index of current frame. - /// - /// @return Index of current frame. - /// - ////////////////////////////////////////////////////////////////////////// - int GetCurrentFrameIndex(); - - ////////////////////////////////////////////////////////////////////////// - /// Set current frame to a particular index. - /// - /// @param frame - The new index of current frame. - /// - ////////////////////////////////////////////////////////////////////////// - void SetCurrentFrameIndex(int frame); - - ////////////////////////////////////////////////////////////////////////// - /// Get current frame image (quad). - /// - /// @return Quad object. - /// - ////////////////////////////////////////////////////////////////////////// - JQuad* GetCurrentFrame(); - - ////////////////////////////////////////////////////////////////////////// - /// Get numer of animation frames. - /// - /// @return Numer of animation frames. - /// - ////////////////////////////////////////////////////////////////////////// - int GetFrameCount(); - - ////////////////////////////////////////////////////////////////////////// - /// Get frame image (quad). - /// - /// @return Quad object. - /// - ////////////////////////////////////////////////////////////////////////// - JQuad* GetFrame(int index); - - ////////////////////////////////////////////////////////////////////////// - /// Restart animation. - /// - ////////////////////////////////////////////////////////////////////////// - void RestartAnimation(); - - ////////////////////////////////////////////////////////////////////////// - /// Start animation. - /// - ////////////////////////////////////////////////////////////////////////// - void StartAnimation(); - - ////////////////////////////////////////////////////////////////////////// - /// Stop animation. - /// - ////////////////////////////////////////////////////////////////////////// - void StopAnimation(); - - ////////////////////////////////////////////////////////////////////////// - /// Get animation status. - /// - /// @return animation status - /// - ////////////////////////////////////////////////////////////////////////// - bool IsAnimating(); - - ////////////////////////////////////////////////////////////////////////// - /// Move some distance from the current position. - /// - /// @param x - X distance to move. - /// @param y - Y distance to move. - /// - ////////////////////////////////////////////////////////////////////////// - void Move(float x, float y); - - ////////////////////////////////////////////////////////////////////////// - /// Set position of the sprite. - /// - /// @param x - X position. - /// @param y - Y position. - /// - ////////////////////////////////////////////////////////////////////////// - void SetPosition(float x, float y); - - ////////////////////////////////////////////////////////////////////////// - /// Set X position of the sprite. - /// - /// @param x - X position. - /// - ////////////////////////////////////////////////////////////////////////// - void SetX(float x); - - ////////////////////////////////////////////////////////////////////////// - /// Set Y position of the sprite. - /// - /// @param y - Y position. - /// - ////////////////////////////////////////////////////////////////////////// - void SetY(float y); - - ////////////////////////////////////////////////////////////////////////// - /// Get X position of the sprite. - /// - /// @return X position. - /// - ////////////////////////////////////////////////////////////////////////// - float GetX(); - - ////////////////////////////////////////////////////////////////////////// - /// Get Y position of the sprite. - /// - /// @return Y position. - /// - ////////////////////////////////////////////////////////////////////////// - float GetY(); - - ////////////////////////////////////////////////////////////////////////// - /// Get X velocity. - /// - /// @return X velocity. - /// - ////////////////////////////////////////////////////////////////////////// - float GetXVelocity(); - - ////////////////////////////////////////////////////////////////////////// - /// Get Y velocity. - /// - /// @return Y velocity. - /// - ////////////////////////////////////////////////////////////////////////// - float GetYVelocity(); - - ////////////////////////////////////////////////////////////////////////// - /// Set alpha value for rendering. - /// - /// @param alpha - Alpha value. - /// - ////////////////////////////////////////////////////////////////////////// - void SetAlpha(float alpha); - - ////////////////////////////////////////////////////////////////////////// - /// Get alpha value. - /// - /// @return Alpha value. - /// - ////////////////////////////////////////////////////////////////////////// - float GetAlpha(); - - ////////////////////////////////////////////////////////////////////////// - /// Set scale of the sprite. - /// - /// @param hscale - Horizontal scale. - /// @param vscale - Vertical scale. - /// - ////////////////////////////////////////////////////////////////////////// - void SetScale(float hscale, float vscale); - - ////////////////////////////////////////////////////////////////////////// - /// Set scale of the sprite. - /// - /// @param scale - Scale for both horizontal and vertical dimension. - /// - ////////////////////////////////////////////////////////////////////////// - void SetScale(float scale); - - ////////////////////////////////////////////////////////////////////////// - /// Get scale of the sprite. - /// - /// @return Scale of horizontal (assume same as the vertical). - /// - ////////////////////////////////////////////////////////////////////////// - float GetScale(); - - ////////////////////////////////////////////////////////////////////////// - /// Set rotation factor of the sprite. - /// - /// @param rot - Rotation angle in radian. - /// - ////////////////////////////////////////////////////////////////////////// - void SetRotation(float rot); - - ////////////////////////////////////////////////////////////////////////// - /// Get rotation factor of the sprite. - /// - /// @return Rotation angle in radian. - /// - ////////////////////////////////////////////////////////////////////////// - float GetRotation(); - - ////////////////////////////////////////////////////////////////////////// - /// Set moving speed of the sprite. - /// - /// @param speed - Moving speed. - /// - ////////////////////////////////////////////////////////////////////////// - void SetSpeed(float speed); - - ////////////////////////////////////////////////////////////////////////// - /// Get moving speed of the sprite. - /// - /// @return Moving speed. - /// - ////////////////////////////////////////////////////////////////////////// - float GetSpeed(); - - ////////////////////////////////////////////////////////////////////////// - /// Set moving direction of the sprite. - /// - /// @param angle - Moving angle in radian. - /// - ////////////////////////////////////////////////////////////////////////// - void SetDirection(float angle); - - ////////////////////////////////////////////////////////////////////////// - /// Set moving direction of the sprite based on a targeting position. - /// - /// @param x - X position of the target. - /// @param y - Y position of the target. - /// - ////////////////////////////////////////////////////////////////////////// - void SetDirection(float x, float y); - - ////////////////////////////////////////////////////////////////////////// - /// Get moving direction of the sprite. - /// - /// @return Moving angle in radian. - /// - ////////////////////////////////////////////////////////////////////////// - float GetDirection(); - - ////////////////////////////////////////////////////////////////////////// - /// Set anchor point of a frame or all frames of the sprite. All rotation - /// and collision operations are based on this anchor point. - /// - /// @param x - X position of the anchor point. - /// @param y - Y position of the anchor point. - /// @param index - Frame index, -1 for all frames. - /// - ////////////////////////////////////////////////////////////////////////// - void SetHotSpot(float x, float y, int index=-1); - - ////////////////////////////////////////////////////////////////////////// - /// Set color of the sprite for rendering. - /// - /// @param color - Color. - /// - ////////////////////////////////////////////////////////////////////////// - void SetColor(PIXEL_TYPE color); - - - - ////////////////////////////////////////////////////////////////////////// - /// \enum ANIMATION_TYPE - /// - /// Type of animation. - /// - ////////////////////////////////////////////////////////////////////////// - enum ANIMATION_TYPE - { - ANIMATION_TYPE_LOOPING, ///< Repeat playing (Default). - ANIMATION_TYPE_ONCE_AND_STAY, ///< Play to the end and stay at last frame - ANIMATION_TYPE_ONCE_AND_BACK, ///< Play to end and then stay at first frame. - ANIMATION_TYPE_ONCE_AND_GONE, ///< Play animation once only. - ANIMATION_TYPE_PINGPONG ///< Play forward then backward and repeat. - - }; - - -protected: - - static JRenderer* mRenderer; - - JTexture* mTex; - vector mFrames; - float mDuration; - float mTimer; - int mFrameCount; - int mCurrentFrame; - int mAnimationType; - int mDelta; - bool mAnimating; - - float mAlpha; - PIXEL_TYPE mColor; - - float mVScale; - float mHScale; - - float mRotation; - float mDirection; - float mSpeed; - - int mId; - bool mActive; - - float mX; - float mY; - - - -}; - - -class JSpriteList -{ -protected: - - int mCount; - JSprite** mList; - //JSpriteList** mVictims; - //JCollisionListener* mCollisionListener; - -public: - JSpriteList(int count); - ~JSpriteList(); - void Update(float dt); - void Render(); - void AddSprite(JSprite* sprite);//, JSpriteList* victim); - - //bool CheckCollision(JSprite* sprite); // check collision against the provided list - //void SetCollisionListener(JCollisionListener *listener); - JSprite* Activate(float x, float y); - void Activate(float x, float y, int index); - - JSprite* GetSprite(int index); - - void EnableAll(bool flag); -}; - - -#endif - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _SPRITE_H_ +#define _SPRITE_H_ + +#if defined (WIN32) || defined(LINUX) || defined(IOS) +#include +#else +#include +#endif + +#include + +#include "JRenderer.h" + + +using namespace std; + + +////////////////////////////////////////////////////////////////////////// +/// Sprite is a container of single static image or animation frames. +/// +////////////////////////////////////////////////////////////////////////// +class JSprite +{ + +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + /// @param tex - Texture for the first frame and the following frames. + /// NULL to indicate no starting frame. + /// @param x - X of the frame in texture. + /// @param y - Y of the frame in texture. + /// @param width - Width of the frame. + /// @param height - Height of the frame. + /// @param flipped - Indicate if the frame is horizontally flipped. + /// + ////////////////////////////////////////////////////////////////////////// + JSprite(JTexture *tex=NULL, float x=0.0f, float y=0.0f, float width=0.0f, float height=0.0f, bool flipped = false); + + virtual ~JSprite(); + + ////////////////////////////////////////////////////////////////////////// + /// Update animation. + /// + /// @param dt - Delta time since last update (in second). + /// + ////////////////////////////////////////////////////////////////////////// + virtual void Update(float dt); + + ////////////////////////////////////////////////////////////////////////// + /// Render current frame. + /// + ////////////////////////////////////////////////////////////////////////// + virtual void Render(); + + ////////////////////////////////////////////////////////////////////////// + /// Set animation type. + /// + /// @param type - Animation type. + /// + /// @code + /// ANIMATION_TYPE_LOOPING - Repeat playing (Default). + /// ANIMATION_TYPE_ONCE_AND_GONE - Play animation once only. + /// ANIMATION_TYPE_ONCE_AND_BACK - Play to end and then stay at first frame. + /// ANIMATION_TYPE_PINGPONG - Play forward then backward and repeat. + /// @endcode + /// + ////////////////////////////////////////////////////////////////////////// + void SetAnimationType(int type); + + ////////////////////////////////////////////////////////////////////////// + /// Enable/Disable sprite. + /// + /// @param f - True to enable, false to disable. + /// + ////////////////////////////////////////////////////////////////////////// + void SetActive(bool f); + + ////////////////////////////////////////////////////////////////////////// + /// Get current active status. + /// + /// @return Active status. + /// + ////////////////////////////////////////////////////////////////////////// + bool IsActive(); + + ////////////////////////////////////////////////////////////////////////// + /// Give sprite an id. + /// + /// @param id - Id. + /// + ////////////////////////////////////////////////////////////////////////// + void SetId(int id); + + ////////////////////////////////////////////////////////////////////////// + /// Get sprite id. + /// + /// @return Sprite id. + ////////////////////////////////////////////////////////////////////////// + int GetId(); + + ////////////////////////////////////////////////////////////////////////// + /// Flip a frame or all frames horizontally when rendering. + /// + /// @param flip - True to flip. + /// @param index - Frame index, -1 to flip all frames. + /// + ////////////////////////////////////////////////////////////////////////// + void SetFlip(bool flip, int index = -1); + + + ////////////////////////////////////////////////////////////////////////// + /// Add new animation frame. + /// + /// @param x - X of the frame in texture. + /// @param y - Y of the frame in texture. + /// @param width - Width of the frame. + /// @param height - Height of the frame. + /// @param flipped - Indicate if the frame is horizontally flipped. + /// + ////////////////////////////////////////////////////////////////////////// + void AddFrame(float x, float y, float width, float height, bool flipped = false); + + ////////////////////////////////////////////////////////////////////////// + /// Add new animation frame. + /// + /// @param tex - Texture for this frame and the following frames. + /// @param x - X of the frame in texture. + /// @param y - Y of the frame in texture. + /// @param width - Width of the frame. + /// @param height - Height of the frame. + /// @param flipped - Indicate if the frame is horizontally flipped. + /// + ////////////////////////////////////////////////////////////////////////// + void AddFrame(JTexture *tex, float x, float y, float width, float height, bool flipped = false); + + ////////////////////////////////////////////////////////////////////////// + /// Set playback duration for each frame. + /// + /// @param duration - Playback duration (in second) for each frame. + /// + ////////////////////////////////////////////////////////////////////////// + void SetDuration(float duration); + + ////////////////////////////////////////////////////////////////////////// + /// Get index of current frame. + /// + /// @return Index of current frame. + /// + ////////////////////////////////////////////////////////////////////////// + int GetCurrentFrameIndex(); + + ////////////////////////////////////////////////////////////////////////// + /// Set current frame to a particular index. + /// + /// @param frame - The new index of current frame. + /// + ////////////////////////////////////////////////////////////////////////// + void SetCurrentFrameIndex(int frame); + + ////////////////////////////////////////////////////////////////////////// + /// Get current frame image (quad). + /// + /// @return Quad object. + /// + ////////////////////////////////////////////////////////////////////////// + JQuad* GetCurrentFrame(); + + ////////////////////////////////////////////////////////////////////////// + /// Get numer of animation frames. + /// + /// @return Numer of animation frames. + /// + ////////////////////////////////////////////////////////////////////////// + int GetFrameCount(); + + ////////////////////////////////////////////////////////////////////////// + /// Get frame image (quad). + /// + /// @return Quad object. + /// + ////////////////////////////////////////////////////////////////////////// + JQuad* GetFrame(int index); + + ////////////////////////////////////////////////////////////////////////// + /// Restart animation. + /// + ////////////////////////////////////////////////////////////////////////// + void RestartAnimation(); + + ////////////////////////////////////////////////////////////////////////// + /// Start animation. + /// + ////////////////////////////////////////////////////////////////////////// + void StartAnimation(); + + ////////////////////////////////////////////////////////////////////////// + /// Stop animation. + /// + ////////////////////////////////////////////////////////////////////////// + void StopAnimation(); + + ////////////////////////////////////////////////////////////////////////// + /// Get animation status. + /// + /// @return animation status + /// + ////////////////////////////////////////////////////////////////////////// + bool IsAnimating(); + + ////////////////////////////////////////////////////////////////////////// + /// Move some distance from the current position. + /// + /// @param x - X distance to move. + /// @param y - Y distance to move. + /// + ////////////////////////////////////////////////////////////////////////// + void Move(float x, float y); + + ////////////////////////////////////////////////////////////////////////// + /// Set position of the sprite. + /// + /// @param x - X position. + /// @param y - Y position. + /// + ////////////////////////////////////////////////////////////////////////// + void SetPosition(float x, float y); + + ////////////////////////////////////////////////////////////////////////// + /// Set X position of the sprite. + /// + /// @param x - X position. + /// + ////////////////////////////////////////////////////////////////////////// + void SetX(float x); + + ////////////////////////////////////////////////////////////////////////// + /// Set Y position of the sprite. + /// + /// @param y - Y position. + /// + ////////////////////////////////////////////////////////////////////////// + void SetY(float y); + + ////////////////////////////////////////////////////////////////////////// + /// Get X position of the sprite. + /// + /// @return X position. + /// + ////////////////////////////////////////////////////////////////////////// + float GetX(); + + ////////////////////////////////////////////////////////////////////////// + /// Get Y position of the sprite. + /// + /// @return Y position. + /// + ////////////////////////////////////////////////////////////////////////// + float GetY(); + + ////////////////////////////////////////////////////////////////////////// + /// Get X velocity. + /// + /// @return X velocity. + /// + ////////////////////////////////////////////////////////////////////////// + float GetXVelocity(); + + ////////////////////////////////////////////////////////////////////////// + /// Get Y velocity. + /// + /// @return Y velocity. + /// + ////////////////////////////////////////////////////////////////////////// + float GetYVelocity(); + + ////////////////////////////////////////////////////////////////////////// + /// Set alpha value for rendering. + /// + /// @param alpha - Alpha value. + /// + ////////////////////////////////////////////////////////////////////////// + void SetAlpha(float alpha); + + ////////////////////////////////////////////////////////////////////////// + /// Get alpha value. + /// + /// @return Alpha value. + /// + ////////////////////////////////////////////////////////////////////////// + float GetAlpha(); + + ////////////////////////////////////////////////////////////////////////// + /// Set scale of the sprite. + /// + /// @param hscale - Horizontal scale. + /// @param vscale - Vertical scale. + /// + ////////////////////////////////////////////////////////////////////////// + void SetScale(float hscale, float vscale); + + ////////////////////////////////////////////////////////////////////////// + /// Set scale of the sprite. + /// + /// @param scale - Scale for both horizontal and vertical dimension. + /// + ////////////////////////////////////////////////////////////////////////// + void SetScale(float scale); + + ////////////////////////////////////////////////////////////////////////// + /// Get scale of the sprite. + /// + /// @return Scale of horizontal (assume same as the vertical). + /// + ////////////////////////////////////////////////////////////////////////// + float GetScale(); + + ////////////////////////////////////////////////////////////////////////// + /// Set rotation factor of the sprite. + /// + /// @param rot - Rotation angle in radian. + /// + ////////////////////////////////////////////////////////////////////////// + void SetRotation(float rot); + + ////////////////////////////////////////////////////////////////////////// + /// Get rotation factor of the sprite. + /// + /// @return Rotation angle in radian. + /// + ////////////////////////////////////////////////////////////////////////// + float GetRotation(); + + ////////////////////////////////////////////////////////////////////////// + /// Set moving speed of the sprite. + /// + /// @param speed - Moving speed. + /// + ////////////////////////////////////////////////////////////////////////// + void SetSpeed(float speed); + + ////////////////////////////////////////////////////////////////////////// + /// Get moving speed of the sprite. + /// + /// @return Moving speed. + /// + ////////////////////////////////////////////////////////////////////////// + float GetSpeed(); + + ////////////////////////////////////////////////////////////////////////// + /// Set moving direction of the sprite. + /// + /// @param angle - Moving angle in radian. + /// + ////////////////////////////////////////////////////////////////////////// + void SetDirection(float angle); + + ////////////////////////////////////////////////////////////////////////// + /// Set moving direction of the sprite based on a targeting position. + /// + /// @param x - X position of the target. + /// @param y - Y position of the target. + /// + ////////////////////////////////////////////////////////////////////////// + void SetDirection(float x, float y); + + ////////////////////////////////////////////////////////////////////////// + /// Get moving direction of the sprite. + /// + /// @return Moving angle in radian. + /// + ////////////////////////////////////////////////////////////////////////// + float GetDirection(); + + ////////////////////////////////////////////////////////////////////////// + /// Set anchor point of a frame or all frames of the sprite. All rotation + /// and collision operations are based on this anchor point. + /// + /// @param x - X position of the anchor point. + /// @param y - Y position of the anchor point. + /// @param index - Frame index, -1 for all frames. + /// + ////////////////////////////////////////////////////////////////////////// + void SetHotSpot(float x, float y, int index=-1); + + ////////////////////////////////////////////////////////////////////////// + /// Set color of the sprite for rendering. + /// + /// @param color - Color. + /// + ////////////////////////////////////////////////////////////////////////// + void SetColor(PIXEL_TYPE color); + + + + ////////////////////////////////////////////////////////////////////////// + /// \enum ANIMATION_TYPE + /// + /// Type of animation. + /// + ////////////////////////////////////////////////////////////////////////// + enum ANIMATION_TYPE + { + ANIMATION_TYPE_LOOPING, ///< Repeat playing (Default). + ANIMATION_TYPE_ONCE_AND_STAY, ///< Play to the end and stay at last frame + ANIMATION_TYPE_ONCE_AND_BACK, ///< Play to end and then stay at first frame. + ANIMATION_TYPE_ONCE_AND_GONE, ///< Play animation once only. + ANIMATION_TYPE_PINGPONG ///< Play forward then backward and repeat. + + }; + + +protected: + + static JRenderer* mRenderer; + + JTexture* mTex; + vector mFrames; + float mDuration; + float mTimer; + int mFrameCount; + int mCurrentFrame; + int mAnimationType; + int mDelta; + bool mAnimating; + + float mAlpha; + PIXEL_TYPE mColor; + + float mVScale; + float mHScale; + + float mRotation; + float mDirection; + float mSpeed; + + int mId; + bool mActive; + + float mX; + float mY; + + + +}; + + +class JSpriteList +{ +protected: + + int mCount; + JSprite** mList; + //JSpriteList** mVictims; + //JCollisionListener* mCollisionListener; + +public: + JSpriteList(int count); + ~JSpriteList(); + void Update(float dt); + void Render(); + void AddSprite(JSprite* sprite);//, JSpriteList* victim); + + //bool CheckCollision(JSprite* sprite); // check collision against the provided list + //void SetCollisionListener(JCollisionListener *listener); + JSprite* Activate(float x, float y); + void Activate(float x, float y, int index); + + JSprite* GetSprite(int index); + + void EnableAll(bool flag); +}; + + +#endif + diff --git a/JGE/include/JTTFont.h b/JGE/include/JTTFont.h index a2bc94648..229085625 100644 --- a/JGE/include/JTTFont.h +++ b/JGE/include/JTTFont.h @@ -1,307 +1,307 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _JTTFONT_H -#define _JTTFONT_H - -#include "../../JGE/include/JGE.h" - -#include -#include - -#define TTF_CACHE_SIZE 256 - - -////////////////////////////////////////////////////////////////////////// -/// True Type font support with the help of Freetype library. JTTFont has -/// a simple caching system so that a character which has been rendered before -/// can be retrieved from the cache instead of drawing it again by the -/// Freetype library. This can give you a much faster rendering speed. -/// Also, if you only need to use a limited number of characters -/// in your game, you can actually cache all your characters in the cache -/// beforehand and unload the font to save memory. -/// -/// @par For example, if you only want to use the standard ASCII characters in -/// your game: -/// -/// @code -/// -/// // in Create() -/// mTTFont = new JTTFont(); -/// mTTFont->Load("arial.ttf", 32); // size 32 -/// -/// if (mTTFont->PreCacheASCII()) -/// mTTFont->Unload(); -/// ... -/// -/// // in Render() -/// mTTFont->RenderString("Hello World!", 240, 80, JGETEXT_CENTER); -/// -/// @endcode -/// -////////////////////////////////////////////////////////////////////////// -class JTTFont -{ - -public: - - ////////////////////////////////////////////////////////////////////////// - /// Constructor. - /// - /// @param cacheImageSize - Size of the texture used for caching. This can - /// be 64x64, 128x128(default), 256x256 or 512x512. - /// - ////////////////////////////////////////////////////////////////////////// - JTTFont(int cacheImageSize=CACHE_IMAGE_256x256); - - ~JTTFont(); - - ////////////////////////////////////////////////////////////////////////// - /// \enum FONT_LOADING_MODE - /// - /// Font loading options. - /// - ////////////////////////////////////////////////////////////////////////// - enum FONT_LOADING_MODE - { - MODE_NORMAL, ///< Load only. - MODE_PRECACHE_ASCII, ///< Load the font and cache all ASCII characters. - MODE_PRECACHE_ASCII_EX ///< Load the font and cache all Extended ASCII characters. - }; - - ////////////////////////////////////////////////////////////////////////// - /// \enum CACHE_IMAGE_SIZE - /// - /// Size of the texture used for caching. - /// - ////////////////////////////////////////////////////////////////////////// - enum CACHE_IMAGE_SIZE - { - CACHE_IMAGE_64x64, ///< 64x64 - CACHE_IMAGE_128x128, ///< 128x128 - CACHE_IMAGE_256x256, ///< 256x256 - CACHE_IMAGE_512x512 ///< 512x512 - }; - - ////////////////////////////////////////////////////////////////////////// - /// Set color of font. - /// - /// @param color - Font color. - /// - ////////////////////////////////////////////////////////////////////////// - void SetColor(PIXEL_TYPE color); - - ////////////////////////////////////////////////////////////////////////// - /// Set angle of the font for rendering. - /// - /// @param angle - Angle in radians. - /// - ////////////////////////////////////////////////////////////////////////// - void SetAngle(float angle); - - ////////////////////////////////////////////////////////////////////////// - /// Set font size. - /// - /// @param size - Font size. - /// - /// @note Setting font size will clear the cache. - /// - ////////////////////////////////////////////////////////////////////////// - bool SetSize(int size); - - ////////////////////////////////////////////////////////////////////////// - /// Load font file. - /// - /// @param filename - Name of True Type font. - /// @param size - Initial font size. Default is 12. - /// @param mode - Loading mode. - /// - /// @return - True if no error. - /// - ////////////////////////////////////////////////////////////////////////// - bool Load(const char *filename, int size=12, int mode=MODE_NORMAL); - - ////////////////////////////////////////////////////////////////////////// - /// Create font using font data from another JTTFont instance. - /// - /// @param fontSource - Source of font data. - /// @param size - Initial font size. Default is 12. - /// @param mode - Loading mode. - /// - /// @return - True if no error. - /// - ////////////////////////////////////////////////////////////////////////// - bool Load(JTTFont *fontSource, int size=12, int mode=MODE_NORMAL); - - ////////////////////////////////////////////////////////////////////////// - /// Unload font file and related Freetype objects from memory. - /// - ////////////////////////////////////////////////////////////////////////// - void Unload(void); - - ////////////////////////////////////////////////////////////////////////// - /// Render Unicode string to screen. - /// - /// @param text - NULL terminated Unicode-16 string. - /// @param x - X position. - /// @param y - Y position. - /// @param alignment - Text alignment: JGETEXT_LEFT, JGETEXT_RIGHT, JGETEXT_CENTER - /// - ////////////////////////////////////////////////////////////////////////// - void RenderString(const u16 *text, float x, float y, int alignment=JGETEXT_LEFT); - - ////////////////////////////////////////////////////////////////////////// - /// Render ASCII string to screen. - /// - /// @param text - NULL terminated ASCII string. - /// @param x - X position. - /// @param y - Y position. - /// @param alignment - Text alignment: JGETEXT_LEFT, JGETEXT_RIGHT, JGETEXT_CENTER - /// - ////////////////////////////////////////////////////////////////////////// - void RenderString(const char *text, float x, float y, int alignment=JGETEXT_LEFT); - - ////////////////////////////////////////////////////////////////////////// - /// Render Chinese (GBK) string to screen. - /// - /// @param text - NULL terminated GBK encoded string. - /// @param x - X position. - /// @param y - Y position. - /// @param alignment - Text alignment: JGETEXT_LEFT, JGETEXT_RIGHT, JGETEXT_CENTER - /// - ////////////////////////////////////////////////////////////////////////// - void RenderString(const u8 *text, float x, float y, int alignment=JGETEXT_LEFT); - - ////////////////////////////////////////////////////////////////////////// - /// Put characters of an Unicode string into cache - /// - /// @param text - NULL terminated Unicode-16 string. - /// - ////////////////////////////////////////////////////////////////////////// - void PreCacheString(const u16 *text); - - ////////////////////////////////////////////////////////////////////////// - /// Put characters of an ASCII string into cache. - /// - /// @param text - NULL terminated ASCII string. - /// - ////////////////////////////////////////////////////////////////////////// - void PreCacheString(const char *text); - - ////////////////////////////////////////////////////////////////////////// - /// Put characters of a Chinese (GBK) string into cache. - /// - /// @param text - NULL terminated GBK encoded string. - /// - ////////////////////////////////////////////////////////////////////////// - void PreCacheString(const u8 *text); - - ////////////////////////////////////////////////////////////////////////// - /// Get width of Unicode string on screen. - /// - /// @param text - NULL terminated Unicode-16 string. - /// - /// @return - Width in pixels - /// - ////////////////////////////////////////////////////////////////////////// - int GetWidth(const u16 *text); - - ////////////////////////////////////////////////////////////////////////// - /// Get width of ASCII string on screen. - /// - /// @param text - NULL terminated ASCII string. - /// - /// @return - Width in pixels - /// - ////////////////////////////////////////////////////////////////////////// - int GetWidth(const char *text); - - ////////////////////////////////////////////////////////////////////////// - /// Get width of Chinese (GBK) string on screen. - /// - /// @param text - NULL terminated GBK encoded string. - /// - /// @return - Width in pixels - /// - ////////////////////////////////////////////////////////////////////////// - int GetWidth(const u8 *text); - - ////////////////////////////////////////////////////////////////////////// - /// Put all standard ASCII characters (0x20-0x7F) into cache. - /// - /// @return - True if success. - /// - ////////////////////////////////////////////////////////////////////////// - bool PreCacheASCII(); - - ////////////////////////////////////////////////////////////////////////// - /// Put all ASCII characters (0x20-0xFF) into cache. - /// - /// @return - True if success. - /// - ////////////////////////////////////////////////////////////////////////// - bool PreCacheExtendedASCII(); - - void SetAntialias(bool flag); - -protected: - FT_Library GetFontLibrary(); - FT_Byte* GetFontBits(); - int GetFontBitsSize(); - -private: - - int RenderString(const u16 *text, float x, float y, bool render); - int RenderString(const char *text, float x, float y, bool render); - int RenderString(const u8 *text, float x, float y, bool render); - - - int PreCacheChar(u16 ch, u16 cachedCode); - int GetCachedChar(u16 cachedCode); - void DrawBitmap(void *image, FT_Bitmap *bitmap, FT_Int x, FT_Int y, int width, int height); - - - JTexture* mTexture; - - JQuad* mQuads[TTF_CACHE_SIZE]; - u16 mCachedCode[TTF_CACHE_SIZE]; - u8 mXAdvance[TTF_CACHE_SIZE]; - - int mCurr; - - int mTexWidth; - int mTexHeight; - int mMaxCharWidth; - int mMaxCharHeight; - int mMaxCharCount; - int mColCount; - int mRowCount; - - bool mASCIIDirectMapping; - - JTTFont* mFontSource; - bool mSharingFont; - - int mSize; - PIXEL_TYPE mColor; - float mAngle; - FT_Library mLibrary; - FT_Face mFace; - - FT_Byte* mFontBits; - int mFontBitsSize; - - bool mAntialias; - - bool mFontLoaded; - -}; - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _JTTFONT_H +#define _JTTFONT_H + +#include "../../JGE/include/JGE.h" + +#include +#include + +#define TTF_CACHE_SIZE 256 + + +////////////////////////////////////////////////////////////////////////// +/// True Type font support with the help of Freetype library. JTTFont has +/// a simple caching system so that a character which has been rendered before +/// can be retrieved from the cache instead of drawing it again by the +/// Freetype library. This can give you a much faster rendering speed. +/// Also, if you only need to use a limited number of characters +/// in your game, you can actually cache all your characters in the cache +/// beforehand and unload the font to save memory. +/// +/// @par For example, if you only want to use the standard ASCII characters in +/// your game: +/// +/// @code +/// +/// // in Create() +/// mTTFont = new JTTFont(); +/// mTTFont->Load("arial.ttf", 32); // size 32 +/// +/// if (mTTFont->PreCacheASCII()) +/// mTTFont->Unload(); +/// ... +/// +/// // in Render() +/// mTTFont->RenderString("Hello World!", 240, 80, JGETEXT_CENTER); +/// +/// @endcode +/// +////////////////////////////////////////////////////////////////////////// +class JTTFont +{ + +public: + + ////////////////////////////////////////////////////////////////////////// + /// Constructor. + /// + /// @param cacheImageSize - Size of the texture used for caching. This can + /// be 64x64, 128x128(default), 256x256 or 512x512. + /// + ////////////////////////////////////////////////////////////////////////// + JTTFont(int cacheImageSize=CACHE_IMAGE_256x256); + + ~JTTFont(); + + ////////////////////////////////////////////////////////////////////////// + /// \enum FONT_LOADING_MODE + /// + /// Font loading options. + /// + ////////////////////////////////////////////////////////////////////////// + enum FONT_LOADING_MODE + { + MODE_NORMAL, ///< Load only. + MODE_PRECACHE_ASCII, ///< Load the font and cache all ASCII characters. + MODE_PRECACHE_ASCII_EX ///< Load the font and cache all Extended ASCII characters. + }; + + ////////////////////////////////////////////////////////////////////////// + /// \enum CACHE_IMAGE_SIZE + /// + /// Size of the texture used for caching. + /// + ////////////////////////////////////////////////////////////////////////// + enum CACHE_IMAGE_SIZE + { + CACHE_IMAGE_64x64, ///< 64x64 + CACHE_IMAGE_128x128, ///< 128x128 + CACHE_IMAGE_256x256, ///< 256x256 + CACHE_IMAGE_512x512 ///< 512x512 + }; + + ////////////////////////////////////////////////////////////////////////// + /// Set color of font. + /// + /// @param color - Font color. + /// + ////////////////////////////////////////////////////////////////////////// + void SetColor(PIXEL_TYPE color); + + ////////////////////////////////////////////////////////////////////////// + /// Set angle of the font for rendering. + /// + /// @param angle - Angle in radians. + /// + ////////////////////////////////////////////////////////////////////////// + void SetAngle(float angle); + + ////////////////////////////////////////////////////////////////////////// + /// Set font size. + /// + /// @param size - Font size. + /// + /// @note Setting font size will clear the cache. + /// + ////////////////////////////////////////////////////////////////////////// + bool SetSize(int size); + + ////////////////////////////////////////////////////////////////////////// + /// Load font file. + /// + /// @param filename - Name of True Type font. + /// @param size - Initial font size. Default is 12. + /// @param mode - Loading mode. + /// + /// @return - True if no error. + /// + ////////////////////////////////////////////////////////////////////////// + bool Load(const char *filename, int size=12, int mode=MODE_NORMAL); + + ////////////////////////////////////////////////////////////////////////// + /// Create font using font data from another JTTFont instance. + /// + /// @param fontSource - Source of font data. + /// @param size - Initial font size. Default is 12. + /// @param mode - Loading mode. + /// + /// @return - True if no error. + /// + ////////////////////////////////////////////////////////////////////////// + bool Load(JTTFont *fontSource, int size=12, int mode=MODE_NORMAL); + + ////////////////////////////////////////////////////////////////////////// + /// Unload font file and related Freetype objects from memory. + /// + ////////////////////////////////////////////////////////////////////////// + void Unload(void); + + ////////////////////////////////////////////////////////////////////////// + /// Render Unicode string to screen. + /// + /// @param text - NULL terminated Unicode-16 string. + /// @param x - X position. + /// @param y - Y position. + /// @param alignment - Text alignment: JGETEXT_LEFT, JGETEXT_RIGHT, JGETEXT_CENTER + /// + ////////////////////////////////////////////////////////////////////////// + void RenderString(const u16 *text, float x, float y, int alignment=JGETEXT_LEFT); + + ////////////////////////////////////////////////////////////////////////// + /// Render ASCII string to screen. + /// + /// @param text - NULL terminated ASCII string. + /// @param x - X position. + /// @param y - Y position. + /// @param alignment - Text alignment: JGETEXT_LEFT, JGETEXT_RIGHT, JGETEXT_CENTER + /// + ////////////////////////////////////////////////////////////////////////// + void RenderString(const char *text, float x, float y, int alignment=JGETEXT_LEFT); + + ////////////////////////////////////////////////////////////////////////// + /// Render Chinese (GBK) string to screen. + /// + /// @param text - NULL terminated GBK encoded string. + /// @param x - X position. + /// @param y - Y position. + /// @param alignment - Text alignment: JGETEXT_LEFT, JGETEXT_RIGHT, JGETEXT_CENTER + /// + ////////////////////////////////////////////////////////////////////////// + void RenderString(const u8 *text, float x, float y, int alignment=JGETEXT_LEFT); + + ////////////////////////////////////////////////////////////////////////// + /// Put characters of an Unicode string into cache + /// + /// @param text - NULL terminated Unicode-16 string. + /// + ////////////////////////////////////////////////////////////////////////// + void PreCacheString(const u16 *text); + + ////////////////////////////////////////////////////////////////////////// + /// Put characters of an ASCII string into cache. + /// + /// @param text - NULL terminated ASCII string. + /// + ////////////////////////////////////////////////////////////////////////// + void PreCacheString(const char *text); + + ////////////////////////////////////////////////////////////////////////// + /// Put characters of a Chinese (GBK) string into cache. + /// + /// @param text - NULL terminated GBK encoded string. + /// + ////////////////////////////////////////////////////////////////////////// + void PreCacheString(const u8 *text); + + ////////////////////////////////////////////////////////////////////////// + /// Get width of Unicode string on screen. + /// + /// @param text - NULL terminated Unicode-16 string. + /// + /// @return - Width in pixels + /// + ////////////////////////////////////////////////////////////////////////// + int GetWidth(const u16 *text); + + ////////////////////////////////////////////////////////////////////////// + /// Get width of ASCII string on screen. + /// + /// @param text - NULL terminated ASCII string. + /// + /// @return - Width in pixels + /// + ////////////////////////////////////////////////////////////////////////// + int GetWidth(const char *text); + + ////////////////////////////////////////////////////////////////////////// + /// Get width of Chinese (GBK) string on screen. + /// + /// @param text - NULL terminated GBK encoded string. + /// + /// @return - Width in pixels + /// + ////////////////////////////////////////////////////////////////////////// + int GetWidth(const u8 *text); + + ////////////////////////////////////////////////////////////////////////// + /// Put all standard ASCII characters (0x20-0x7F) into cache. + /// + /// @return - True if success. + /// + ////////////////////////////////////////////////////////////////////////// + bool PreCacheASCII(); + + ////////////////////////////////////////////////////////////////////////// + /// Put all ASCII characters (0x20-0xFF) into cache. + /// + /// @return - True if success. + /// + ////////////////////////////////////////////////////////////////////////// + bool PreCacheExtendedASCII(); + + void SetAntialias(bool flag); + +protected: + FT_Library GetFontLibrary(); + FT_Byte* GetFontBits(); + int GetFontBitsSize(); + +private: + + int RenderString(const u16 *text, float x, float y, bool render); + int RenderString(const char *text, float x, float y, bool render); + int RenderString(const u8 *text, float x, float y, bool render); + + + int PreCacheChar(u16 ch, u16 cachedCode); + int GetCachedChar(u16 cachedCode); + void DrawBitmap(void *image, FT_Bitmap *bitmap, FT_Int x, FT_Int y, int width, int height); + + + JTexture* mTexture; + + JQuad* mQuads[TTF_CACHE_SIZE]; + u16 mCachedCode[TTF_CACHE_SIZE]; + u8 mXAdvance[TTF_CACHE_SIZE]; + + int mCurr; + + int mTexWidth; + int mTexHeight; + int mMaxCharWidth; + int mMaxCharHeight; + int mMaxCharCount; + int mColCount; + int mRowCount; + + bool mASCIIDirectMapping; + + JTTFont* mFontSource; + bool mSharingFont; + + int mSize; + PIXEL_TYPE mColor; + float mAngle; + FT_Library mLibrary; + FT_Face mFace; + + FT_Byte* mFontBits; + int mFontBitsSize; + + bool mAntialias; + + bool mFontLoaded; + +}; + +#endif diff --git a/JGE/include/Vector2D.h b/JGE/include/Vector2D.h index 89a76ba31..78546b31a 100644 --- a/JGE/include/Vector2D.h +++ b/JGE/include/Vector2D.h @@ -1,73 +1,73 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#ifndef _VECTOR2D_H -#define _VECTOR2D_H - -#ifdef WIN32 -#include -#elif (defined LINUX) || (defined IOS) -#include -#else -#include -#endif - - -struct Vector2D -{ - - float x, y; - static const Vector2D& Blank() { static const Vector2D V(0, 0); return V; } - - inline Vector2D(void) {} - - inline Vector2D(float _x,float _y) : x(_x), y(_y) {} - - inline Vector2D &operator /=(const float scalar) { x /= scalar; y /= scalar; return *this; } - - inline Vector2D &operator *=(const float scalar) { x *= scalar; y *= scalar; return *this; } - - inline Vector2D &operator +=(const Vector2D &v) { x += v.x; y += v.y; return *this; } - - inline Vector2D &operator -=(const Vector2D &v) { x -= v.x; y -= v.y; return *this; } - - inline bool operator ==(const Vector2D &v) const { return x == v.x && y == v.y; } - inline bool operator !=(const Vector2D &v) const { return x != v.x || y != v.y; } - - - // cross product - inline float operator ^ (const Vector2D &v) const { return (x * v.y) - (y * v.x); } - - // dot product - inline float operator * (const Vector2D &v) const { return (x*v.x) + (y*v.y); } - - inline float Dot(const Vector2D &v) const { return (x * v.x) + (y * v.y); } - inline float Cross(const Vector2D &v) const { return (x * v.y) - (y * v.x); } - - - inline Vector2D operator * (float s) const { return Vector2D(x*s, y*s); } - inline Vector2D operator / (float s) const { return Vector2D(x/s, y/s); } - inline Vector2D operator + (const Vector2D &v) const { return Vector2D(x+v.x, y+v.y); } - inline Vector2D operator - (const Vector2D &v) const { return Vector2D(x-v.x, y-v.y); } - friend Vector2D operator * (float k, const Vector2D& v) { return Vector2D(v.x*k, v.y*k); } - inline Vector2D operator -(void) const { return Vector2D(-x, -y); } - - inline float Length(void) const; - float Normalize(void) ; - Vector2D Direction(void) const; - float Angle(const Vector2D& xE); - Vector2D& Rotate(float angle); - Vector2D& Rotate(const Vector2D& xCentre, float fAngle); - void Clamp(const Vector2D& min, const Vector2D& max); - -}; - - -#endif +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#ifndef _VECTOR2D_H +#define _VECTOR2D_H + +#ifdef WIN32 +#include +#elif (defined LINUX) || (defined IOS) +#include +#else +#include +#endif + + +struct Vector2D +{ + + float x, y; + static const Vector2D& Blank() { static const Vector2D V(0, 0); return V; } + + inline Vector2D(void) {} + + inline Vector2D(float _x,float _y) : x(_x), y(_y) {} + + inline Vector2D &operator /=(const float scalar) { x /= scalar; y /= scalar; return *this; } + + inline Vector2D &operator *=(const float scalar) { x *= scalar; y *= scalar; return *this; } + + inline Vector2D &operator +=(const Vector2D &v) { x += v.x; y += v.y; return *this; } + + inline Vector2D &operator -=(const Vector2D &v) { x -= v.x; y -= v.y; return *this; } + + inline bool operator ==(const Vector2D &v) const { return x == v.x && y == v.y; } + inline bool operator !=(const Vector2D &v) const { return x != v.x || y != v.y; } + + + // cross product + inline float operator ^ (const Vector2D &v) const { return (x * v.y) - (y * v.x); } + + // dot product + inline float operator * (const Vector2D &v) const { return (x*v.x) + (y*v.y); } + + inline float Dot(const Vector2D &v) const { return (x * v.x) + (y * v.y); } + inline float Cross(const Vector2D &v) const { return (x * v.y) - (y * v.x); } + + + inline Vector2D operator * (float s) const { return Vector2D(x*s, y*s); } + inline Vector2D operator / (float s) const { return Vector2D(x/s, y/s); } + inline Vector2D operator + (const Vector2D &v) const { return Vector2D(x+v.x, y+v.y); } + inline Vector2D operator - (const Vector2D &v) const { return Vector2D(x-v.x, y-v.y); } + friend Vector2D operator * (float k, const Vector2D& v) { return Vector2D(v.x*k, v.y*k); } + inline Vector2D operator -(void) const { return Vector2D(-x, -y); } + + inline float Length(void) const; + float Normalize(void) ; + Vector2D Direction(void) const; + float Angle(const Vector2D& xE); + Vector2D& Rotate(float angle); + Vector2D& Rotate(const Vector2D& xCentre, float fAngle); + void Clamp(const Vector2D& min, const Vector2D& max); + +}; + + +#endif diff --git a/JGE/include/Vector3D.h b/JGE/include/Vector3D.h index 5617ed1f9..573af33ca 100644 --- a/JGE/include/Vector3D.h +++ b/JGE/include/Vector3D.h @@ -1,95 +1,95 @@ -#ifndef __VECTOR3D_H_ -#define __VECTOR3D_H_ - -#include - - -/*************************** Macros and constants ***************************/ -// returns a number ranging from -1.0 to 1.0 -#define FRAND (((float)rand()-(float)rand())/RAND_MAX) -#define Clamp(x, min, max) x = (x + + +/*************************** Macros and constants ***************************/ +// returns a number ranging from -1.0 to 1.0 +#define FRAND (((float)rand()-(float)rand())/RAND_MAX) +#define Clamp(x, min, max) x = (x1.0f) x=1.0f; } - - -class hgeColorRGB -{ -public: - float r,g,b,a; - - hgeColorRGB(float _r, float _g, float _b, float _a) { r=_r; g=_g; b=_b; a=_a; } - hgeColorRGB(DWORD col) { SetHWColor(col); } - hgeColorRGB() { r=g=b=a=0; } - - hgeColorRGB operator- (const hgeColorRGB &c) const { return hgeColorRGB(r-c.r, g-c.g, b-c.b, a-c.a); } - hgeColorRGB operator+ (const hgeColorRGB &c) const { return hgeColorRGB(r+c.r, g+c.g, b+c.b, a+c.a); } - hgeColorRGB operator* (const hgeColorRGB &c) const { return hgeColorRGB(r*c.r, g*c.g, b*c.b, a*c.a); } - hgeColorRGB& operator-= (const hgeColorRGB &c) { r-=c.r; g-=c.g; b-=c.b; a-=c.a; return *this; } - hgeColorRGB& operator+= (const hgeColorRGB &c) { r+=c.r; g+=c.g; b+=c.b; a+=c.a; return *this; } - bool operator== (const hgeColorRGB &c) const { return (r==c.r && g==c.g && b==c.b && a==c.a); } - bool operator!= (const hgeColorRGB &c) const { return (r!=c.r || g!=c.g || b!=c.b || a!=c.a); } - - hgeColorRGB operator/ (const float scalar) const { return hgeColorRGB(r/scalar, g/scalar, b/scalar, a/scalar); } - hgeColorRGB operator* (const float scalar) const { return hgeColorRGB(r*scalar, g*scalar, b*scalar, a*scalar); } - hgeColorRGB& operator*= (const float scalar) { r*=scalar; g*=scalar; b*=scalar; a*=scalar; return *this; } - - void Clamp() { ColorClamp(r); ColorClamp(g); ColorClamp(b); ColorClamp(a); } - void SetHWColor(DWORD col) { a = (col>>24)/255.0f; r = ((col>>16) & 0xFF)/255.0f; g = ((col>>8) & 0xFF)/255.0f; b = (col & 0xFF)/255.0f; } - DWORD GetHWColor() const { return ARGB(((int)(a*255.0f)), ((int)(r*255.0f)), ((int)(g*255.0f)), ((int)(b*255.0f))); } -}; - -inline hgeColorRGB operator* (const float sc, const hgeColorRGB &c) { return c*sc; } - - -class hgeColorHSV -{ -public: - float h,s,v,a; - - hgeColorHSV(float _h, float _s, float _v, float _a) { h=_h; s=_s; v=_v; a=_a; } - hgeColorHSV(DWORD col) { SetHWColor(col); } - hgeColorHSV() { h=s=v=a=0; } - - hgeColorHSV operator- (const hgeColorHSV &c) const { return hgeColorHSV(h-c.h, s-c.s, v-c.v, a-c.a); } - hgeColorHSV operator+ (const hgeColorHSV &c) const { return hgeColorHSV(h+c.h, s+c.s, v+c.v, a+c.a); } - hgeColorHSV operator* (const hgeColorHSV &c) const { return hgeColorHSV(h*c.h, s*c.s, v*c.v, a*c.a); } - hgeColorHSV& operator-= (const hgeColorHSV &c) { h-=c.h; s-=c.s; v-=c.v; a-=c.a; return *this; } - hgeColorHSV& operator+= (const hgeColorHSV &c) { h+=c.h; s+=c.s; v+=c.v; a+=c.a; return *this; } - bool operator== (const hgeColorHSV &c) const { return (h==c.h && s==c.s && v==c.v && a==c.a); } - bool operator!= (const hgeColorHSV &c) const { return (h!=c.h || s!=c.s || v!=c.v || a!=c.a); } - - hgeColorHSV operator/ (const float scalar) const { return hgeColorHSV(h/scalar, s/scalar, v/scalar, a/scalar); } - hgeColorHSV operator* (const float scalar) const { return hgeColorHSV(h*scalar, s*scalar, v*scalar, a*scalar); } - hgeColorHSV& operator*= (const float scalar) { h*=scalar; s*=scalar; v*=scalar; a*=scalar; return *this; } - - void Clamp() { ColorClamp(h); ColorClamp(s); ColorClamp(v); ColorClamp(a); } - void SetHWColor(DWORD col); - DWORD GetHWColor() const; -}; - -inline hgeColorHSV operator* (const float sc, const hgeColorHSV &c) { return c*sc; } - - -#endif +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** hgeColor*** helper classes +*/ + + +#ifndef HGECOLOR_H +#define HGECOLOR_H + + +//#include "hge.h" + +#include "../JTypes.h" + +#define hgeColor hgeColorRGB + +inline void ColorClamp(float &x) { if(x<0.0f) x=0.0f; if(x>1.0f) x=1.0f; } + + +class hgeColorRGB +{ +public: + float r,g,b,a; + + hgeColorRGB(float _r, float _g, float _b, float _a) { r=_r; g=_g; b=_b; a=_a; } + hgeColorRGB(DWORD col) { SetHWColor(col); } + hgeColorRGB() { r=g=b=a=0; } + + hgeColorRGB operator- (const hgeColorRGB &c) const { return hgeColorRGB(r-c.r, g-c.g, b-c.b, a-c.a); } + hgeColorRGB operator+ (const hgeColorRGB &c) const { return hgeColorRGB(r+c.r, g+c.g, b+c.b, a+c.a); } + hgeColorRGB operator* (const hgeColorRGB &c) const { return hgeColorRGB(r*c.r, g*c.g, b*c.b, a*c.a); } + hgeColorRGB& operator-= (const hgeColorRGB &c) { r-=c.r; g-=c.g; b-=c.b; a-=c.a; return *this; } + hgeColorRGB& operator+= (const hgeColorRGB &c) { r+=c.r; g+=c.g; b+=c.b; a+=c.a; return *this; } + bool operator== (const hgeColorRGB &c) const { return (r==c.r && g==c.g && b==c.b && a==c.a); } + bool operator!= (const hgeColorRGB &c) const { return (r!=c.r || g!=c.g || b!=c.b || a!=c.a); } + + hgeColorRGB operator/ (const float scalar) const { return hgeColorRGB(r/scalar, g/scalar, b/scalar, a/scalar); } + hgeColorRGB operator* (const float scalar) const { return hgeColorRGB(r*scalar, g*scalar, b*scalar, a*scalar); } + hgeColorRGB& operator*= (const float scalar) { r*=scalar; g*=scalar; b*=scalar; a*=scalar; return *this; } + + void Clamp() { ColorClamp(r); ColorClamp(g); ColorClamp(b); ColorClamp(a); } + void SetHWColor(DWORD col) { a = (col>>24)/255.0f; r = ((col>>16) & 0xFF)/255.0f; g = ((col>>8) & 0xFF)/255.0f; b = (col & 0xFF)/255.0f; } + DWORD GetHWColor() const { return ARGB(((int)(a*255.0f)), ((int)(r*255.0f)), ((int)(g*255.0f)), ((int)(b*255.0f))); } +}; + +inline hgeColorRGB operator* (const float sc, const hgeColorRGB &c) { return c*sc; } + + +class hgeColorHSV +{ +public: + float h,s,v,a; + + hgeColorHSV(float _h, float _s, float _v, float _a) { h=_h; s=_s; v=_v; a=_a; } + hgeColorHSV(DWORD col) { SetHWColor(col); } + hgeColorHSV() { h=s=v=a=0; } + + hgeColorHSV operator- (const hgeColorHSV &c) const { return hgeColorHSV(h-c.h, s-c.s, v-c.v, a-c.a); } + hgeColorHSV operator+ (const hgeColorHSV &c) const { return hgeColorHSV(h+c.h, s+c.s, v+c.v, a+c.a); } + hgeColorHSV operator* (const hgeColorHSV &c) const { return hgeColorHSV(h*c.h, s*c.s, v*c.v, a*c.a); } + hgeColorHSV& operator-= (const hgeColorHSV &c) { h-=c.h; s-=c.s; v-=c.v; a-=c.a; return *this; } + hgeColorHSV& operator+= (const hgeColorHSV &c) { h+=c.h; s+=c.s; v+=c.v; a+=c.a; return *this; } + bool operator== (const hgeColorHSV &c) const { return (h==c.h && s==c.s && v==c.v && a==c.a); } + bool operator!= (const hgeColorHSV &c) const { return (h!=c.h || s!=c.s || v!=c.v || a!=c.a); } + + hgeColorHSV operator/ (const float scalar) const { return hgeColorHSV(h/scalar, s/scalar, v/scalar, a/scalar); } + hgeColorHSV operator* (const float scalar) const { return hgeColorHSV(h*scalar, s*scalar, v*scalar, a*scalar); } + hgeColorHSV& operator*= (const float scalar) { h*=scalar; s*=scalar; v*=scalar; a*=scalar; return *this; } + + void Clamp() { ColorClamp(h); ColorClamp(s); ColorClamp(v); ColorClamp(a); } + void SetHWColor(DWORD col); + DWORD GetHWColor() const; +}; + +inline hgeColorHSV operator* (const float sc, const hgeColorHSV &c) { return c*sc; } + + +#endif diff --git a/JGE/include/hge/hgedistort.h b/JGE/include/hge/hgedistort.h index 119211879..0dc70a011 100644 --- a/JGE/include/hge/hgedistort.h +++ b/JGE/include/hge/hgedistort.h @@ -1,70 +1,70 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeDistortionMesh helper class header -*/ - - -#ifndef HGEDISTORT_H -#define HGEDISTORT_H - - -//#include "hge.h" -#include "../JTypes.h" - - -#define HGEDISP_NODE 0 -#define HGEDISP_TOPLEFT 1 -#define HGEDISP_CENTER 2 - -class JTexture; -class JQuad; - -/* -** HGE Distortion mesh class -*/ -class hgeDistortionMesh -{ -public: - hgeDistortionMesh(int cols, int rows); - hgeDistortionMesh(const hgeDistortionMesh &dm); - ~hgeDistortionMesh(); - - hgeDistortionMesh& operator= (const hgeDistortionMesh &dm); - - void Render(float x, float y); - void Clear(PIXEL_TYPE col=ARGB(0xFF,0xFF,0xFF,0xFF), float z=0.5f); - - void SetTexture(JTexture* tex); - void SetTextureRect(float x, float y, float w, float h); - void SetBlendMode(int blend); - void SetZ(int col, int row, float z); - void SetColor(int col, int row, PIXEL_TYPE color); - void SetDisplacement(int col, int row, float dx, float dy, int ref); - - JTexture* GetTexture() const {return quad->mTex;} - void GetTextureRect(float *x, float *y, float *w, float *h) const { *x=tx; *y=ty; *w=width; *h=height; } - int GetBlendMode() const { return 0; } - float GetZ(int col, int row) const; - PIXEL_TYPE GetColor(int col, int row) const; - void GetDisplacement(int col, int row, float *dx, float *dy, int ref) const; - - int GetRows() { return nRows; } - int GetCols() { return nCols; } - -private: - hgeDistortionMesh(); - - //static HGE *hge; - - Vertex *disp_array; - int nRows, nCols; - float cellw,cellh; - float tx,ty,width,height; - JQuad* quad; -}; - - -#endif +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** hgeDistortionMesh helper class header +*/ + + +#ifndef HGEDISTORT_H +#define HGEDISTORT_H + + +//#include "hge.h" +#include "../JTypes.h" + + +#define HGEDISP_NODE 0 +#define HGEDISP_TOPLEFT 1 +#define HGEDISP_CENTER 2 + +class JTexture; +class JQuad; + +/* +** HGE Distortion mesh class +*/ +class hgeDistortionMesh +{ +public: + hgeDistortionMesh(int cols, int rows); + hgeDistortionMesh(const hgeDistortionMesh &dm); + ~hgeDistortionMesh(); + + hgeDistortionMesh& operator= (const hgeDistortionMesh &dm); + + void Render(float x, float y); + void Clear(PIXEL_TYPE col=ARGB(0xFF,0xFF,0xFF,0xFF), float z=0.5f); + + void SetTexture(JTexture* tex); + void SetTextureRect(float x, float y, float w, float h); + void SetBlendMode(int blend); + void SetZ(int col, int row, float z); + void SetColor(int col, int row, PIXEL_TYPE color); + void SetDisplacement(int col, int row, float dx, float dy, int ref); + + JTexture* GetTexture() const {return quad->mTex;} + void GetTextureRect(float *x, float *y, float *w, float *h) const { *x=tx; *y=ty; *w=width; *h=height; } + int GetBlendMode() const { return 0; } + float GetZ(int col, int row) const; + PIXEL_TYPE GetColor(int col, int row) const; + void GetDisplacement(int col, int row, float *dx, float *dy, int ref) const; + + int GetRows() { return nRows; } + int GetCols() { return nCols; } + +private: + hgeDistortionMesh(); + + //static HGE *hge; + + Vertex *disp_array; + int nRows, nCols; + float cellw,cellh; + float tx,ty,width,height; + JQuad* quad; +}; + + +#endif diff --git a/JGE/include/hge/hgefont.h b/JGE/include/hge/hgefont.h index 6b8764a1b..346a1098f 100644 --- a/JGE/include/hge/hgefont.h +++ b/JGE/include/hge/hgefont.h @@ -1,93 +1,93 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeFont helper class header -*/ - - -#ifndef HGEFONT_H -#define HGEFONT_H - -#include "../JTypes.h" -//#include "hge.h" -//#include "hgesprite.h" - - -#define HGETEXT_LEFT 0 -#define HGETEXT_RIGHT 1 -#define HGETEXT_CENTER 2 -#define HGETEXT_HORZMASK 0x03 - -#define HGETEXT_TOP 0 -#define HGETEXT_BOTTOM 4 -#define HGETEXT_MIDDLE 8 -#define HGETEXT_VERTMASK 0x0C - -class JTexture; -class JQuad; -/* -** HGE Font class -*/ -class hgeFont -{ -public: - hgeFont(const char *filename, bool bMipmap=false); - ~hgeFont(); - - void Render(float x, float y, int align, const char *string); - void printf(float x, float y, int align, const char *format, ...); - void printfb(float x, float y, float w, float h, int align, const char *format, ...); - - void SetColor(PIXEL_TYPE col); - void SetZ(float z); - void SetBlendMode(int blend); - void SetScale(float scale) {fScale=scale;} - void SetProportion(float prop) { fProportion=prop; } - void SetRotation(float rot) {fRot=rot;} - void SetTracking(float tracking) {fTracking=tracking;} - void SetSpacing(float spacing) {fSpacing=spacing;} - - PIXEL_TYPE GetColor() const {return dwCol;} - float GetZ() const {return fZ;} - int GetBlendMode() const {return nBlend;} - float GetScale() const {return fScale;} - float GetProportion() const { return fProportion; } - float GetRotation() const {return fRot;} - float GetTracking() const {return fTracking;} - float GetSpacing() const {return fSpacing;} - - JQuad* GetSprite(char chr) const { return letters[(unsigned char)chr]; } - float GetHeight() const { return fHeight; } - float GetStringWidth(const char *string) const; - -private: - hgeFont(); - hgeFont(const hgeFont &fnt); - hgeFont& operator= (const hgeFont &fnt); - - char* _get_line(char *file, char *line); - - //static HGE *hge; - - static char buffer[256]; - - JTexture* hTexture; - JQuad* letters[256]; - float pre[256]; - float post[256]; - float fHeight; - float fScale; - float fProportion; - float fRot; - float fTracking; - float fSpacing; - - PIXEL_TYPE dwCol; - float fZ; - int nBlend; -}; - - -#endif +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** hgeFont helper class header +*/ + + +#ifndef HGEFONT_H +#define HGEFONT_H + +#include "../JTypes.h" +//#include "hge.h" +//#include "hgesprite.h" + + +#define HGETEXT_LEFT 0 +#define HGETEXT_RIGHT 1 +#define HGETEXT_CENTER 2 +#define HGETEXT_HORZMASK 0x03 + +#define HGETEXT_TOP 0 +#define HGETEXT_BOTTOM 4 +#define HGETEXT_MIDDLE 8 +#define HGETEXT_VERTMASK 0x0C + +class JTexture; +class JQuad; +/* +** HGE Font class +*/ +class hgeFont +{ +public: + hgeFont(const char *filename, bool bMipmap=false); + ~hgeFont(); + + void Render(float x, float y, int align, const char *string); + void printf(float x, float y, int align, const char *format, ...); + void printfb(float x, float y, float w, float h, int align, const char *format, ...); + + void SetColor(PIXEL_TYPE col); + void SetZ(float z); + void SetBlendMode(int blend); + void SetScale(float scale) {fScale=scale;} + void SetProportion(float prop) { fProportion=prop; } + void SetRotation(float rot) {fRot=rot;} + void SetTracking(float tracking) {fTracking=tracking;} + void SetSpacing(float spacing) {fSpacing=spacing;} + + PIXEL_TYPE GetColor() const {return dwCol;} + float GetZ() const {return fZ;} + int GetBlendMode() const {return nBlend;} + float GetScale() const {return fScale;} + float GetProportion() const { return fProportion; } + float GetRotation() const {return fRot;} + float GetTracking() const {return fTracking;} + float GetSpacing() const {return fSpacing;} + + JQuad* GetSprite(char chr) const { return letters[(unsigned char)chr]; } + float GetHeight() const { return fHeight; } + float GetStringWidth(const char *string) const; + +private: + hgeFont(); + hgeFont(const hgeFont &fnt); + hgeFont& operator= (const hgeFont &fnt); + + char* _get_line(char *file, char *line); + + //static HGE *hge; + + static char buffer[256]; + + JTexture* hTexture; + JQuad* letters[256]; + float pre[256]; + float post[256]; + float fHeight; + float fScale; + float fProportion; + float fRot; + float fTracking; + float fSpacing; + + PIXEL_TYPE dwCol; + float fZ; + int nBlend; +}; + + +#endif diff --git a/JGE/include/hge/hgeparticle.h b/JGE/include/hge/hgeparticle.h index eaa63d9d8..b2a4094d8 100644 --- a/JGE/include/hge/hgeparticle.h +++ b/JGE/include/hge/hgeparticle.h @@ -1,165 +1,165 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeParticleSystem helper class header -*/ - - -#ifndef HGEPARTICLE_H -#define HGEPARTICLE_H - - -//#include "hge.h" -//#include "hgesprite.h" -#include "hgevector.h" -#include "hgecolor.h" -#include "hgerect.h" - -#include - -class JQuad; - -#define MAX_PARTICLES 500 -#define MAX_PSYSTEMS 100 - -struct hgeParticle -{ - hgeVector vecLocation; - hgeVector vecVelocity; - - float fGravity; - float fRadialAccel; - float fTangentialAccel; - - float fSpin; - float fSpinDelta; - - float fSize; - float fSizeDelta; - - hgeColor colColor; // + alpha - hgeColor colColorDelta; - - float fAge; - float fTerminalAge; -}; - -struct hgeParticleSystemInfo -{ - JQuad* sprite; // texture + blend mode - int nEmission; // particles per sec - float fLifetime; - - float fParticleLifeMin; - float fParticleLifeMax; - - float fDirection; - float fSpread; - bool bRelative; - - float fSpeedMin; - float fSpeedMax; - - float fGravityMin; - float fGravityMax; - - float fRadialAccelMin; - float fRadialAccelMax; - - float fTangentialAccelMin; - float fTangentialAccelMax; - - float fSizeStart; - float fSizeEnd; - float fSizeVar; - - float fSpinStart; - float fSpinEnd; - float fSpinVar; - - hgeColor colColorStart; // + alpha - hgeColor colColorEnd; - float fColorVar; - float fAlphaVar; -}; - -class hgeParticleSystem -{ -public: - hgeParticleSystemInfo info; - - hgeParticleSystem(const char *filename, JQuad *sprite); - hgeParticleSystem(hgeParticleSystemInfo *psi); - hgeParticleSystem(const hgeParticleSystem &ps); - ~hgeParticleSystem() { } - - hgeParticleSystem& operator= (const hgeParticleSystem &ps); - - - void Render(); - void FireAt(float x, float y); - void Fire(); - void Stop(bool bKillParticles=false); - void Update(float fDeltaTime); - void MoveTo(float x, float y, bool bMoveParticles=false); - void Transpose(float x, float y) { fTx=x; fTy=y; } - void TrackBoundingBox(bool bTrack) { bUpdateBoundingBox=bTrack; } - - int GetParticlesAlive() const { return nParticlesAlive; } - float GetAge() const { return fAge; } - void GetPosition(float *x, float *y) const { *x=vecLocation.x; *y=vecLocation.y; } - void GetTransposition(float *x, float *y) const { *x=fTx; *y=fTy; } - hgeRect* GetBoundingBox(hgeRect *rect) const { memcpy(rect, &rectBoundingBox, sizeof(hgeRect)); return rect; } - -private: - hgeParticleSystem(); - - //static HGE *hge; - - float fAge; - float fEmissionResidue; - - hgeVector vecPrevLocation; - hgeVector vecLocation; - float fTx, fTy; - - int nParticlesAlive; - hgeRect rectBoundingBox; - bool bUpdateBoundingBox; - - typedef std::list ParticleBuffer; - ParticleBuffer mParticleBuffer; - - float mTimer; -}; - -class hgeParticleManager -{ -public: - hgeParticleManager(); - ~hgeParticleManager(); - - void Update(float dt); - void Render(); - - hgeParticleSystem* SpawnPS(hgeParticleSystemInfo *psi, float x, float y); - bool IsPSAlive(hgeParticleSystem *ps) const; - void Transpose(float x, float y); - void GetTransposition(float *dx, float *dy) const {*dx=tX; *dy=tY;} - void KillPS(hgeParticleSystem *ps); - void KillAll(); - -private: - hgeParticleManager(const hgeParticleManager &); - hgeParticleManager& operator= (const hgeParticleManager &); - - int nPS; - float tX; - float tY; - hgeParticleSystem* psList[MAX_PSYSTEMS]; -}; - - -#endif +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** hgeParticleSystem helper class header +*/ + + +#ifndef HGEPARTICLE_H +#define HGEPARTICLE_H + + +//#include "hge.h" +//#include "hgesprite.h" +#include "hgevector.h" +#include "hgecolor.h" +#include "hgerect.h" + +#include + +class JQuad; + +#define MAX_PARTICLES 500 +#define MAX_PSYSTEMS 100 + +struct hgeParticle +{ + hgeVector vecLocation; + hgeVector vecVelocity; + + float fGravity; + float fRadialAccel; + float fTangentialAccel; + + float fSpin; + float fSpinDelta; + + float fSize; + float fSizeDelta; + + hgeColor colColor; // + alpha + hgeColor colColorDelta; + + float fAge; + float fTerminalAge; +}; + +struct hgeParticleSystemInfo +{ + JQuad* sprite; // texture + blend mode + int nEmission; // particles per sec + float fLifetime; + + float fParticleLifeMin; + float fParticleLifeMax; + + float fDirection; + float fSpread; + bool bRelative; + + float fSpeedMin; + float fSpeedMax; + + float fGravityMin; + float fGravityMax; + + float fRadialAccelMin; + float fRadialAccelMax; + + float fTangentialAccelMin; + float fTangentialAccelMax; + + float fSizeStart; + float fSizeEnd; + float fSizeVar; + + float fSpinStart; + float fSpinEnd; + float fSpinVar; + + hgeColor colColorStart; // + alpha + hgeColor colColorEnd; + float fColorVar; + float fAlphaVar; +}; + +class hgeParticleSystem +{ +public: + hgeParticleSystemInfo info; + + hgeParticleSystem(const char *filename, JQuad *sprite); + hgeParticleSystem(hgeParticleSystemInfo *psi); + hgeParticleSystem(const hgeParticleSystem &ps); + ~hgeParticleSystem() { } + + hgeParticleSystem& operator= (const hgeParticleSystem &ps); + + + void Render(); + void FireAt(float x, float y); + void Fire(); + void Stop(bool bKillParticles=false); + void Update(float fDeltaTime); + void MoveTo(float x, float y, bool bMoveParticles=false); + void Transpose(float x, float y) { fTx=x; fTy=y; } + void TrackBoundingBox(bool bTrack) { bUpdateBoundingBox=bTrack; } + + int GetParticlesAlive() const { return nParticlesAlive; } + float GetAge() const { return fAge; } + void GetPosition(float *x, float *y) const { *x=vecLocation.x; *y=vecLocation.y; } + void GetTransposition(float *x, float *y) const { *x=fTx; *y=fTy; } + hgeRect* GetBoundingBox(hgeRect *rect) const { memcpy(rect, &rectBoundingBox, sizeof(hgeRect)); return rect; } + +private: + hgeParticleSystem(); + + //static HGE *hge; + + float fAge; + float fEmissionResidue; + + hgeVector vecPrevLocation; + hgeVector vecLocation; + float fTx, fTy; + + int nParticlesAlive; + hgeRect rectBoundingBox; + bool bUpdateBoundingBox; + + typedef std::list ParticleBuffer; + ParticleBuffer mParticleBuffer; + + float mTimer; +}; + +class hgeParticleManager +{ +public: + hgeParticleManager(); + ~hgeParticleManager(); + + void Update(float dt); + void Render(); + + hgeParticleSystem* SpawnPS(hgeParticleSystemInfo *psi, float x, float y); + bool IsPSAlive(hgeParticleSystem *ps) const; + void Transpose(float x, float y); + void GetTransposition(float *dx, float *dy) const {*dx=tX; *dy=tY;} + void KillPS(hgeParticleSystem *ps); + void KillAll(); + +private: + hgeParticleManager(const hgeParticleManager &); + hgeParticleManager& operator= (const hgeParticleManager &); + + int nPS; + float tX; + float tY; + hgeParticleSystem* psList[MAX_PSYSTEMS]; +}; + + +#endif diff --git a/JGE/include/hge/hgerect.h b/JGE/include/hge/hgerect.h index cf5ff0f32..9e2690751 100644 --- a/JGE/include/hge/hgerect.h +++ b/JGE/include/hge/hgerect.h @@ -1,35 +1,35 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeRect helper class -*/ - - -#ifndef HGERECT_H -#define HGERECT_H - - -class hgeRect -{ -public: - float x1, y1, x2, y2; - - hgeRect(float _x1, float _y1, float _x2, float _y2) {x1=_x1; y1=_y1; x2=_x2; y2=_y2; bClean=false; } - hgeRect() {bClean=true;} - - void Clear() {bClean=true;} - bool IsClean() const {return bClean;} - void Set(float _x1, float _y1, float _x2, float _y2) { x1=_x1; x2=_x2; y1=_y1; y2=_y2; bClean=false; } - void SetRadius(float x, float y, float r) { x1=x-r; x2=x+r; y1=y-r; y2=y+r; bClean=false; } - void Encapsulate(float x, float y); - bool TestPoint(float x, float y) const; - bool Intersect(const hgeRect *rect) const; - -private: - bool bClean; -}; - - -#endif +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** hgeRect helper class +*/ + + +#ifndef HGERECT_H +#define HGERECT_H + + +class hgeRect +{ +public: + float x1, y1, x2, y2; + + hgeRect(float _x1, float _y1, float _x2, float _y2) {x1=_x1; y1=_y1; x2=_x2; y2=_y2; bClean=false; } + hgeRect() {bClean=true;} + + void Clear() {bClean=true;} + bool IsClean() const {return bClean;} + void Set(float _x1, float _y1, float _x2, float _y2) { x1=_x1; x2=_x2; y1=_y1; y2=_y2; bClean=false; } + void SetRadius(float x, float y, float r) { x1=x-r; x2=x+r; y1=y-r; y2=y+r; bClean=false; } + void Encapsulate(float x, float y); + bool TestPoint(float x, float y) const; + bool Intersect(const hgeRect *rect) const; + +private: + bool bClean; +}; + + +#endif diff --git a/JGE/include/hge/hgevector.h b/JGE/include/hge/hgevector.h index f2bf132e1..12af53d85 100644 --- a/JGE/include/hge/hgevector.h +++ b/JGE/include/hge/hgevector.h @@ -1,57 +1,57 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeVector helper class -*/ - - -#ifndef HGEVECTOR_H -#define HGEVECTOR_H - - -//#include "hge.h" -#include - - -/* -** Fast 1.0/sqrtf(float) routine -*/ -float InvSqrt(float x); - -class hgeVector -{ -public: - float x,y; - - hgeVector(float _x, float _y) { x=_x; y=_y; } - hgeVector() { x=0; y=0; } - - hgeVector operator- () const { return hgeVector(-x, -y); } - hgeVector operator- (const hgeVector &v) const { return hgeVector(x-v.x, y-v.y); } - hgeVector operator+ (const hgeVector &v) const { return hgeVector(x+v.x, y+v.y); } - hgeVector& operator-= (const hgeVector &v) { x-=v.x; y-=v.y; return *this; } - hgeVector& operator+= (const hgeVector &v) { x+=v.x; y+=v.y; return *this; } - bool operator== (const hgeVector &v) const { return (x==v.x && y==v.y); } - bool operator!= (const hgeVector &v) const { return (x!=v.x || y!=v.y); } - - hgeVector operator/ (const float scalar) const { return hgeVector(x/scalar, y/scalar); } - hgeVector operator* (const float scalar) const { return hgeVector(x*scalar, y*scalar); } - hgeVector& operator*= (const float scalar) { x*=scalar; y*=scalar; return *this; } - - float Dot(const hgeVector *v) const { return x*v->x + y*v->y; } - float Length() const { return sqrtf(Dot(this)); } - float Angle(const hgeVector *v = 0) const; - - void Clamp(const float max) { if(Length() > max) { Normalize(); x *= max; y *= max; } } - hgeVector* Normalize() { float rc=InvSqrt(Dot(this)); x*=rc; y*=rc; return this; } - hgeVector* Rotate(float a); -}; - -inline hgeVector operator* (const float s, const hgeVector &v) { return v*s; } -inline float operator^ (const hgeVector &v, const hgeVector &u) { return v.Angle(&u); } -inline float operator% (const hgeVector &v, const hgeVector &u) { return v.Dot(&u); } - - -#endif +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** hgeVector helper class +*/ + + +#ifndef HGEVECTOR_H +#define HGEVECTOR_H + + +//#include "hge.h" +#include + + +/* +** Fast 1.0/sqrtf(float) routine +*/ +float InvSqrt(float x); + +class hgeVector +{ +public: + float x,y; + + hgeVector(float _x, float _y) { x=_x; y=_y; } + hgeVector() { x=0; y=0; } + + hgeVector operator- () const { return hgeVector(-x, -y); } + hgeVector operator- (const hgeVector &v) const { return hgeVector(x-v.x, y-v.y); } + hgeVector operator+ (const hgeVector &v) const { return hgeVector(x+v.x, y+v.y); } + hgeVector& operator-= (const hgeVector &v) { x-=v.x; y-=v.y; return *this; } + hgeVector& operator+= (const hgeVector &v) { x+=v.x; y+=v.y; return *this; } + bool operator== (const hgeVector &v) const { return (x==v.x && y==v.y); } + bool operator!= (const hgeVector &v) const { return (x!=v.x || y!=v.y); } + + hgeVector operator/ (const float scalar) const { return hgeVector(x/scalar, y/scalar); } + hgeVector operator* (const float scalar) const { return hgeVector(x*scalar, y*scalar); } + hgeVector& operator*= (const float scalar) { x*=scalar; y*=scalar; return *this; } + + float Dot(const hgeVector *v) const { return x*v->x + y*v->y; } + float Length() const { return sqrtf(Dot(this)); } + float Angle(const hgeVector *v = 0) const; + + void Clamp(const float max) { if(Length() > max) { Normalize(); x *= max; y *= max; } } + hgeVector* Normalize() { float rc=InvSqrt(Dot(this)); x*=rc; y*=rc; return this; } + hgeVector* Rotate(float a); +}; + +inline hgeVector operator* (const float s, const hgeVector &v) { return v*s; } +inline float operator^ (const hgeVector &v, const hgeVector &u) { return v.Angle(&u); } +inline float operator% (const hgeVector &v, const hgeVector &u) { return v.Dot(&u); } + + +#endif diff --git a/JGE/include/unzip/crypt.h b/JGE/include/unzip/crypt.h index f14a628b4..622f4bc2e 100644 --- a/JGE/include/unzip/crypt.h +++ b/JGE/include/unzip/crypt.h @@ -1,132 +1,132 @@ -/* crypt.h -- base code for crypt/uncrypt ZIPfile - - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This code is a modified version of crypting code in Infozip distribution - - The encryption/decryption parts of this source code (as opposed to the - non-echoing password parts) were originally written in Europe. The - whole source package can be freely distributed, including from the USA. - (Prior to January 2000, re-export from the US was a violation of US law.) - - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - - If you don't need crypting in your application, just define symbols - NOCRYPT and NOUNCRYPT. - - This code support the "Traditional PKWARE Encryption". - - The new AES encryption added on Zip format by Winzip (see the page - http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong - Encryption is not supported. -*/ - -#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) - -/*********************************************************************** - * Return the next byte in the pseudo-random sequence - */ -static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) -{ - unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an - * unpredictable manner on 16-bit systems; not a problem - * with any known compiler so far, though */ - - temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; - return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); -} - -/*********************************************************************** - * Update the encryption keys with the next byte of plain text - */ -static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) -{ - (*(pkeys+0)) = CRC32((*(pkeys+0)), c); - (*(pkeys+1)) += (*(pkeys+0)) & 0xff; - (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; - { - register int keyshift = (int)((*(pkeys+1)) >> 24); - (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); - } - return c; -} - - -/*********************************************************************** - * Initialize the encryption keys and the random header according to - * the given password. - */ -static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) -{ - *(pkeys+0) = 305419896L; - *(pkeys+1) = 591751049L; - *(pkeys+2) = 878082192L; - while (*passwd != '\0') { - update_keys(pkeys,pcrc_32_tab,(int)*passwd); - passwd++; - } -} - -#define zdecode(pkeys,pcrc_32_tab,c) \ - (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) - -#define zencode(pkeys,pcrc_32_tab,c,t) \ - (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) - -#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED - -#define RAND_HEAD_LEN 12 - /* "last resort" source for second part of crypt seed pattern */ -# ifndef ZCR_SEED2 -# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ -# endif - -static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) - const char *passwd; /* password string */ - unsigned char *buf; /* where to write header */ - int bufSize; - unsigned long* pkeys; - const unsigned long* pcrc_32_tab; - unsigned long crcForCrypting; -{ - int n; /* index in random header */ - int t; /* temporary */ - int c; /* random byte */ - unsigned char header[RAND_HEAD_LEN-2]; /* random header */ - static unsigned calls = 0; /* ensure different random header each time */ - - if (bufSize> 7) & 0xff; - header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); - } - /* Encrypt random header (last two bytes is high word of crc) */ - init_keys(passwd, pkeys, pcrc_32_tab); - for (n = 0; n < RAND_HEAD_LEN-2; n++) - { - buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); - } - buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); - buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); - return n; -} - -#endif +/* crypt.h -- base code for crypt/uncrypt ZIPfile + + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This code is a modified version of crypting code in Infozip distribution + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + + If you don't need crypting in your application, just define symbols + NOCRYPT and NOUNCRYPT. + + This code support the "Traditional PKWARE Encryption". + + The new AES encryption added on Zip format by Winzip (see the page + http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong + Encryption is not supported. +*/ + +#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) + +/*********************************************************************** + * Return the next byte in the pseudo-random sequence + */ +static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) +{ + unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an + * unpredictable manner on 16-bit systems; not a problem + * with any known compiler so far, though */ + + temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; + return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); +} + +/*********************************************************************** + * Update the encryption keys with the next byte of plain text + */ +static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) +{ + (*(pkeys+0)) = CRC32((*(pkeys+0)), c); + (*(pkeys+1)) += (*(pkeys+0)) & 0xff; + (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; + { + register int keyshift = (int)((*(pkeys+1)) >> 24); + (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); + } + return c; +} + + +/*********************************************************************** + * Initialize the encryption keys and the random header according to + * the given password. + */ +static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) +{ + *(pkeys+0) = 305419896L; + *(pkeys+1) = 591751049L; + *(pkeys+2) = 878082192L; + while (*passwd != '\0') { + update_keys(pkeys,pcrc_32_tab,(int)*passwd); + passwd++; + } +} + +#define zdecode(pkeys,pcrc_32_tab,c) \ + (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) + +#define zencode(pkeys,pcrc_32_tab,c,t) \ + (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) + +#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED + +#define RAND_HEAD_LEN 12 + /* "last resort" source for second part of crypt seed pattern */ +# ifndef ZCR_SEED2 +# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ +# endif + +static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) + const char *passwd; /* password string */ + unsigned char *buf; /* where to write header */ + int bufSize; + unsigned long* pkeys; + const unsigned long* pcrc_32_tab; + unsigned long crcForCrypting; +{ + int n; /* index in random header */ + int t; /* temporary */ + int c; /* random byte */ + unsigned char header[RAND_HEAD_LEN-2]; /* random header */ + static unsigned calls = 0; /* ensure different random header each time */ + + if (bufSize> 7) & 0xff; + header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); + } + /* Encrypt random header (last two bytes is high word of crc) */ + init_keys(passwd, pkeys, pcrc_32_tab); + for (n = 0; n < RAND_HEAD_LEN-2; n++) + { + buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); + } + buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); + buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); + return n; +} + +#endif diff --git a/JGE/include/unzip/ioapi.h b/JGE/include/unzip/ioapi.h index e73a3b2bd..7d457baab 100644 --- a/JGE/include/unzip/ioapi.h +++ b/JGE/include/unzip/ioapi.h @@ -1,75 +1,75 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant -*/ - -#ifndef _ZLIBIOAPI_H -#define _ZLIBIOAPI_H - - -#define ZLIB_FILEFUNC_SEEK_CUR (1) -#define ZLIB_FILEFUNC_SEEK_END (2) -#define ZLIB_FILEFUNC_SEEK_SET (0) - -#define ZLIB_FILEFUNC_MODE_READ (1) -#define ZLIB_FILEFUNC_MODE_WRITE (2) -#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) - -#define ZLIB_FILEFUNC_MODE_EXISTING (4) -#define ZLIB_FILEFUNC_MODE_CREATE (8) - - -#ifndef ZCALLBACK - -#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) -#define ZCALLBACK CALLBACK -#else -#define ZCALLBACK -#endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); -typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); -typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); - -typedef struct zlib_filefunc_def_s -{ - open_file_func zopen_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell_file_func ztell_file; - seek_file_func zseek_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc_def; - - - -void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) -#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) -#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) -#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) -#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) -#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) - - -#ifdef __cplusplus -} -#endif - -#endif - +/* ioapi.h -- IO base function header for compress/uncompress .zip + files using zlib + zip or unzip API + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant +*/ + +#ifndef _ZLIBIOAPI_H +#define _ZLIBIOAPI_H + + +#define ZLIB_FILEFUNC_SEEK_CUR (1) +#define ZLIB_FILEFUNC_SEEK_END (2) +#define ZLIB_FILEFUNC_SEEK_SET (0) + +#define ZLIB_FILEFUNC_MODE_READ (1) +#define ZLIB_FILEFUNC_MODE_WRITE (2) +#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) + +#define ZLIB_FILEFUNC_MODE_EXISTING (4) +#define ZLIB_FILEFUNC_MODE_CREATE (8) + + +#ifndef ZCALLBACK + +#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) +#define ZCALLBACK CALLBACK +#else +#define ZCALLBACK +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); +typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); +typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); +typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); +typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); + +typedef struct zlib_filefunc_def_s +{ + open_file_func zopen_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell_file_func ztell_file; + seek_file_func zseek_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc_def; + + + +void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + +#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) +#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) +#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) +#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) +#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) +#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) + + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/JGE/include/unzip/iowin32.h b/JGE/include/unzip/iowin32.h index e9c5f8b90..a3a437adf 100644 --- a/JGE/include/unzip/iowin32.h +++ b/JGE/include/unzip/iowin32.h @@ -1,21 +1,21 @@ -/* iowin32.h -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - This IO API version uses the Win32 API (for Microsoft Windows) - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant -*/ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -#ifdef __cplusplus -} -#endif +/* iowin32.h -- IO base function header for compress/uncompress .zip + files using zlib + zip or unzip API + This IO API version uses the Win32 API (for Microsoft Windows) + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant +*/ + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + +#ifdef __cplusplus +} +#endif diff --git a/JGE/include/unzip/mztools.h b/JGE/include/unzip/mztools.h index 82d1597ad..eee78dc56 100644 --- a/JGE/include/unzip/mztools.h +++ b/JGE/include/unzip/mztools.h @@ -1,31 +1,31 @@ -/* - Additional tools for Minizip - Code: Xavier Roche '2004 - License: Same as ZLIB (www.gzip.org) -*/ - -#ifndef _zip_tools_H -#define _zip_tools_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#include "unzip.h" - -/* Repair a ZIP file (missing central directory) - file: file to recover - fileOut: output file after recovery - fileOutTmp: temporary file name used for recovery -*/ -extern int ZEXPORT unzRepair(const char* file, - const char* fileOut, - const char* fileOutTmp, - uLong* nRecovered, - uLong* bytesRecovered); - -#endif +/* + Additional tools for Minizip + Code: Xavier Roche '2004 + License: Same as ZLIB (www.gzip.org) +*/ + +#ifndef _zip_tools_H +#define _zip_tools_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#include "unzip.h" + +/* Repair a ZIP file (missing central directory) + file: file to recover + fileOut: output file after recovery + fileOutTmp: temporary file name used for recovery +*/ +extern int ZEXPORT unzRepair(const char* file, + const char* fileOut, + const char* fileOutTmp, + uLong* nRecovered, + uLong* bytesRecovered); + +#endif diff --git a/JGE/include/unzip/unzip.h b/JGE/include/unzip/unzip.h index ce78f2047..0e786782a 100644 --- a/JGE/include/unzip/unzip.h +++ b/JGE/include/unzip/unzip.h @@ -1,356 +1,356 @@ -/* unzip.h -- IO for uncompress .zip files using zlib - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g - WinZip, InfoZip tools and compatible. - - Multi volume ZipFile (span) are not supported. - Encryption compatible with pkzip 2.04g only supported - Old compressions used by old PKZip 1.x are not supported - - - I WAIT FEEDBACK at mail info@winimage.com - Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - -*/ - -/* for more info about .ZIP format, see - http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip - http://www.info-zip.org/pub/infozip/doc/ - PkWare has also a specification at : - ftp://ftp.pkware.com/probdesc.zip -*/ - -#ifndef _unz_H -#define _unz_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagunzFile__ { int unused; } unzFile__; -typedef unzFile__ *unzFile; -#else -typedef voidp unzFile; -#endif - - -#define UNZ_OK (0) -#define UNZ_END_OF_LIST_OF_FILE (-100) -#define UNZ_ERRNO (Z_ERRNO) -#define UNZ_EOF (0) -#define UNZ_PARAMERROR (-102) -#define UNZ_BADZIPFILE (-103) -#define UNZ_INTERNALERROR (-104) -#define UNZ_CRCERROR (-105) - - -/* tm_unz contain date/time info */ -typedef struct tm_unz_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_unz; - -/* unz_global_info structure contain global data about the ZIPfile - These data comes from the end of central dir */ -typedef struct unz_global_info_s -{ - uLong number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ -} unz_global_info; - - -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_info_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - uLong compressed_size; /* compressed size 4 bytes */ - uLong uncompressed_size; /* uncompressed size 4 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ - - tm_unz tmu_date; -} unz_file_info; - - -extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, - const char* fileName2, - int iCaseSensitivity)); -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system - (like 1 on Unix, 2 on Windows) -*/ - - -extern unzFile ZEXPORT unzOpen OF((const char *path)); -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer - "zlib/zlib113.zip". - If the zipfile cannot be opened (file don't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ - -extern unzFile ZEXPORT unzOpen2 OF((const char *path, - zlib_filefunc_def* pzlib_filefunc_def)); -/* - Open a Zip file, like unzOpen, but provide a set of file low level API - for read/write the zip file (see ioapi.h) -*/ - -extern int ZEXPORT unzClose OF((unzFile file)); -/* - Close a ZipFile opened with unzipOpen. - If there is files inside the .Zip opened with unzOpenCurrentFile (see later), - these files MUST be closed with unzipCloseCurrentFile before call unzipClose. - return UNZ_OK if there is no problem. */ - -extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, - unz_global_info *pglobal_info)); -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ - - -extern int ZEXPORT unzGetGlobalComment OF((unzFile file, - char *szComment, - uLong uSizeBuf)); -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ - - -/***************************************************************************/ -/* Unzip package allow you browse the directory of the zipfile */ - -extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ - -extern int ZEXPORT unzGoToNextFile OF((unzFile file)); -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ - -extern int ZEXPORT unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ - - -/* ****************************************** */ -/* Ryan supplied functions */ -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; /* offset in zip file directory */ - uLong num_of_file; /* # of file */ -} unz_file_pos; - -extern int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos); - -extern int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos); - -/* ****************************************** */ - -extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, - unz_file_info *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); -/* - Get Info about the current file - if pfile_info!=NULL, the *pfile_info structure will contain somes info about - the current file - if szFileName!=NULL, the filemane string will be copied in szFileName - (fileNameBufferSize is the size of the buffer) - if extraField!=NULL, the extra field information will be copied in extraField - (extraFieldBufferSize is the size of the buffer). - This is the Central-header version of the extra field - if szComment!=NULL, the comment string of the file will be copied in szComment - (commentBufferSize is the size of the buffer) -*/ - -/***************************************************************************/ -/* for reading the content of the current zipfile, you can open it, read data - from it, and close it (you can close it before reading all the file) - */ - -extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); -/* - Open for reading data the current file in the zipfile. - If there is no error, the return value is UNZ_OK. -*/ - -extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, - const char* password)); -/* - Open for reading data the current file in the zipfile. - password is a crypting password - If there is no error, the return value is UNZ_OK. -*/ - -extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, - int* method, - int* level, - int raw)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - -extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, - int* method, - int* level, - int raw, - const char* password)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - - -extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); -/* - Close the file in zip opened with unzOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ - -extern int ZEXPORT unzReadCurrentFile OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read bytes from the current file (opened by unzOpenCurrentFile) - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if somes bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ - -extern z_off_t ZEXPORT unztell OF((unzFile file)); -/* - Give the current position in uncompressed data -*/ - -extern int ZEXPORT unzeof OF((unzFile file)); -/* - return 1 if the end of file was reached, 0 elsewhere -*/ - -extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ - -/***************************************************************************/ - -/* Get the current file offset */ -extern uLong ZEXPORT unzGetOffset (unzFile file); - -/* Set the current file offset */ -extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); - - - -#ifdef __cplusplus -} -#endif - -#endif /* _unz_H */ +/* unzip.h -- IO for uncompress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + + Multi volume ZipFile (span) are not supported. + Encryption compatible with pkzip 2.04g only supported + Old compressions used by old PKZip 1.x are not supported + + + I WAIT FEEDBACK at mail info@winimage.com + Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +*/ + +/* for more info about .ZIP format, see + http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip + http://www.info-zip.org/pub/infozip/doc/ + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip +*/ + +#ifndef _unz_H +#define _unz_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef voidp unzFile; +#endif + + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info_s +{ + uLong number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + + +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_info_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + uLong compressed_size; /* compressed size 4 bytes */ + uLong uncompressed_size; /* uncompressed size 4 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info; + + +extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, + const char* fileName2, + int iCaseSensitivity)); +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) +*/ + + +extern unzFile ZEXPORT unzOpen OF((const char *path)); +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer + "zlib/zlib113.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ + +extern unzFile ZEXPORT unzOpen2 OF((const char *path, + zlib_filefunc_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unzOpen, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +extern int ZEXPORT unzClose OF((unzFile file)); +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, + unz_global_info *pglobal_info)); +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ + + +extern int ZEXPORT unzGetGlobalComment OF((unzFile file, + char *szComment, + uLong uSizeBuf)); +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +extern int ZEXPORT unzGoToNextFile OF((unzFile file)); +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +extern int ZEXPORT unzLocateFile OF((unzFile file, + const char *szFileName, + int iCaseSensitivity)); +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ + + +/* ****************************************** */ +/* Ryan supplied functions */ +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_pos_s +{ + uLong pos_in_zip_directory; /* offset in zip file directory */ + uLong num_of_file; /* # of file */ +} unz_file_pos; + +extern int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos); + +extern int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos); + +/* ****************************************** */ + +extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain somes info about + the current file + if szFileName!=NULL, the filemane string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (commentBufferSize is the size of the buffer) +*/ + +/***************************************************************************/ +/* for reading the content of the current zipfile, you can open it, read data + from it, and close it (you can close it before reading all the file) + */ + +extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, + const char* password)); +/* + Open for reading data the current file in the zipfile. + password is a crypting password + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, + int* method, + int* level, + int raw)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + +extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, + int* method, + int* level, + int raw, + const char* password)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + + +extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + +extern int ZEXPORT unzReadCurrentFile OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read bytes from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +extern z_off_t ZEXPORT unztell OF((unzFile file)); +/* + Give the current position in uncompressed data +*/ + +extern int ZEXPORT unzeof OF((unzFile file)); +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ + +/***************************************************************************/ + +/* Get the current file offset */ +extern uLong ZEXPORT unzGetOffset (unzFile file); + +/* Set the current file offset */ +extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); + + + +#ifdef __cplusplus +} +#endif + +#endif /* _unz_H */ diff --git a/JGE/include/unzip/zip.h b/JGE/include/unzip/zip.h index cd38b670f..acacce83b 100644 --- a/JGE/include/unzip/zip.h +++ b/JGE/include/unzip/zip.h @@ -1,235 +1,235 @@ -/* zip.h -- IO for compress .zip files using zlib - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This unzip package allow creates .ZIP file, compatible with PKZip 2.04g - WinZip, InfoZip tools and compatible. - Multi volume ZipFile (span) are not supported. - Encryption compatible with pkzip 2.04g only supported - Old compressions used by old PKZip 1.x are not supported - - For uncompress .zip file, look at unzip.h - - - I WAIT FEEDBACK at mail info@winimage.com - Visit also http://www.winimage.com/zLibDll/unzip.html for evolution - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - -*/ - -/* for more info about .ZIP format, see - http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip - http://www.info-zip.org/pub/infozip/doc/ - PkWare has also a specification at : - ftp://ftp.pkware.com/probdesc.zip -*/ - -#ifndef _zip_H -#define _zip_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagzipFile__ { int unused; } zipFile__; -typedef zipFile__ *zipFile; -#else -typedef voidp zipFile; -#endif - -#define ZIP_OK (0) -#define ZIP_EOF (0) -#define ZIP_ERRNO (Z_ERRNO) -#define ZIP_PARAMERROR (-102) -#define ZIP_BADZIPFILE (-103) -#define ZIP_INTERNALERROR (-104) - -#ifndef DEF_MEM_LEVEL -# if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -# else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -# endif -#endif -/* default memLevel */ - -/* tm_zip contain date/time info */ -typedef struct tm_zip_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_zip; - -typedef struct -{ - tm_zip tmz_date; /* date in understandable format */ - uLong dosDate; /* if dos_date == 0, tmu_date is used */ -/* uLong flag; */ /* general purpose bit flag 2 bytes */ - - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ -} zip_fileinfo; - -typedef const char* zipcharpc; - - -#define APPEND_STATUS_CREATE (0) -#define APPEND_STATUS_CREATEAFTER (1) -#define APPEND_STATUS_ADDINZIP (2) - -extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); -/* - Create a zipfile. - pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on - an Unix computer "zlib/zlib113.zip". - if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip - will be created at the end of the file. - (useful if the file contain a self extractor code) - if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will - add files in existing zip (be sure you don't add file that doesn't exist) - If the zipfile cannot be opened, the return value is NULL. - Else, the return value is a zipFile Handle, usable with other function - of this zip package. -*/ - -/* Note : there is no delete function into a zipfile. - If you want delete file into a zipfile, you must open a zipfile, and create another - Of couse, you can use RAW reading and writing to copy the file you did not want delte -*/ - -extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, - int append, - zipcharpc* globalcomment, - zlib_filefunc_def* pzlib_filefunc_def)); - -extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level)); -/* - Open a file in the ZIP for writing. - filename : the filename in zip (if NULL, '-' without quote will be used - *zipfi contain supplemental information - if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local - contains the extrafield data the the local header - if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global - contains the extrafield data the the local header - if comment != NULL, comment contain the comment string - method contain the compression method (0 for store, Z_DEFLATED for deflate) - level contain the level of compression (can be Z_DEFAULT_COMPRESSION) -*/ - - -extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw)); - -/* - Same than zipOpenNewFileInZip, except if raw=1, we write raw file - */ - -extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCtypting)); - -/* - Same than zipOpenNewFileInZip2, except - windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 - password : crypting password (NULL for no crypting) - crcForCtypting : crc of file to compress (needed for crypting) - */ - - -extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, - const void* buf, - unsigned len)); -/* - Write data in the zipfile -*/ - -extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); -/* - Close the current file in the zipfile -*/ - -extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, - uLong uncompressed_size, - uLong crc32)); -/* - Close the current file in the zipfile, for fiel opened with - parameter raw=1 in zipOpenNewFileInZip2 - uncompressed_size and crc32 are value for the uncompressed size -*/ - -extern int ZEXPORT zipClose OF((zipFile file, - const char* global_comment)); -/* - Close the zipfile -*/ - -#ifdef __cplusplus -} -#endif - -#endif /* _zip_H */ +/* zip.h -- IO for compress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This unzip package allow creates .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + Multi volume ZipFile (span) are not supported. + Encryption compatible with pkzip 2.04g only supported + Old compressions used by old PKZip 1.x are not supported + + For uncompress .zip file, look at unzip.h + + + I WAIT FEEDBACK at mail info@winimage.com + Visit also http://www.winimage.com/zLibDll/unzip.html for evolution + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +*/ + +/* for more info about .ZIP format, see + http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip + http://www.info-zip.org/pub/infozip/doc/ + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip +*/ + +#ifndef _zip_H +#define _zip_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagzipFile__ { int unused; } zipFile__; +typedef zipFile__ *zipFile; +#else +typedef voidp zipFile; +#endif + +#define ZIP_OK (0) +#define ZIP_EOF (0) +#define ZIP_ERRNO (Z_ERRNO) +#define ZIP_PARAMERROR (-102) +#define ZIP_BADZIPFILE (-103) +#define ZIP_INTERNALERROR (-104) + +#ifndef DEF_MEM_LEVEL +# if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +# else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +# endif +#endif +/* default memLevel */ + +/* tm_zip contain date/time info */ +typedef struct tm_zip_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_zip; + +typedef struct +{ + tm_zip tmz_date; /* date in understandable format */ + uLong dosDate; /* if dos_date == 0, tmu_date is used */ +/* uLong flag; */ /* general purpose bit flag 2 bytes */ + + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ +} zip_fileinfo; + +typedef const char* zipcharpc; + + +#define APPEND_STATUS_CREATE (0) +#define APPEND_STATUS_CREATEAFTER (1) +#define APPEND_STATUS_ADDINZIP (2) + +extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); +/* + Create a zipfile. + pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on + an Unix computer "zlib/zlib113.zip". + if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip + will be created at the end of the file. + (useful if the file contain a self extractor code) + if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will + add files in existing zip (be sure you don't add file that doesn't exist) + If the zipfile cannot be opened, the return value is NULL. + Else, the return value is a zipFile Handle, usable with other function + of this zip package. +*/ + +/* Note : there is no delete function into a zipfile. + If you want delete file into a zipfile, you must open a zipfile, and create another + Of couse, you can use RAW reading and writing to copy the file you did not want delte +*/ + +extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc_def* pzlib_filefunc_def)); + +extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level)); +/* + Open a file in the ZIP for writing. + filename : the filename in zip (if NULL, '-' without quote will be used + *zipfi contain supplemental information + if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local + contains the extrafield data the the local header + if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global + contains the extrafield data the the local header + if comment != NULL, comment contain the comment string + method contain the compression method (0 for store, Z_DEFLATED for deflate) + level contain the level of compression (can be Z_DEFAULT_COMPRESSION) +*/ + + +extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw)); + +/* + Same than zipOpenNewFileInZip, except if raw=1, we write raw file + */ + +extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCtypting)); + +/* + Same than zipOpenNewFileInZip2, except + windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 + password : crypting password (NULL for no crypting) + crcForCtypting : crc of file to compress (needed for crypting) + */ + + +extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, + const void* buf, + unsigned len)); +/* + Write data in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); +/* + Close the current file in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, + uLong uncompressed_size, + uLong crc32)); +/* + Close the current file in the zipfile, for fiel opened with + parameter raw=1 in zipOpenNewFileInZip2 + uncompressed_size and crc32 are value for the uncompressed size +*/ + +extern int ZEXPORT zipClose OF((zipFile file, + const char* global_comment)); +/* + Close the zipfile +*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _zip_H */ diff --git a/JGE/include/vram.h b/JGE/include/vram.h index 66cf93284..fe9551d04 100644 --- a/JGE/include/vram.h +++ b/JGE/include/vram.h @@ -1,54 +1,54 @@ -/* - * Helper for use with the PSP Software Development Kit - http://www.pspdev.org - * ----------------------------------------------------------------------- - * Licensed under GPL - * - * vram.c - Standard C high performance VRAM allocation routines. - * - * Copyright (c) 2007 Alexander Berl 'Raphael' - * http://wordpress.fx-world.org - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef vram_h__ -#define vram_h__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -void* vrelptr( void *ptr ); // make a pointer relative to memory base address (ATTENTION: A NULL rel ptr is not illegal/invalid!) -void* vabsptr( void *ptr ); // make a pointer absolute (default return type of valloc) - -void* valloc( size_t size ); -void vfree( void* ptr ); -size_t vmemavail(); -size_t vlargestblock(); - - -#ifdef _DEBUG -// Debug printf (to stdout) a trace of the current Memblocks -void __memwalk(); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif // ifdef vram_h__ +/* + * Helper for use with the PSP Software Development Kit - http://www.pspdev.org + * ----------------------------------------------------------------------- + * Licensed under GPL + * + * vram.c - Standard C high performance VRAM allocation routines. + * + * Copyright (c) 2007 Alexander Berl 'Raphael' + * http://wordpress.fx-world.org + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifndef vram_h__ +#define vram_h__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void* vrelptr( void *ptr ); // make a pointer relative to memory base address (ATTENTION: A NULL rel ptr is not illegal/invalid!) +void* vabsptr( void *ptr ); // make a pointer absolute (default return type of valloc) + +void* valloc( size_t size ); +void vfree( void* ptr ); +size_t vmemavail(); +size_t vlargestblock(); + + +#ifdef _DEBUG +// Debug printf (to stdout) a trace of the current Memblocks +void __memwalk(); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif // ifdef vram_h__ diff --git a/JGE/src/Encoding.cpp b/JGE/src/Encoding.cpp index 429e4217c..b00ced393 100644 --- a/JGE/src/Encoding.cpp +++ b/JGE/src/Encoding.cpp @@ -1,3223 +1,3223 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- -// -// The encoding conversion functions are taken from the eReader project of aeolusc. -// -//------------------------------------------------------------------------------------- - - - - -#include "../include/Encoding.h" - -////////////////////////////////////////////////////////////////////////// - - -#ifndef INVALID -#define INVALID ((u32)-1) -#endif - -typedef u32 ucs4_t; -#define RET_ILSEQ -1 -#define RET_TOOFEW(n) (-2-(n)) -#define RET_ILUNI -1 -#define RET_TOOSMALL -2 - - - -static const u16 gb2312_2uni_page21[831] = { - /* 0x21 */ - 0x3000, 0x3001, 0x3002, 0x30fb, 0x02c9, 0x02c7, 0x00a8, 0x3003, - 0x3005, 0x2015, 0xff5e, 0x2016, 0x2026, 0x2018, 0x2019, 0x201c, - 0x201d, 0x3014, 0x3015, 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, - 0x300d, 0x300e, 0x300f, 0x3016, 0x3017, 0x3010, 0x3011, 0x00b1, - 0x00d7, 0x00f7, 0x2236, 0x2227, 0x2228, 0x2211, 0x220f, 0x222a, - 0x2229, 0x2208, 0x2237, 0x221a, 0x22a5, 0x2225, 0x2220, 0x2312, - 0x2299, 0x222b, 0x222e, 0x2261, 0x224c, 0x2248, 0x223d, 0x221d, - 0x2260, 0x226e, 0x226f, 0x2264, 0x2265, 0x221e, 0x2235, 0x2234, - 0x2642, 0x2640, 0x00b0, 0x2032, 0x2033, 0x2103, 0xff04, 0x00a4, - 0xffe0, 0xffe1, 0x2030, 0x00a7, 0x2116, 0x2606, 0x2605, 0x25cb, - 0x25cf, 0x25ce, 0x25c7, 0x25c6, 0x25a1, 0x25a0, 0x25b3, 0x25b2, - 0x203b, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, - /* 0x22 */ - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f, - 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497, - 0x2498, 0x2499, 0x249a, 0x249b, 0x2474, 0x2475, 0x2476, 0x2477, - 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f, - 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487, - 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, - 0x2468, 0x2469, 0xfffd, 0xfffd, 0x3220, 0x3221, 0x3222, 0x3223, - 0x3224, 0x3225, 0x3226, 0x3227, 0x3228, 0x3229, 0xfffd, 0xfffd, - 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, - 0x2168, 0x2169, 0x216a, 0x216b, 0xfffd, 0xfffd, - /* 0x23 */ - 0xff01, 0xff02, 0xff03, 0xffe5, 0xff05, 0xff06, 0xff07, 0xff08, - 0xff09, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f, 0xff10, - 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17, 0xff18, - 0xff19, 0xff1a, 0xff1b, 0xff1c, 0xff1d, 0xff1e, 0xff1f, 0xff20, - 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27, 0xff28, - 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f, 0xff30, - 0xff31, 0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37, 0xff38, - 0xff39, 0xff3a, 0xff3b, 0xff3c, 0xff3d, 0xff3e, 0xff3f, 0xff40, - 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47, 0xff48, - 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f, 0xff50, - 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57, 0xff58, - 0xff59, 0xff5a, 0xff5b, 0xff5c, 0xff5d, 0xffe3, - /* 0x24 */ - 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047, 0x3048, - 0x3049, 0x304a, 0x304b, 0x304c, 0x304d, 0x304e, 0x304f, 0x3050, - 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, - 0x3059, 0x305a, 0x305b, 0x305c, 0x305d, 0x305e, 0x305f, 0x3060, - 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, - 0x3069, 0x306a, 0x306b, 0x306c, 0x306d, 0x306e, 0x306f, 0x3070, - 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, - 0x3079, 0x307a, 0x307b, 0x307c, 0x307d, 0x307e, 0x307f, 0x3080, - 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, - 0x3089, 0x308a, 0x308b, 0x308c, 0x308d, 0x308e, 0x308f, 0x3090, - 0x3091, 0x3092, 0x3093, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - /* 0x25 */ - 0x30a1, 0x30a2, 0x30a3, 0x30a4, 0x30a5, 0x30a6, 0x30a7, 0x30a8, - 0x30a9, 0x30aa, 0x30ab, 0x30ac, 0x30ad, 0x30ae, 0x30af, 0x30b0, - 0x30b1, 0x30b2, 0x30b3, 0x30b4, 0x30b5, 0x30b6, 0x30b7, 0x30b8, - 0x30b9, 0x30ba, 0x30bb, 0x30bc, 0x30bd, 0x30be, 0x30bf, 0x30c0, - 0x30c1, 0x30c2, 0x30c3, 0x30c4, 0x30c5, 0x30c6, 0x30c7, 0x30c8, - 0x30c9, 0x30ca, 0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf, 0x30d0, - 0x30d1, 0x30d2, 0x30d3, 0x30d4, 0x30d5, 0x30d6, 0x30d7, 0x30d8, - 0x30d9, 0x30da, 0x30db, 0x30dc, 0x30dd, 0x30de, 0x30df, 0x30e0, - 0x30e1, 0x30e2, 0x30e3, 0x30e4, 0x30e5, 0x30e6, 0x30e7, 0x30e8, - 0x30e9, 0x30ea, 0x30eb, 0x30ec, 0x30ed, 0x30ee, 0x30ef, 0x30f0, - 0x30f1, 0x30f2, 0x30f3, 0x30f4, 0x30f5, 0x30f6, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - /* 0x26 */ - 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, - 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, - 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8, - 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, - 0x03c1, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - /* 0x27 */ - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0401, 0x0416, - 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, - 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, - 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, - 0x042f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0451, 0x0436, - 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, - 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, - 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, - 0x044f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - /* 0x28 */ - 0x0101, 0x00e1, 0x01ce, 0x00e0, 0x0113, 0x00e9, 0x011b, 0x00e8, - 0x012b, 0x00ed, 0x01d0, 0x00ec, 0x014d, 0x00f3, 0x01d2, 0x00f2, - 0x016b, 0x00fa, 0x01d4, 0x00f9, 0x01d6, 0x01d8, 0x01da, 0x01dc, - 0x00fc, 0x00ea, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x3105, 0x3106, 0x3107, 0x3108, - 0x3109, 0x310a, 0x310b, 0x310c, 0x310d, 0x310e, 0x310f, 0x3110, - 0x3111, 0x3112, 0x3113, 0x3114, 0x3115, 0x3116, 0x3117, 0x3118, - 0x3119, 0x311a, 0x311b, 0x311c, 0x311d, 0x311e, 0x311f, 0x3120, - 0x3121, 0x3122, 0x3123, 0x3124, 0x3125, 0x3126, 0x3127, 0x3128, - 0x3129, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - /* 0x29 */ - 0xfffd, 0xfffd, 0xfffd, 0x2500, 0x2501, 0x2502, 0x2503, 0x2504, - 0x2505, 0x2506, 0x2507, 0x2508, 0x2509, 0x250a, 0x250b, 0x250c, - 0x250d, 0x250e, 0x250f, 0x2510, 0x2511, 0x2512, 0x2513, 0x2514, - 0x2515, 0x2516, 0x2517, 0x2518, 0x2519, 0x251a, 0x251b, 0x251c, - 0x251d, 0x251e, 0x251f, 0x2520, 0x2521, 0x2522, 0x2523, 0x2524, - 0x2525, 0x2526, 0x2527, 0x2528, 0x2529, 0x252a, 0x252b, 0x252c, - 0x252d, 0x252e, 0x252f, 0x2530, 0x2531, 0x2532, 0x2533, 0x2534, - 0x2535, 0x2536, 0x2537, 0x2538, 0x2539, 0x253a, 0x253b, 0x253c, - 0x253d, 0x253e, 0x253f, 0x2540, 0x2541, 0x2542, 0x2543, 0x2544, - 0x2545, 0x2546, 0x2547, 0x2548, 0x2549, 0x254a, 0x254b, -}; -static const u16 gb2312_2uni_page30[6768] = { - /* 0x30 */ - 0x554a, 0x963f, 0x57c3, 0x6328, 0x54ce, 0x5509, 0x54c0, 0x7691, - 0x764c, 0x853c, 0x77ee, 0x827e, 0x788d, 0x7231, 0x9698, 0x978d, - 0x6c28, 0x5b89, 0x4ffa, 0x6309, 0x6697, 0x5cb8, 0x80fa, 0x6848, - 0x80ae, 0x6602, 0x76ce, 0x51f9, 0x6556, 0x71ac, 0x7ff1, 0x8884, - 0x50b2, 0x5965, 0x61ca, 0x6fb3, 0x82ad, 0x634c, 0x6252, 0x53ed, - 0x5427, 0x7b06, 0x516b, 0x75a4, 0x5df4, 0x62d4, 0x8dcb, 0x9776, - 0x628a, 0x8019, 0x575d, 0x9738, 0x7f62, 0x7238, 0x767d, 0x67cf, - 0x767e, 0x6446, 0x4f70, 0x8d25, 0x62dc, 0x7a17, 0x6591, 0x73ed, - 0x642c, 0x6273, 0x822c, 0x9881, 0x677f, 0x7248, 0x626e, 0x62cc, - 0x4f34, 0x74e3, 0x534a, 0x529e, 0x7eca, 0x90a6, 0x5e2e, 0x6886, - 0x699c, 0x8180, 0x7ed1, 0x68d2, 0x78c5, 0x868c, 0x9551, 0x508d, - 0x8c24, 0x82de, 0x80de, 0x5305, 0x8912, 0x5265, - /* 0x31 */ - 0x8584, 0x96f9, 0x4fdd, 0x5821, 0x9971, 0x5b9d, 0x62b1, 0x62a5, - 0x66b4, 0x8c79, 0x9c8d, 0x7206, 0x676f, 0x7891, 0x60b2, 0x5351, - 0x5317, 0x8f88, 0x80cc, 0x8d1d, 0x94a1, 0x500d, 0x72c8, 0x5907, - 0x60eb, 0x7119, 0x88ab, 0x5954, 0x82ef, 0x672c, 0x7b28, 0x5d29, - 0x7ef7, 0x752d, 0x6cf5, 0x8e66, 0x8ff8, 0x903c, 0x9f3b, 0x6bd4, - 0x9119, 0x7b14, 0x5f7c, 0x78a7, 0x84d6, 0x853d, 0x6bd5, 0x6bd9, - 0x6bd6, 0x5e01, 0x5e87, 0x75f9, 0x95ed, 0x655d, 0x5f0a, 0x5fc5, - 0x8f9f, 0x58c1, 0x81c2, 0x907f, 0x965b, 0x97ad, 0x8fb9, 0x7f16, - 0x8d2c, 0x6241, 0x4fbf, 0x53d8, 0x535e, 0x8fa8, 0x8fa9, 0x8fab, - 0x904d, 0x6807, 0x5f6a, 0x8198, 0x8868, 0x9cd6, 0x618b, 0x522b, - 0x762a, 0x5f6c, 0x658c, 0x6fd2, 0x6ee8, 0x5bbe, 0x6448, 0x5175, - 0x51b0, 0x67c4, 0x4e19, 0x79c9, 0x997c, 0x70b3, - /* 0x32 */ - 0x75c5, 0x5e76, 0x73bb, 0x83e0, 0x64ad, 0x62e8, 0x94b5, 0x6ce2, - 0x535a, 0x52c3, 0x640f, 0x94c2, 0x7b94, 0x4f2f, 0x5e1b, 0x8236, - 0x8116, 0x818a, 0x6e24, 0x6cca, 0x9a73, 0x6355, 0x535c, 0x54fa, - 0x8865, 0x57e0, 0x4e0d, 0x5e03, 0x6b65, 0x7c3f, 0x90e8, 0x6016, - 0x64e6, 0x731c, 0x88c1, 0x6750, 0x624d, 0x8d22, 0x776c, 0x8e29, - 0x91c7, 0x5f69, 0x83dc, 0x8521, 0x9910, 0x53c2, 0x8695, 0x6b8b, - 0x60ed, 0x60e8, 0x707f, 0x82cd, 0x8231, 0x4ed3, 0x6ca7, 0x85cf, - 0x64cd, 0x7cd9, 0x69fd, 0x66f9, 0x8349, 0x5395, 0x7b56, 0x4fa7, - 0x518c, 0x6d4b, 0x5c42, 0x8e6d, 0x63d2, 0x53c9, 0x832c, 0x8336, - 0x67e5, 0x78b4, 0x643d, 0x5bdf, 0x5c94, 0x5dee, 0x8be7, 0x62c6, - 0x67f4, 0x8c7a, 0x6400, 0x63ba, 0x8749, 0x998b, 0x8c17, 0x7f20, - 0x94f2, 0x4ea7, 0x9610, 0x98a4, 0x660c, 0x7316, - /* 0x33 */ - 0x573a, 0x5c1d, 0x5e38, 0x957f, 0x507f, 0x80a0, 0x5382, 0x655e, - 0x7545, 0x5531, 0x5021, 0x8d85, 0x6284, 0x949e, 0x671d, 0x5632, - 0x6f6e, 0x5de2, 0x5435, 0x7092, 0x8f66, 0x626f, 0x64a4, 0x63a3, - 0x5f7b, 0x6f88, 0x90f4, 0x81e3, 0x8fb0, 0x5c18, 0x6668, 0x5ff1, - 0x6c89, 0x9648, 0x8d81, 0x886c, 0x6491, 0x79f0, 0x57ce, 0x6a59, - 0x6210, 0x5448, 0x4e58, 0x7a0b, 0x60e9, 0x6f84, 0x8bda, 0x627f, - 0x901e, 0x9a8b, 0x79e4, 0x5403, 0x75f4, 0x6301, 0x5319, 0x6c60, - 0x8fdf, 0x5f1b, 0x9a70, 0x803b, 0x9f7f, 0x4f88, 0x5c3a, 0x8d64, - 0x7fc5, 0x65a5, 0x70bd, 0x5145, 0x51b2, 0x866b, 0x5d07, 0x5ba0, - 0x62bd, 0x916c, 0x7574, 0x8e0c, 0x7a20, 0x6101, 0x7b79, 0x4ec7, - 0x7ef8, 0x7785, 0x4e11, 0x81ed, 0x521d, 0x51fa, 0x6a71, 0x53a8, - 0x8e87, 0x9504, 0x96cf, 0x6ec1, 0x9664, 0x695a, - /* 0x34 */ - 0x7840, 0x50a8, 0x77d7, 0x6410, 0x89e6, 0x5904, 0x63e3, 0x5ddd, - 0x7a7f, 0x693d, 0x4f20, 0x8239, 0x5598, 0x4e32, 0x75ae, 0x7a97, - 0x5e62, 0x5e8a, 0x95ef, 0x521b, 0x5439, 0x708a, 0x6376, 0x9524, - 0x5782, 0x6625, 0x693f, 0x9187, 0x5507, 0x6df3, 0x7eaf, 0x8822, - 0x6233, 0x7ef0, 0x75b5, 0x8328, 0x78c1, 0x96cc, 0x8f9e, 0x6148, - 0x74f7, 0x8bcd, 0x6b64, 0x523a, 0x8d50, 0x6b21, 0x806a, 0x8471, - 0x56f1, 0x5306, 0x4ece, 0x4e1b, 0x51d1, 0x7c97, 0x918b, 0x7c07, - 0x4fc3, 0x8e7f, 0x7be1, 0x7a9c, 0x6467, 0x5d14, 0x50ac, 0x8106, - 0x7601, 0x7cb9, 0x6dec, 0x7fe0, 0x6751, 0x5b58, 0x5bf8, 0x78cb, - 0x64ae, 0x6413, 0x63aa, 0x632b, 0x9519, 0x642d, 0x8fbe, 0x7b54, - 0x7629, 0x6253, 0x5927, 0x5446, 0x6b79, 0x50a3, 0x6234, 0x5e26, - 0x6b86, 0x4ee3, 0x8d37, 0x888b, 0x5f85, 0x902e, - /* 0x35 */ - 0x6020, 0x803d, 0x62c5, 0x4e39, 0x5355, 0x90f8, 0x63b8, 0x80c6, - 0x65e6, 0x6c2e, 0x4f46, 0x60ee, 0x6de1, 0x8bde, 0x5f39, 0x86cb, - 0x5f53, 0x6321, 0x515a, 0x8361, 0x6863, 0x5200, 0x6363, 0x8e48, - 0x5012, 0x5c9b, 0x7977, 0x5bfc, 0x5230, 0x7a3b, 0x60bc, 0x9053, - 0x76d7, 0x5fb7, 0x5f97, 0x7684, 0x8e6c, 0x706f, 0x767b, 0x7b49, - 0x77aa, 0x51f3, 0x9093, 0x5824, 0x4f4e, 0x6ef4, 0x8fea, 0x654c, - 0x7b1b, 0x72c4, 0x6da4, 0x7fdf, 0x5ae1, 0x62b5, 0x5e95, 0x5730, - 0x8482, 0x7b2c, 0x5e1d, 0x5f1f, 0x9012, 0x7f14, 0x98a0, 0x6382, - 0x6ec7, 0x7898, 0x70b9, 0x5178, 0x975b, 0x57ab, 0x7535, 0x4f43, - 0x7538, 0x5e97, 0x60e6, 0x5960, 0x6dc0, 0x6bbf, 0x7889, 0x53fc, - 0x96d5, 0x51cb, 0x5201, 0x6389, 0x540a, 0x9493, 0x8c03, 0x8dcc, - 0x7239, 0x789f, 0x8776, 0x8fed, 0x8c0d, 0x53e0, - /* 0x36 */ - 0x4e01, 0x76ef, 0x53ee, 0x9489, 0x9876, 0x9f0e, 0x952d, 0x5b9a, - 0x8ba2, 0x4e22, 0x4e1c, 0x51ac, 0x8463, 0x61c2, 0x52a8, 0x680b, - 0x4f97, 0x606b, 0x51bb, 0x6d1e, 0x515c, 0x6296, 0x6597, 0x9661, - 0x8c46, 0x9017, 0x75d8, 0x90fd, 0x7763, 0x6bd2, 0x728a, 0x72ec, - 0x8bfb, 0x5835, 0x7779, 0x8d4c, 0x675c, 0x9540, 0x809a, 0x5ea6, - 0x6e21, 0x5992, 0x7aef, 0x77ed, 0x953b, 0x6bb5, 0x65ad, 0x7f0e, - 0x5806, 0x5151, 0x961f, 0x5bf9, 0x58a9, 0x5428, 0x8e72, 0x6566, - 0x987f, 0x56e4, 0x949d, 0x76fe, 0x9041, 0x6387, 0x54c6, 0x591a, - 0x593a, 0x579b, 0x8eb2, 0x6735, 0x8dfa, 0x8235, 0x5241, 0x60f0, - 0x5815, 0x86fe, 0x5ce8, 0x9e45, 0x4fc4, 0x989d, 0x8bb9, 0x5a25, - 0x6076, 0x5384, 0x627c, 0x904f, 0x9102, 0x997f, 0x6069, 0x800c, - 0x513f, 0x8033, 0x5c14, 0x9975, 0x6d31, 0x4e8c, - /* 0x37 */ - 0x8d30, 0x53d1, 0x7f5a, 0x7b4f, 0x4f10, 0x4e4f, 0x9600, 0x6cd5, - 0x73d0, 0x85e9, 0x5e06, 0x756a, 0x7ffb, 0x6a0a, 0x77fe, 0x9492, - 0x7e41, 0x51e1, 0x70e6, 0x53cd, 0x8fd4, 0x8303, 0x8d29, 0x72af, - 0x996d, 0x6cdb, 0x574a, 0x82b3, 0x65b9, 0x80aa, 0x623f, 0x9632, - 0x59a8, 0x4eff, 0x8bbf, 0x7eba, 0x653e, 0x83f2, 0x975e, 0x5561, - 0x98de, 0x80a5, 0x532a, 0x8bfd, 0x5420, 0x80ba, 0x5e9f, 0x6cb8, - 0x8d39, 0x82ac, 0x915a, 0x5429, 0x6c1b, 0x5206, 0x7eb7, 0x575f, - 0x711a, 0x6c7e, 0x7c89, 0x594b, 0x4efd, 0x5fff, 0x6124, 0x7caa, - 0x4e30, 0x5c01, 0x67ab, 0x8702, 0x5cf0, 0x950b, 0x98ce, 0x75af, - 0x70fd, 0x9022, 0x51af, 0x7f1d, 0x8bbd, 0x5949, 0x51e4, 0x4f5b, - 0x5426, 0x592b, 0x6577, 0x80a4, 0x5b75, 0x6276, 0x62c2, 0x8f90, - 0x5e45, 0x6c1f, 0x7b26, 0x4f0f, 0x4fd8, 0x670d, - /* 0x38 */ - 0x6d6e, 0x6daa, 0x798f, 0x88b1, 0x5f17, 0x752b, 0x629a, 0x8f85, - 0x4fef, 0x91dc, 0x65a7, 0x812f, 0x8151, 0x5e9c, 0x8150, 0x8d74, - 0x526f, 0x8986, 0x8d4b, 0x590d, 0x5085, 0x4ed8, 0x961c, 0x7236, - 0x8179, 0x8d1f, 0x5bcc, 0x8ba3, 0x9644, 0x5987, 0x7f1a, 0x5490, - 0x5676, 0x560e, 0x8be5, 0x6539, 0x6982, 0x9499, 0x76d6, 0x6e89, - 0x5e72, 0x7518, 0x6746, 0x67d1, 0x7aff, 0x809d, 0x8d76, 0x611f, - 0x79c6, 0x6562, 0x8d63, 0x5188, 0x521a, 0x94a2, 0x7f38, 0x809b, - 0x7eb2, 0x5c97, 0x6e2f, 0x6760, 0x7bd9, 0x768b, 0x9ad8, 0x818f, - 0x7f94, 0x7cd5, 0x641e, 0x9550, 0x7a3f, 0x544a, 0x54e5, 0x6b4c, - 0x6401, 0x6208, 0x9e3d, 0x80f3, 0x7599, 0x5272, 0x9769, 0x845b, - 0x683c, 0x86e4, 0x9601, 0x9694, 0x94ec, 0x4e2a, 0x5404, 0x7ed9, - 0x6839, 0x8ddf, 0x8015, 0x66f4, 0x5e9a, 0x7fb9, - /* 0x39 */ - 0x57c2, 0x803f, 0x6897, 0x5de5, 0x653b, 0x529f, 0x606d, 0x9f9a, - 0x4f9b, 0x8eac, 0x516c, 0x5bab, 0x5f13, 0x5de9, 0x6c5e, 0x62f1, - 0x8d21, 0x5171, 0x94a9, 0x52fe, 0x6c9f, 0x82df, 0x72d7, 0x57a2, - 0x6784, 0x8d2d, 0x591f, 0x8f9c, 0x83c7, 0x5495, 0x7b8d, 0x4f30, - 0x6cbd, 0x5b64, 0x59d1, 0x9f13, 0x53e4, 0x86ca, 0x9aa8, 0x8c37, - 0x80a1, 0x6545, 0x987e, 0x56fa, 0x96c7, 0x522e, 0x74dc, 0x5250, - 0x5be1, 0x6302, 0x8902, 0x4e56, 0x62d0, 0x602a, 0x68fa, 0x5173, - 0x5b98, 0x51a0, 0x89c2, 0x7ba1, 0x9986, 0x7f50, 0x60ef, 0x704c, - 0x8d2f, 0x5149, 0x5e7f, 0x901b, 0x7470, 0x89c4, 0x572d, 0x7845, - 0x5f52, 0x9f9f, 0x95fa, 0x8f68, 0x9b3c, 0x8be1, 0x7678, 0x6842, - 0x67dc, 0x8dea, 0x8d35, 0x523d, 0x8f8a, 0x6eda, 0x68cd, 0x9505, - 0x90ed, 0x56fd, 0x679c, 0x88f9, 0x8fc7, 0x54c8, - /* 0x3a */ - 0x9ab8, 0x5b69, 0x6d77, 0x6c26, 0x4ea5, 0x5bb3, 0x9a87, 0x9163, - 0x61a8, 0x90af, 0x97e9, 0x542b, 0x6db5, 0x5bd2, 0x51fd, 0x558a, - 0x7f55, 0x7ff0, 0x64bc, 0x634d, 0x65f1, 0x61be, 0x608d, 0x710a, - 0x6c57, 0x6c49, 0x592f, 0x676d, 0x822a, 0x58d5, 0x568e, 0x8c6a, - 0x6beb, 0x90dd, 0x597d, 0x8017, 0x53f7, 0x6d69, 0x5475, 0x559d, - 0x8377, 0x83cf, 0x6838, 0x79be, 0x548c, 0x4f55, 0x5408, 0x76d2, - 0x8c89, 0x9602, 0x6cb3, 0x6db8, 0x8d6b, 0x8910, 0x9e64, 0x8d3a, - 0x563f, 0x9ed1, 0x75d5, 0x5f88, 0x72e0, 0x6068, 0x54fc, 0x4ea8, - 0x6a2a, 0x8861, 0x6052, 0x8f70, 0x54c4, 0x70d8, 0x8679, 0x9e3f, - 0x6d2a, 0x5b8f, 0x5f18, 0x7ea2, 0x5589, 0x4faf, 0x7334, 0x543c, - 0x539a, 0x5019, 0x540e, 0x547c, 0x4e4e, 0x5ffd, 0x745a, 0x58f6, - 0x846b, 0x80e1, 0x8774, 0x72d0, 0x7cca, 0x6e56, - /* 0x3b */ - 0x5f27, 0x864e, 0x552c, 0x62a4, 0x4e92, 0x6caa, 0x6237, 0x82b1, - 0x54d7, 0x534e, 0x733e, 0x6ed1, 0x753b, 0x5212, 0x5316, 0x8bdd, - 0x69d0, 0x5f8a, 0x6000, 0x6dee, 0x574f, 0x6b22, 0x73af, 0x6853, - 0x8fd8, 0x7f13, 0x6362, 0x60a3, 0x5524, 0x75ea, 0x8c62, 0x7115, - 0x6da3, 0x5ba6, 0x5e7b, 0x8352, 0x614c, 0x9ec4, 0x78fa, 0x8757, - 0x7c27, 0x7687, 0x51f0, 0x60f6, 0x714c, 0x6643, 0x5e4c, 0x604d, - 0x8c0e, 0x7070, 0x6325, 0x8f89, 0x5fbd, 0x6062, 0x86d4, 0x56de, - 0x6bc1, 0x6094, 0x6167, 0x5349, 0x60e0, 0x6666, 0x8d3f, 0x79fd, - 0x4f1a, 0x70e9, 0x6c47, 0x8bb3, 0x8bf2, 0x7ed8, 0x8364, 0x660f, - 0x5a5a, 0x9b42, 0x6d51, 0x6df7, 0x8c41, 0x6d3b, 0x4f19, 0x706b, - 0x83b7, 0x6216, 0x60d1, 0x970d, 0x8d27, 0x7978, 0x51fb, 0x573e, - 0x57fa, 0x673a, 0x7578, 0x7a3d, 0x79ef, 0x7b95, - /* 0x3c */ - 0x808c, 0x9965, 0x8ff9, 0x6fc0, 0x8ba5, 0x9e21, 0x59ec, 0x7ee9, - 0x7f09, 0x5409, 0x6781, 0x68d8, 0x8f91, 0x7c4d, 0x96c6, 0x53ca, - 0x6025, 0x75be, 0x6c72, 0x5373, 0x5ac9, 0x7ea7, 0x6324, 0x51e0, - 0x810a, 0x5df1, 0x84df, 0x6280, 0x5180, 0x5b63, 0x4f0e, 0x796d, - 0x5242, 0x60b8, 0x6d4e, 0x5bc4, 0x5bc2, 0x8ba1, 0x8bb0, 0x65e2, - 0x5fcc, 0x9645, 0x5993, 0x7ee7, 0x7eaa, 0x5609, 0x67b7, 0x5939, - 0x4f73, 0x5bb6, 0x52a0, 0x835a, 0x988a, 0x8d3e, 0x7532, 0x94be, - 0x5047, 0x7a3c, 0x4ef7, 0x67b6, 0x9a7e, 0x5ac1, 0x6b7c, 0x76d1, - 0x575a, 0x5c16, 0x7b3a, 0x95f4, 0x714e, 0x517c, 0x80a9, 0x8270, - 0x5978, 0x7f04, 0x8327, 0x68c0, 0x67ec, 0x78b1, 0x7877, 0x62e3, - 0x6361, 0x7b80, 0x4fed, 0x526a, 0x51cf, 0x8350, 0x69db, 0x9274, - 0x8df5, 0x8d31, 0x89c1, 0x952e, 0x7bad, 0x4ef6, - /* 0x3d */ - 0x5065, 0x8230, 0x5251, 0x996f, 0x6e10, 0x6e85, 0x6da7, 0x5efa, - 0x50f5, 0x59dc, 0x5c06, 0x6d46, 0x6c5f, 0x7586, 0x848b, 0x6868, - 0x5956, 0x8bb2, 0x5320, 0x9171, 0x964d, 0x8549, 0x6912, 0x7901, - 0x7126, 0x80f6, 0x4ea4, 0x90ca, 0x6d47, 0x9a84, 0x5a07, 0x56bc, - 0x6405, 0x94f0, 0x77eb, 0x4fa5, 0x811a, 0x72e1, 0x89d2, 0x997a, - 0x7f34, 0x7ede, 0x527f, 0x6559, 0x9175, 0x8f7f, 0x8f83, 0x53eb, - 0x7a96, 0x63ed, 0x63a5, 0x7686, 0x79f8, 0x8857, 0x9636, 0x622a, - 0x52ab, 0x8282, 0x6854, 0x6770, 0x6377, 0x776b, 0x7aed, 0x6d01, - 0x7ed3, 0x89e3, 0x59d0, 0x6212, 0x85c9, 0x82a5, 0x754c, 0x501f, - 0x4ecb, 0x75a5, 0x8beb, 0x5c4a, 0x5dfe, 0x7b4b, 0x65a4, 0x91d1, - 0x4eca, 0x6d25, 0x895f, 0x7d27, 0x9526, 0x4ec5, 0x8c28, 0x8fdb, - 0x9773, 0x664b, 0x7981, 0x8fd1, 0x70ec, 0x6d78, - /* 0x3e */ - 0x5c3d, 0x52b2, 0x8346, 0x5162, 0x830e, 0x775b, 0x6676, 0x9cb8, - 0x4eac, 0x60ca, 0x7cbe, 0x7cb3, 0x7ecf, 0x4e95, 0x8b66, 0x666f, - 0x9888, 0x9759, 0x5883, 0x656c, 0x955c, 0x5f84, 0x75c9, 0x9756, - 0x7adf, 0x7ade, 0x51c0, 0x70af, 0x7a98, 0x63ea, 0x7a76, 0x7ea0, - 0x7396, 0x97ed, 0x4e45, 0x7078, 0x4e5d, 0x9152, 0x53a9, 0x6551, - 0x65e7, 0x81fc, 0x8205, 0x548e, 0x5c31, 0x759a, 0x97a0, 0x62d8, - 0x72d9, 0x75bd, 0x5c45, 0x9a79, 0x83ca, 0x5c40, 0x5480, 0x77e9, - 0x4e3e, 0x6cae, 0x805a, 0x62d2, 0x636e, 0x5de8, 0x5177, 0x8ddd, - 0x8e1e, 0x952f, 0x4ff1, 0x53e5, 0x60e7, 0x70ac, 0x5267, 0x6350, - 0x9e43, 0x5a1f, 0x5026, 0x7737, 0x5377, 0x7ee2, 0x6485, 0x652b, - 0x6289, 0x6398, 0x5014, 0x7235, 0x89c9, 0x51b3, 0x8bc0, 0x7edd, - 0x5747, 0x83cc, 0x94a7, 0x519b, 0x541b, 0x5cfb, - /* 0x3f */ - 0x4fca, 0x7ae3, 0x6d5a, 0x90e1, 0x9a8f, 0x5580, 0x5496, 0x5361, - 0x54af, 0x5f00, 0x63e9, 0x6977, 0x51ef, 0x6168, 0x520a, 0x582a, - 0x52d8, 0x574e, 0x780d, 0x770b, 0x5eb7, 0x6177, 0x7ce0, 0x625b, - 0x6297, 0x4ea2, 0x7095, 0x8003, 0x62f7, 0x70e4, 0x9760, 0x5777, - 0x82db, 0x67ef, 0x68f5, 0x78d5, 0x9897, 0x79d1, 0x58f3, 0x54b3, - 0x53ef, 0x6e34, 0x514b, 0x523b, 0x5ba2, 0x8bfe, 0x80af, 0x5543, - 0x57a6, 0x6073, 0x5751, 0x542d, 0x7a7a, 0x6050, 0x5b54, 0x63a7, - 0x62a0, 0x53e3, 0x6263, 0x5bc7, 0x67af, 0x54ed, 0x7a9f, 0x82e6, - 0x9177, 0x5e93, 0x88e4, 0x5938, 0x57ae, 0x630e, 0x8de8, 0x80ef, - 0x5757, 0x7b77, 0x4fa9, 0x5feb, 0x5bbd, 0x6b3e, 0x5321, 0x7b50, - 0x72c2, 0x6846, 0x77ff, 0x7736, 0x65f7, 0x51b5, 0x4e8f, 0x76d4, - 0x5cbf, 0x7aa5, 0x8475, 0x594e, 0x9b41, 0x5080, - /* 0x40 */ - 0x9988, 0x6127, 0x6e83, 0x5764, 0x6606, 0x6346, 0x56f0, 0x62ec, - 0x6269, 0x5ed3, 0x9614, 0x5783, 0x62c9, 0x5587, 0x8721, 0x814a, - 0x8fa3, 0x5566, 0x83b1, 0x6765, 0x8d56, 0x84dd, 0x5a6a, 0x680f, - 0x62e6, 0x7bee, 0x9611, 0x5170, 0x6f9c, 0x8c30, 0x63fd, 0x89c8, - 0x61d2, 0x7f06, 0x70c2, 0x6ee5, 0x7405, 0x6994, 0x72fc, 0x5eca, - 0x90ce, 0x6717, 0x6d6a, 0x635e, 0x52b3, 0x7262, 0x8001, 0x4f6c, - 0x59e5, 0x916a, 0x70d9, 0x6d9d, 0x52d2, 0x4e50, 0x96f7, 0x956d, - 0x857e, 0x78ca, 0x7d2f, 0x5121, 0x5792, 0x64c2, 0x808b, 0x7c7b, - 0x6cea, 0x68f1, 0x695e, 0x51b7, 0x5398, 0x68a8, 0x7281, 0x9ece, - 0x7bf1, 0x72f8, 0x79bb, 0x6f13, 0x7406, 0x674e, 0x91cc, 0x9ca4, - 0x793c, 0x8389, 0x8354, 0x540f, 0x6817, 0x4e3d, 0x5389, 0x52b1, - 0x783e, 0x5386, 0x5229, 0x5088, 0x4f8b, 0x4fd0, - /* 0x41 */ - 0x75e2, 0x7acb, 0x7c92, 0x6ca5, 0x96b6, 0x529b, 0x7483, 0x54e9, - 0x4fe9, 0x8054, 0x83b2, 0x8fde, 0x9570, 0x5ec9, 0x601c, 0x6d9f, - 0x5e18, 0x655b, 0x8138, 0x94fe, 0x604b, 0x70bc, 0x7ec3, 0x7cae, - 0x51c9, 0x6881, 0x7cb1, 0x826f, 0x4e24, 0x8f86, 0x91cf, 0x667e, - 0x4eae, 0x8c05, 0x64a9, 0x804a, 0x50da, 0x7597, 0x71ce, 0x5be5, - 0x8fbd, 0x6f66, 0x4e86, 0x6482, 0x9563, 0x5ed6, 0x6599, 0x5217, - 0x88c2, 0x70c8, 0x52a3, 0x730e, 0x7433, 0x6797, 0x78f7, 0x9716, - 0x4e34, 0x90bb, 0x9cde, 0x6dcb, 0x51db, 0x8d41, 0x541d, 0x62ce, - 0x73b2, 0x83f1, 0x96f6, 0x9f84, 0x94c3, 0x4f36, 0x7f9a, 0x51cc, - 0x7075, 0x9675, 0x5cad, 0x9886, 0x53e6, 0x4ee4, 0x6e9c, 0x7409, - 0x69b4, 0x786b, 0x998f, 0x7559, 0x5218, 0x7624, 0x6d41, 0x67f3, - 0x516d, 0x9f99, 0x804b, 0x5499, 0x7b3c, 0x7abf, - /* 0x42 */ - 0x9686, 0x5784, 0x62e2, 0x9647, 0x697c, 0x5a04, 0x6402, 0x7bd3, - 0x6f0f, 0x964b, 0x82a6, 0x5362, 0x9885, 0x5e90, 0x7089, 0x63b3, - 0x5364, 0x864f, 0x9c81, 0x9e93, 0x788c, 0x9732, 0x8def, 0x8d42, - 0x9e7f, 0x6f5e, 0x7984, 0x5f55, 0x9646, 0x622e, 0x9a74, 0x5415, - 0x94dd, 0x4fa3, 0x65c5, 0x5c65, 0x5c61, 0x7f15, 0x8651, 0x6c2f, - 0x5f8b, 0x7387, 0x6ee4, 0x7eff, 0x5ce6, 0x631b, 0x5b6a, 0x6ee6, - 0x5375, 0x4e71, 0x63a0, 0x7565, 0x62a1, 0x8f6e, 0x4f26, 0x4ed1, - 0x6ca6, 0x7eb6, 0x8bba, 0x841d, 0x87ba, 0x7f57, 0x903b, 0x9523, - 0x7ba9, 0x9aa1, 0x88f8, 0x843d, 0x6d1b, 0x9a86, 0x7edc, 0x5988, - 0x9ebb, 0x739b, 0x7801, 0x8682, 0x9a6c, 0x9a82, 0x561b, 0x5417, - 0x57cb, 0x4e70, 0x9ea6, 0x5356, 0x8fc8, 0x8109, 0x7792, 0x9992, - 0x86ee, 0x6ee1, 0x8513, 0x66fc, 0x6162, 0x6f2b, - /* 0x43 */ - 0x8c29, 0x8292, 0x832b, 0x76f2, 0x6c13, 0x5fd9, 0x83bd, 0x732b, - 0x8305, 0x951a, 0x6bdb, 0x77db, 0x94c6, 0x536f, 0x8302, 0x5192, - 0x5e3d, 0x8c8c, 0x8d38, 0x4e48, 0x73ab, 0x679a, 0x6885, 0x9176, - 0x9709, 0x7164, 0x6ca1, 0x7709, 0x5a92, 0x9541, 0x6bcf, 0x7f8e, - 0x6627, 0x5bd0, 0x59b9, 0x5a9a, 0x95e8, 0x95f7, 0x4eec, 0x840c, - 0x8499, 0x6aac, 0x76df, 0x9530, 0x731b, 0x68a6, 0x5b5f, 0x772f, - 0x919a, 0x9761, 0x7cdc, 0x8ff7, 0x8c1c, 0x5f25, 0x7c73, 0x79d8, - 0x89c5, 0x6ccc, 0x871c, 0x5bc6, 0x5e42, 0x68c9, 0x7720, 0x7ef5, - 0x5195, 0x514d, 0x52c9, 0x5a29, 0x7f05, 0x9762, 0x82d7, 0x63cf, - 0x7784, 0x85d0, 0x79d2, 0x6e3a, 0x5e99, 0x5999, 0x8511, 0x706d, - 0x6c11, 0x62bf, 0x76bf, 0x654f, 0x60af, 0x95fd, 0x660e, 0x879f, - 0x9e23, 0x94ed, 0x540d, 0x547d, 0x8c2c, 0x6478, - /* 0x44 */ - 0x6479, 0x8611, 0x6a21, 0x819c, 0x78e8, 0x6469, 0x9b54, 0x62b9, - 0x672b, 0x83ab, 0x58a8, 0x9ed8, 0x6cab, 0x6f20, 0x5bde, 0x964c, - 0x8c0b, 0x725f, 0x67d0, 0x62c7, 0x7261, 0x4ea9, 0x59c6, 0x6bcd, - 0x5893, 0x66ae, 0x5e55, 0x52df, 0x6155, 0x6728, 0x76ee, 0x7766, - 0x7267, 0x7a46, 0x62ff, 0x54ea, 0x5450, 0x94a0, 0x90a3, 0x5a1c, - 0x7eb3, 0x6c16, 0x4e43, 0x5976, 0x8010, 0x5948, 0x5357, 0x7537, - 0x96be, 0x56ca, 0x6320, 0x8111, 0x607c, 0x95f9, 0x6dd6, 0x5462, - 0x9981, 0x5185, 0x5ae9, 0x80fd, 0x59ae, 0x9713, 0x502a, 0x6ce5, - 0x5c3c, 0x62df, 0x4f60, 0x533f, 0x817b, 0x9006, 0x6eba, 0x852b, - 0x62c8, 0x5e74, 0x78be, 0x64b5, 0x637b, 0x5ff5, 0x5a18, 0x917f, - 0x9e1f, 0x5c3f, 0x634f, 0x8042, 0x5b7d, 0x556e, 0x954a, 0x954d, - 0x6d85, 0x60a8, 0x67e0, 0x72de, 0x51dd, 0x5b81, - /* 0x45 */ - 0x62e7, 0x6cde, 0x725b, 0x626d, 0x94ae, 0x7ebd, 0x8113, 0x6d53, - 0x519c, 0x5f04, 0x5974, 0x52aa, 0x6012, 0x5973, 0x6696, 0x8650, - 0x759f, 0x632a, 0x61e6, 0x7cef, 0x8bfa, 0x54e6, 0x6b27, 0x9e25, - 0x6bb4, 0x85d5, 0x5455, 0x5076, 0x6ca4, 0x556a, 0x8db4, 0x722c, - 0x5e15, 0x6015, 0x7436, 0x62cd, 0x6392, 0x724c, 0x5f98, 0x6e43, - 0x6d3e, 0x6500, 0x6f58, 0x76d8, 0x78d0, 0x76fc, 0x7554, 0x5224, - 0x53db, 0x4e53, 0x5e9e, 0x65c1, 0x802a, 0x80d6, 0x629b, 0x5486, - 0x5228, 0x70ae, 0x888d, 0x8dd1, 0x6ce1, 0x5478, 0x80da, 0x57f9, - 0x88f4, 0x8d54, 0x966a, 0x914d, 0x4f69, 0x6c9b, 0x55b7, 0x76c6, - 0x7830, 0x62a8, 0x70f9, 0x6f8e, 0x5f6d, 0x84ec, 0x68da, 0x787c, - 0x7bf7, 0x81a8, 0x670b, 0x9e4f, 0x6367, 0x78b0, 0x576f, 0x7812, - 0x9739, 0x6279, 0x62ab, 0x5288, 0x7435, 0x6bd7, - /* 0x46 */ - 0x5564, 0x813e, 0x75b2, 0x76ae, 0x5339, 0x75de, 0x50fb, 0x5c41, - 0x8b6c, 0x7bc7, 0x504f, 0x7247, 0x9a97, 0x98d8, 0x6f02, 0x74e2, - 0x7968, 0x6487, 0x77a5, 0x62fc, 0x9891, 0x8d2b, 0x54c1, 0x8058, - 0x4e52, 0x576a, 0x82f9, 0x840d, 0x5e73, 0x51ed, 0x74f6, 0x8bc4, - 0x5c4f, 0x5761, 0x6cfc, 0x9887, 0x5a46, 0x7834, 0x9b44, 0x8feb, - 0x7c95, 0x5256, 0x6251, 0x94fa, 0x4ec6, 0x8386, 0x8461, 0x83e9, - 0x84b2, 0x57d4, 0x6734, 0x5703, 0x666e, 0x6d66, 0x8c31, 0x66dd, - 0x7011, 0x671f, 0x6b3a, 0x6816, 0x621a, 0x59bb, 0x4e03, 0x51c4, - 0x6f06, 0x67d2, 0x6c8f, 0x5176, 0x68cb, 0x5947, 0x6b67, 0x7566, - 0x5d0e, 0x8110, 0x9f50, 0x65d7, 0x7948, 0x7941, 0x9a91, 0x8d77, - 0x5c82, 0x4e5e, 0x4f01, 0x542f, 0x5951, 0x780c, 0x5668, 0x6c14, - 0x8fc4, 0x5f03, 0x6c7d, 0x6ce3, 0x8bab, 0x6390, - /* 0x47 */ - 0x6070, 0x6d3d, 0x7275, 0x6266, 0x948e, 0x94c5, 0x5343, 0x8fc1, - 0x7b7e, 0x4edf, 0x8c26, 0x4e7e, 0x9ed4, 0x94b1, 0x94b3, 0x524d, - 0x6f5c, 0x9063, 0x6d45, 0x8c34, 0x5811, 0x5d4c, 0x6b20, 0x6b49, - 0x67aa, 0x545b, 0x8154, 0x7f8c, 0x5899, 0x8537, 0x5f3a, 0x62a2, - 0x6a47, 0x9539, 0x6572, 0x6084, 0x6865, 0x77a7, 0x4e54, 0x4fa8, - 0x5de7, 0x9798, 0x64ac, 0x7fd8, 0x5ced, 0x4fcf, 0x7a8d, 0x5207, - 0x8304, 0x4e14, 0x602f, 0x7a83, 0x94a6, 0x4fb5, 0x4eb2, 0x79e6, - 0x7434, 0x52e4, 0x82b9, 0x64d2, 0x79bd, 0x5bdd, 0x6c81, 0x9752, - 0x8f7b, 0x6c22, 0x503e, 0x537f, 0x6e05, 0x64ce, 0x6674, 0x6c30, - 0x60c5, 0x9877, 0x8bf7, 0x5e86, 0x743c, 0x7a77, 0x79cb, 0x4e18, - 0x90b1, 0x7403, 0x6c42, 0x56da, 0x914b, 0x6cc5, 0x8d8b, 0x533a, - 0x86c6, 0x66f2, 0x8eaf, 0x5c48, 0x9a71, 0x6e20, - /* 0x48 */ - 0x53d6, 0x5a36, 0x9f8b, 0x8da3, 0x53bb, 0x5708, 0x98a7, 0x6743, - 0x919b, 0x6cc9, 0x5168, 0x75ca, 0x62f3, 0x72ac, 0x5238, 0x529d, - 0x7f3a, 0x7094, 0x7638, 0x5374, 0x9e4a, 0x69b7, 0x786e, 0x96c0, - 0x88d9, 0x7fa4, 0x7136, 0x71c3, 0x5189, 0x67d3, 0x74e4, 0x58e4, - 0x6518, 0x56b7, 0x8ba9, 0x9976, 0x6270, 0x7ed5, 0x60f9, 0x70ed, - 0x58ec, 0x4ec1, 0x4eba, 0x5fcd, 0x97e7, 0x4efb, 0x8ba4, 0x5203, - 0x598a, 0x7eab, 0x6254, 0x4ecd, 0x65e5, 0x620e, 0x8338, 0x84c9, - 0x8363, 0x878d, 0x7194, 0x6eb6, 0x5bb9, 0x7ed2, 0x5197, 0x63c9, - 0x67d4, 0x8089, 0x8339, 0x8815, 0x5112, 0x5b7a, 0x5982, 0x8fb1, - 0x4e73, 0x6c5d, 0x5165, 0x8925, 0x8f6f, 0x962e, 0x854a, 0x745e, - 0x9510, 0x95f0, 0x6da6, 0x82e5, 0x5f31, 0x6492, 0x6d12, 0x8428, - 0x816e, 0x9cc3, 0x585e, 0x8d5b, 0x4e09, 0x53c1, - /* 0x49 */ - 0x4f1e, 0x6563, 0x6851, 0x55d3, 0x4e27, 0x6414, 0x9a9a, 0x626b, - 0x5ac2, 0x745f, 0x8272, 0x6da9, 0x68ee, 0x50e7, 0x838e, 0x7802, - 0x6740, 0x5239, 0x6c99, 0x7eb1, 0x50bb, 0x5565, 0x715e, 0x7b5b, - 0x6652, 0x73ca, 0x82eb, 0x6749, 0x5c71, 0x5220, 0x717d, 0x886b, - 0x95ea, 0x9655, 0x64c5, 0x8d61, 0x81b3, 0x5584, 0x6c55, 0x6247, - 0x7f2e, 0x5892, 0x4f24, 0x5546, 0x8d4f, 0x664c, 0x4e0a, 0x5c1a, - 0x88f3, 0x68a2, 0x634e, 0x7a0d, 0x70e7, 0x828d, 0x52fa, 0x97f6, - 0x5c11, 0x54e8, 0x90b5, 0x7ecd, 0x5962, 0x8d4a, 0x86c7, 0x820c, - 0x820d, 0x8d66, 0x6444, 0x5c04, 0x6151, 0x6d89, 0x793e, 0x8bbe, - 0x7837, 0x7533, 0x547b, 0x4f38, 0x8eab, 0x6df1, 0x5a20, 0x7ec5, - 0x795e, 0x6c88, 0x5ba1, 0x5a76, 0x751a, 0x80be, 0x614e, 0x6e17, - 0x58f0, 0x751f, 0x7525, 0x7272, 0x5347, 0x7ef3, - /* 0x4a */ - 0x7701, 0x76db, 0x5269, 0x80dc, 0x5723, 0x5e08, 0x5931, 0x72ee, - 0x65bd, 0x6e7f, 0x8bd7, 0x5c38, 0x8671, 0x5341, 0x77f3, 0x62fe, - 0x65f6, 0x4ec0, 0x98df, 0x8680, 0x5b9e, 0x8bc6, 0x53f2, 0x77e2, - 0x4f7f, 0x5c4e, 0x9a76, 0x59cb, 0x5f0f, 0x793a, 0x58eb, 0x4e16, - 0x67ff, 0x4e8b, 0x62ed, 0x8a93, 0x901d, 0x52bf, 0x662f, 0x55dc, - 0x566c, 0x9002, 0x4ed5, 0x4f8d, 0x91ca, 0x9970, 0x6c0f, 0x5e02, - 0x6043, 0x5ba4, 0x89c6, 0x8bd5, 0x6536, 0x624b, 0x9996, 0x5b88, - 0x5bff, 0x6388, 0x552e, 0x53d7, 0x7626, 0x517d, 0x852c, 0x67a2, - 0x68b3, 0x6b8a, 0x6292, 0x8f93, 0x53d4, 0x8212, 0x6dd1, 0x758f, - 0x4e66, 0x8d4e, 0x5b70, 0x719f, 0x85af, 0x6691, 0x66d9, 0x7f72, - 0x8700, 0x9ecd, 0x9f20, 0x5c5e, 0x672f, 0x8ff0, 0x6811, 0x675f, - 0x620d, 0x7ad6, 0x5885, 0x5eb6, 0x6570, 0x6f31, - /* 0x4b */ - 0x6055, 0x5237, 0x800d, 0x6454, 0x8870, 0x7529, 0x5e05, 0x6813, - 0x62f4, 0x971c, 0x53cc, 0x723d, 0x8c01, 0x6c34, 0x7761, 0x7a0e, - 0x542e, 0x77ac, 0x987a, 0x821c, 0x8bf4, 0x7855, 0x6714, 0x70c1, - 0x65af, 0x6495, 0x5636, 0x601d, 0x79c1, 0x53f8, 0x4e1d, 0x6b7b, - 0x8086, 0x5bfa, 0x55e3, 0x56db, 0x4f3a, 0x4f3c, 0x9972, 0x5df3, - 0x677e, 0x8038, 0x6002, 0x9882, 0x9001, 0x5b8b, 0x8bbc, 0x8bf5, - 0x641c, 0x8258, 0x64de, 0x55fd, 0x82cf, 0x9165, 0x4fd7, 0x7d20, - 0x901f, 0x7c9f, 0x50f3, 0x5851, 0x6eaf, 0x5bbf, 0x8bc9, 0x8083, - 0x9178, 0x849c, 0x7b97, 0x867d, 0x968b, 0x968f, 0x7ee5, 0x9ad3, - 0x788e, 0x5c81, 0x7a57, 0x9042, 0x96a7, 0x795f, 0x5b59, 0x635f, - 0x7b0b, 0x84d1, 0x68ad, 0x5506, 0x7f29, 0x7410, 0x7d22, 0x9501, - 0x6240, 0x584c, 0x4ed6, 0x5b83, 0x5979, 0x5854, - /* 0x4c */ - 0x736d, 0x631e, 0x8e4b, 0x8e0f, 0x80ce, 0x82d4, 0x62ac, 0x53f0, - 0x6cf0, 0x915e, 0x592a, 0x6001, 0x6c70, 0x574d, 0x644a, 0x8d2a, - 0x762b, 0x6ee9, 0x575b, 0x6a80, 0x75f0, 0x6f6d, 0x8c2d, 0x8c08, - 0x5766, 0x6bef, 0x8892, 0x78b3, 0x63a2, 0x53f9, 0x70ad, 0x6c64, - 0x5858, 0x642a, 0x5802, 0x68e0, 0x819b, 0x5510, 0x7cd6, 0x5018, - 0x8eba, 0x6dcc, 0x8d9f, 0x70eb, 0x638f, 0x6d9b, 0x6ed4, 0x7ee6, - 0x8404, 0x6843, 0x9003, 0x6dd8, 0x9676, 0x8ba8, 0x5957, 0x7279, - 0x85e4, 0x817e, 0x75bc, 0x8a8a, 0x68af, 0x5254, 0x8e22, 0x9511, - 0x63d0, 0x9898, 0x8e44, 0x557c, 0x4f53, 0x66ff, 0x568f, 0x60d5, - 0x6d95, 0x5243, 0x5c49, 0x5929, 0x6dfb, 0x586b, 0x7530, 0x751c, - 0x606c, 0x8214, 0x8146, 0x6311, 0x6761, 0x8fe2, 0x773a, 0x8df3, - 0x8d34, 0x94c1, 0x5e16, 0x5385, 0x542c, 0x70c3, - /* 0x4d */ - 0x6c40, 0x5ef7, 0x505c, 0x4ead, 0x5ead, 0x633a, 0x8247, 0x901a, - 0x6850, 0x916e, 0x77b3, 0x540c, 0x94dc, 0x5f64, 0x7ae5, 0x6876, - 0x6345, 0x7b52, 0x7edf, 0x75db, 0x5077, 0x6295, 0x5934, 0x900f, - 0x51f8, 0x79c3, 0x7a81, 0x56fe, 0x5f92, 0x9014, 0x6d82, 0x5c60, - 0x571f, 0x5410, 0x5154, 0x6e4d, 0x56e2, 0x63a8, 0x9893, 0x817f, - 0x8715, 0x892a, 0x9000, 0x541e, 0x5c6f, 0x81c0, 0x62d6, 0x6258, - 0x8131, 0x9e35, 0x9640, 0x9a6e, 0x9a7c, 0x692d, 0x59a5, 0x62d3, - 0x553e, 0x6316, 0x54c7, 0x86d9, 0x6d3c, 0x5a03, 0x74e6, 0x889c, - 0x6b6a, 0x5916, 0x8c4c, 0x5f2f, 0x6e7e, 0x73a9, 0x987d, 0x4e38, - 0x70f7, 0x5b8c, 0x7897, 0x633d, 0x665a, 0x7696, 0x60cb, 0x5b9b, - 0x5a49, 0x4e07, 0x8155, 0x6c6a, 0x738b, 0x4ea1, 0x6789, 0x7f51, - 0x5f80, 0x65fa, 0x671b, 0x5fd8, 0x5984, 0x5a01, - /* 0x4e */ - 0x5dcd, 0x5fae, 0x5371, 0x97e6, 0x8fdd, 0x6845, 0x56f4, 0x552f, - 0x60df, 0x4e3a, 0x6f4d, 0x7ef4, 0x82c7, 0x840e, 0x59d4, 0x4f1f, - 0x4f2a, 0x5c3e, 0x7eac, 0x672a, 0x851a, 0x5473, 0x754f, 0x80c3, - 0x5582, 0x9b4f, 0x4f4d, 0x6e2d, 0x8c13, 0x5c09, 0x6170, 0x536b, - 0x761f, 0x6e29, 0x868a, 0x6587, 0x95fb, 0x7eb9, 0x543b, 0x7a33, - 0x7d0a, 0x95ee, 0x55e1, 0x7fc1, 0x74ee, 0x631d, 0x8717, 0x6da1, - 0x7a9d, 0x6211, 0x65a1, 0x5367, 0x63e1, 0x6c83, 0x5deb, 0x545c, - 0x94a8, 0x4e4c, 0x6c61, 0x8bec, 0x5c4b, 0x65e0, 0x829c, 0x68a7, - 0x543e, 0x5434, 0x6bcb, 0x6b66, 0x4e94, 0x6342, 0x5348, 0x821e, - 0x4f0d, 0x4fae, 0x575e, 0x620a, 0x96fe, 0x6664, 0x7269, 0x52ff, - 0x52a1, 0x609f, 0x8bef, 0x6614, 0x7199, 0x6790, 0x897f, 0x7852, - 0x77fd, 0x6670, 0x563b, 0x5438, 0x9521, 0x727a, - /* 0x4f */ - 0x7a00, 0x606f, 0x5e0c, 0x6089, 0x819d, 0x5915, 0x60dc, 0x7184, - 0x70ef, 0x6eaa, 0x6c50, 0x7280, 0x6a84, 0x88ad, 0x5e2d, 0x4e60, - 0x5ab3, 0x559c, 0x94e3, 0x6d17, 0x7cfb, 0x9699, 0x620f, 0x7ec6, - 0x778e, 0x867e, 0x5323, 0x971e, 0x8f96, 0x6687, 0x5ce1, 0x4fa0, - 0x72ed, 0x4e0b, 0x53a6, 0x590f, 0x5413, 0x6380, 0x9528, 0x5148, - 0x4ed9, 0x9c9c, 0x7ea4, 0x54b8, 0x8d24, 0x8854, 0x8237, 0x95f2, - 0x6d8e, 0x5f26, 0x5acc, 0x663e, 0x9669, 0x73b0, 0x732e, 0x53bf, - 0x817a, 0x9985, 0x7fa1, 0x5baa, 0x9677, 0x9650, 0x7ebf, 0x76f8, - 0x53a2, 0x9576, 0x9999, 0x7bb1, 0x8944, 0x6e58, 0x4e61, 0x7fd4, - 0x7965, 0x8be6, 0x60f3, 0x54cd, 0x4eab, 0x9879, 0x5df7, 0x6a61, - 0x50cf, 0x5411, 0x8c61, 0x8427, 0x785d, 0x9704, 0x524a, 0x54ee, - 0x56a3, 0x9500, 0x6d88, 0x5bb5, 0x6dc6, 0x6653, - /* 0x50 */ - 0x5c0f, 0x5b5d, 0x6821, 0x8096, 0x5578, 0x7b11, 0x6548, 0x6954, - 0x4e9b, 0x6b47, 0x874e, 0x978b, 0x534f, 0x631f, 0x643a, 0x90aa, - 0x659c, 0x80c1, 0x8c10, 0x5199, 0x68b0, 0x5378, 0x87f9, 0x61c8, - 0x6cc4, 0x6cfb, 0x8c22, 0x5c51, 0x85aa, 0x82af, 0x950c, 0x6b23, - 0x8f9b, 0x65b0, 0x5ffb, 0x5fc3, 0x4fe1, 0x8845, 0x661f, 0x8165, - 0x7329, 0x60fa, 0x5174, 0x5211, 0x578b, 0x5f62, 0x90a2, 0x884c, - 0x9192, 0x5e78, 0x674f, 0x6027, 0x59d3, 0x5144, 0x51f6, 0x80f8, - 0x5308, 0x6c79, 0x96c4, 0x718a, 0x4f11, 0x4fee, 0x7f9e, 0x673d, - 0x55c5, 0x9508, 0x79c0, 0x8896, 0x7ee3, 0x589f, 0x620c, 0x9700, - 0x865a, 0x5618, 0x987b, 0x5f90, 0x8bb8, 0x84c4, 0x9157, 0x53d9, - 0x65ed, 0x5e8f, 0x755c, 0x6064, 0x7d6e, 0x5a7f, 0x7eea, 0x7eed, - 0x8f69, 0x55a7, 0x5ba3, 0x60ac, 0x65cb, 0x7384, - /* 0x51 */ - 0x9009, 0x7663, 0x7729, 0x7eda, 0x9774, 0x859b, 0x5b66, 0x7a74, - 0x96ea, 0x8840, 0x52cb, 0x718f, 0x5faa, 0x65ec, 0x8be2, 0x5bfb, - 0x9a6f, 0x5de1, 0x6b89, 0x6c5b, 0x8bad, 0x8baf, 0x900a, 0x8fc5, - 0x538b, 0x62bc, 0x9e26, 0x9e2d, 0x5440, 0x4e2b, 0x82bd, 0x7259, - 0x869c, 0x5d16, 0x8859, 0x6daf, 0x96c5, 0x54d1, 0x4e9a, 0x8bb6, - 0x7109, 0x54bd, 0x9609, 0x70df, 0x6df9, 0x76d0, 0x4e25, 0x7814, - 0x8712, 0x5ca9, 0x5ef6, 0x8a00, 0x989c, 0x960e, 0x708e, 0x6cbf, - 0x5944, 0x63a9, 0x773c, 0x884d, 0x6f14, 0x8273, 0x5830, 0x71d5, - 0x538c, 0x781a, 0x96c1, 0x5501, 0x5f66, 0x7130, 0x5bb4, 0x8c1a, - 0x9a8c, 0x6b83, 0x592e, 0x9e2f, 0x79e7, 0x6768, 0x626c, 0x4f6f, - 0x75a1, 0x7f8a, 0x6d0b, 0x9633, 0x6c27, 0x4ef0, 0x75d2, 0x517b, - 0x6837, 0x6f3e, 0x9080, 0x8170, 0x5996, 0x7476, - /* 0x52 */ - 0x6447, 0x5c27, 0x9065, 0x7a91, 0x8c23, 0x59da, 0x54ac, 0x8200, - 0x836f, 0x8981, 0x8000, 0x6930, 0x564e, 0x8036, 0x7237, 0x91ce, - 0x51b6, 0x4e5f, 0x9875, 0x6396, 0x4e1a, 0x53f6, 0x66f3, 0x814b, - 0x591c, 0x6db2, 0x4e00, 0x58f9, 0x533b, 0x63d6, 0x94f1, 0x4f9d, - 0x4f0a, 0x8863, 0x9890, 0x5937, 0x9057, 0x79fb, 0x4eea, 0x80f0, - 0x7591, 0x6c82, 0x5b9c, 0x59e8, 0x5f5d, 0x6905, 0x8681, 0x501a, - 0x5df2, 0x4e59, 0x77e3, 0x4ee5, 0x827a, 0x6291, 0x6613, 0x9091, - 0x5c79, 0x4ebf, 0x5f79, 0x81c6, 0x9038, 0x8084, 0x75ab, 0x4ea6, - 0x88d4, 0x610f, 0x6bc5, 0x5fc6, 0x4e49, 0x76ca, 0x6ea2, 0x8be3, - 0x8bae, 0x8c0a, 0x8bd1, 0x5f02, 0x7ffc, 0x7fcc, 0x7ece, 0x8335, - 0x836b, 0x56e0, 0x6bb7, 0x97f3, 0x9634, 0x59fb, 0x541f, 0x94f6, - 0x6deb, 0x5bc5, 0x996e, 0x5c39, 0x5f15, 0x9690, - /* 0x53 */ - 0x5370, 0x82f1, 0x6a31, 0x5a74, 0x9e70, 0x5e94, 0x7f28, 0x83b9, - 0x8424, 0x8425, 0x8367, 0x8747, 0x8fce, 0x8d62, 0x76c8, 0x5f71, - 0x9896, 0x786c, 0x6620, 0x54df, 0x62e5, 0x4f63, 0x81c3, 0x75c8, - 0x5eb8, 0x96cd, 0x8e0a, 0x86f9, 0x548f, 0x6cf3, 0x6d8c, 0x6c38, - 0x607f, 0x52c7, 0x7528, 0x5e7d, 0x4f18, 0x60a0, 0x5fe7, 0x5c24, - 0x7531, 0x90ae, 0x94c0, 0x72b9, 0x6cb9, 0x6e38, 0x9149, 0x6709, - 0x53cb, 0x53f3, 0x4f51, 0x91c9, 0x8bf1, 0x53c8, 0x5e7c, 0x8fc2, - 0x6de4, 0x4e8e, 0x76c2, 0x6986, 0x865e, 0x611a, 0x8206, 0x4f59, - 0x4fde, 0x903e, 0x9c7c, 0x6109, 0x6e1d, 0x6e14, 0x9685, 0x4e88, - 0x5a31, 0x96e8, 0x4e0e, 0x5c7f, 0x79b9, 0x5b87, 0x8bed, 0x7fbd, - 0x7389, 0x57df, 0x828b, 0x90c1, 0x5401, 0x9047, 0x55bb, 0x5cea, - 0x5fa1, 0x6108, 0x6b32, 0x72f1, 0x80b2, 0x8a89, - /* 0x54 */ - 0x6d74, 0x5bd3, 0x88d5, 0x9884, 0x8c6b, 0x9a6d, 0x9e33, 0x6e0a, - 0x51a4, 0x5143, 0x57a3, 0x8881, 0x539f, 0x63f4, 0x8f95, 0x56ed, - 0x5458, 0x5706, 0x733f, 0x6e90, 0x7f18, 0x8fdc, 0x82d1, 0x613f, - 0x6028, 0x9662, 0x66f0, 0x7ea6, 0x8d8a, 0x8dc3, 0x94a5, 0x5cb3, - 0x7ca4, 0x6708, 0x60a6, 0x9605, 0x8018, 0x4e91, 0x90e7, 0x5300, - 0x9668, 0x5141, 0x8fd0, 0x8574, 0x915d, 0x6655, 0x97f5, 0x5b55, - 0x531d, 0x7838, 0x6742, 0x683d, 0x54c9, 0x707e, 0x5bb0, 0x8f7d, - 0x518d, 0x5728, 0x54b1, 0x6512, 0x6682, 0x8d5e, 0x8d43, 0x810f, - 0x846c, 0x906d, 0x7cdf, 0x51ff, 0x85fb, 0x67a3, 0x65e9, 0x6fa1, - 0x86a4, 0x8e81, 0x566a, 0x9020, 0x7682, 0x7076, 0x71e5, 0x8d23, - 0x62e9, 0x5219, 0x6cfd, 0x8d3c, 0x600e, 0x589e, 0x618e, 0x66fe, - 0x8d60, 0x624e, 0x55b3, 0x6e23, 0x672d, 0x8f67, - /* 0x55 */ - 0x94e1, 0x95f8, 0x7728, 0x6805, 0x69a8, 0x548b, 0x4e4d, 0x70b8, - 0x8bc8, 0x6458, 0x658b, 0x5b85, 0x7a84, 0x503a, 0x5be8, 0x77bb, - 0x6be1, 0x8a79, 0x7c98, 0x6cbe, 0x76cf, 0x65a9, 0x8f97, 0x5d2d, - 0x5c55, 0x8638, 0x6808, 0x5360, 0x6218, 0x7ad9, 0x6e5b, 0x7efd, - 0x6a1f, 0x7ae0, 0x5f70, 0x6f33, 0x5f20, 0x638c, 0x6da8, 0x6756, - 0x4e08, 0x5e10, 0x8d26, 0x4ed7, 0x80c0, 0x7634, 0x969c, 0x62db, - 0x662d, 0x627e, 0x6cbc, 0x8d75, 0x7167, 0x7f69, 0x5146, 0x8087, - 0x53ec, 0x906e, 0x6298, 0x54f2, 0x86f0, 0x8f99, 0x8005, 0x9517, - 0x8517, 0x8fd9, 0x6d59, 0x73cd, 0x659f, 0x771f, 0x7504, 0x7827, - 0x81fb, 0x8d1e, 0x9488, 0x4fa6, 0x6795, 0x75b9, 0x8bca, 0x9707, - 0x632f, 0x9547, 0x9635, 0x84b8, 0x6323, 0x7741, 0x5f81, 0x72f0, - 0x4e89, 0x6014, 0x6574, 0x62ef, 0x6b63, 0x653f, - /* 0x56 */ - 0x5e27, 0x75c7, 0x90d1, 0x8bc1, 0x829d, 0x679d, 0x652f, 0x5431, - 0x8718, 0x77e5, 0x80a2, 0x8102, 0x6c41, 0x4e4b, 0x7ec7, 0x804c, - 0x76f4, 0x690d, 0x6b96, 0x6267, 0x503c, 0x4f84, 0x5740, 0x6307, - 0x6b62, 0x8dbe, 0x53ea, 0x65e8, 0x7eb8, 0x5fd7, 0x631a, 0x63b7, - 0x81f3, 0x81f4, 0x7f6e, 0x5e1c, 0x5cd9, 0x5236, 0x667a, 0x79e9, - 0x7a1a, 0x8d28, 0x7099, 0x75d4, 0x6ede, 0x6cbb, 0x7a92, 0x4e2d, - 0x76c5, 0x5fe0, 0x949f, 0x8877, 0x7ec8, 0x79cd, 0x80bf, 0x91cd, - 0x4ef2, 0x4f17, 0x821f, 0x5468, 0x5dde, 0x6d32, 0x8bcc, 0x7ca5, - 0x8f74, 0x8098, 0x5e1a, 0x5492, 0x76b1, 0x5b99, 0x663c, 0x9aa4, - 0x73e0, 0x682a, 0x86db, 0x6731, 0x732a, 0x8bf8, 0x8bdb, 0x9010, - 0x7af9, 0x70db, 0x716e, 0x62c4, 0x77a9, 0x5631, 0x4e3b, 0x8457, - 0x67f1, 0x52a9, 0x86c0, 0x8d2e, 0x94f8, 0x7b51, - /* 0x57 */ - 0x4f4f, 0x6ce8, 0x795d, 0x9a7b, 0x6293, 0x722a, 0x62fd, 0x4e13, - 0x7816, 0x8f6c, 0x64b0, 0x8d5a, 0x7bc6, 0x6869, 0x5e84, 0x88c5, - 0x5986, 0x649e, 0x58ee, 0x72b6, 0x690e, 0x9525, 0x8ffd, 0x8d58, - 0x5760, 0x7f00, 0x8c06, 0x51c6, 0x6349, 0x62d9, 0x5353, 0x684c, - 0x7422, 0x8301, 0x914c, 0x5544, 0x7740, 0x707c, 0x6d4a, 0x5179, - 0x54a8, 0x8d44, 0x59ff, 0x6ecb, 0x6dc4, 0x5b5c, 0x7d2b, 0x4ed4, - 0x7c7d, 0x6ed3, 0x5b50, 0x81ea, 0x6e0d, 0x5b57, 0x9b03, 0x68d5, - 0x8e2a, 0x5b97, 0x7efc, 0x603b, 0x7eb5, 0x90b9, 0x8d70, 0x594f, - 0x63cd, 0x79df, 0x8db3, 0x5352, 0x65cf, 0x7956, 0x8bc5, 0x963b, - 0x7ec4, 0x94bb, 0x7e82, 0x5634, 0x9189, 0x6700, 0x7f6a, 0x5c0a, - 0x9075, 0x6628, 0x5de6, 0x4f50, 0x67de, 0x505a, 0x4f5c, 0x5750, - 0x5ea7, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - /* 0x58 */ - 0x4e8d, 0x4e0c, 0x5140, 0x4e10, 0x5eff, 0x5345, 0x4e15, 0x4e98, - 0x4e1e, 0x9b32, 0x5b6c, 0x5669, 0x4e28, 0x79ba, 0x4e3f, 0x5315, - 0x4e47, 0x592d, 0x723b, 0x536e, 0x6c10, 0x56df, 0x80e4, 0x9997, - 0x6bd3, 0x777e, 0x9f17, 0x4e36, 0x4e9f, 0x9f10, 0x4e5c, 0x4e69, - 0x4e93, 0x8288, 0x5b5b, 0x556c, 0x560f, 0x4ec4, 0x538d, 0x539d, - 0x53a3, 0x53a5, 0x53ae, 0x9765, 0x8d5d, 0x531a, 0x53f5, 0x5326, - 0x532e, 0x533e, 0x8d5c, 0x5366, 0x5363, 0x5202, 0x5208, 0x520e, - 0x522d, 0x5233, 0x523f, 0x5240, 0x524c, 0x525e, 0x5261, 0x525c, - 0x84af, 0x527d, 0x5282, 0x5281, 0x5290, 0x5293, 0x5182, 0x7f54, - 0x4ebb, 0x4ec3, 0x4ec9, 0x4ec2, 0x4ee8, 0x4ee1, 0x4eeb, 0x4ede, - 0x4f1b, 0x4ef3, 0x4f22, 0x4f64, 0x4ef5, 0x4f25, 0x4f27, 0x4f09, - 0x4f2b, 0x4f5e, 0x4f67, 0x6538, 0x4f5a, 0x4f5d, - /* 0x59 */ - 0x4f5f, 0x4f57, 0x4f32, 0x4f3d, 0x4f76, 0x4f74, 0x4f91, 0x4f89, - 0x4f83, 0x4f8f, 0x4f7e, 0x4f7b, 0x4faa, 0x4f7c, 0x4fac, 0x4f94, - 0x4fe6, 0x4fe8, 0x4fea, 0x4fc5, 0x4fda, 0x4fe3, 0x4fdc, 0x4fd1, - 0x4fdf, 0x4ff8, 0x5029, 0x504c, 0x4ff3, 0x502c, 0x500f, 0x502e, - 0x502d, 0x4ffe, 0x501c, 0x500c, 0x5025, 0x5028, 0x507e, 0x5043, - 0x5055, 0x5048, 0x504e, 0x506c, 0x507b, 0x50a5, 0x50a7, 0x50a9, - 0x50ba, 0x50d6, 0x5106, 0x50ed, 0x50ec, 0x50e6, 0x50ee, 0x5107, - 0x510b, 0x4edd, 0x6c3d, 0x4f58, 0x4f65, 0x4fce, 0x9fa0, 0x6c46, - 0x7c74, 0x516e, 0x5dfd, 0x9ec9, 0x9998, 0x5181, 0x5914, 0x52f9, - 0x530d, 0x8a07, 0x5310, 0x51eb, 0x5919, 0x5155, 0x4ea0, 0x5156, - 0x4eb3, 0x886e, 0x88a4, 0x4eb5, 0x8114, 0x88d2, 0x7980, 0x5b34, - 0x8803, 0x7fb8, 0x51ab, 0x51b1, 0x51bd, 0x51bc, - /* 0x5a */ - 0x51c7, 0x5196, 0x51a2, 0x51a5, 0x8ba0, 0x8ba6, 0x8ba7, 0x8baa, - 0x8bb4, 0x8bb5, 0x8bb7, 0x8bc2, 0x8bc3, 0x8bcb, 0x8bcf, 0x8bce, - 0x8bd2, 0x8bd3, 0x8bd4, 0x8bd6, 0x8bd8, 0x8bd9, 0x8bdc, 0x8bdf, - 0x8be0, 0x8be4, 0x8be8, 0x8be9, 0x8bee, 0x8bf0, 0x8bf3, 0x8bf6, - 0x8bf9, 0x8bfc, 0x8bff, 0x8c00, 0x8c02, 0x8c04, 0x8c07, 0x8c0c, - 0x8c0f, 0x8c11, 0x8c12, 0x8c14, 0x8c15, 0x8c16, 0x8c19, 0x8c1b, - 0x8c18, 0x8c1d, 0x8c1f, 0x8c20, 0x8c21, 0x8c25, 0x8c27, 0x8c2a, - 0x8c2b, 0x8c2e, 0x8c2f, 0x8c32, 0x8c33, 0x8c35, 0x8c36, 0x5369, - 0x537a, 0x961d, 0x9622, 0x9621, 0x9631, 0x962a, 0x963d, 0x963c, - 0x9642, 0x9649, 0x9654, 0x965f, 0x9667, 0x966c, 0x9672, 0x9674, - 0x9688, 0x968d, 0x9697, 0x96b0, 0x9097, 0x909b, 0x909d, 0x9099, - 0x90ac, 0x90a1, 0x90b4, 0x90b3, 0x90b6, 0x90ba, - /* 0x5b */ - 0x90b8, 0x90b0, 0x90cf, 0x90c5, 0x90be, 0x90d0, 0x90c4, 0x90c7, - 0x90d3, 0x90e6, 0x90e2, 0x90dc, 0x90d7, 0x90db, 0x90eb, 0x90ef, - 0x90fe, 0x9104, 0x9122, 0x911e, 0x9123, 0x9131, 0x912f, 0x9139, - 0x9143, 0x9146, 0x520d, 0x5942, 0x52a2, 0x52ac, 0x52ad, 0x52be, - 0x54ff, 0x52d0, 0x52d6, 0x52f0, 0x53df, 0x71ee, 0x77cd, 0x5ef4, - 0x51f5, 0x51fc, 0x9b2f, 0x53b6, 0x5f01, 0x755a, 0x5def, 0x574c, - 0x57a9, 0x57a1, 0x587e, 0x58bc, 0x58c5, 0x58d1, 0x5729, 0x572c, - 0x572a, 0x5733, 0x5739, 0x572e, 0x572f, 0x575c, 0x573b, 0x5742, - 0x5769, 0x5785, 0x576b, 0x5786, 0x577c, 0x577b, 0x5768, 0x576d, - 0x5776, 0x5773, 0x57ad, 0x57a4, 0x578c, 0x57b2, 0x57cf, 0x57a7, - 0x57b4, 0x5793, 0x57a0, 0x57d5, 0x57d8, 0x57da, 0x57d9, 0x57d2, - 0x57b8, 0x57f4, 0x57ef, 0x57f8, 0x57e4, 0x57dd, - /* 0x5c */ - 0x580b, 0x580d, 0x57fd, 0x57ed, 0x5800, 0x581e, 0x5819, 0x5844, - 0x5820, 0x5865, 0x586c, 0x5881, 0x5889, 0x589a, 0x5880, 0x99a8, - 0x9f19, 0x61ff, 0x8279, 0x827d, 0x827f, 0x828f, 0x828a, 0x82a8, - 0x8284, 0x828e, 0x8291, 0x8297, 0x8299, 0x82ab, 0x82b8, 0x82be, - 0x82b0, 0x82c8, 0x82ca, 0x82e3, 0x8298, 0x82b7, 0x82ae, 0x82cb, - 0x82cc, 0x82c1, 0x82a9, 0x82b4, 0x82a1, 0x82aa, 0x829f, 0x82c4, - 0x82ce, 0x82a4, 0x82e1, 0x8309, 0x82f7, 0x82e4, 0x830f, 0x8307, - 0x82dc, 0x82f4, 0x82d2, 0x82d8, 0x830c, 0x82fb, 0x82d3, 0x8311, - 0x831a, 0x8306, 0x8314, 0x8315, 0x82e0, 0x82d5, 0x831c, 0x8351, - 0x835b, 0x835c, 0x8308, 0x8392, 0x833c, 0x8334, 0x8331, 0x839b, - 0x835e, 0x832f, 0x834f, 0x8347, 0x8343, 0x835f, 0x8340, 0x8317, - 0x8360, 0x832d, 0x833a, 0x8333, 0x8366, 0x8365, - /* 0x5d */ - 0x8368, 0x831b, 0x8369, 0x836c, 0x836a, 0x836d, 0x836e, 0x83b0, - 0x8378, 0x83b3, 0x83b4, 0x83a0, 0x83aa, 0x8393, 0x839c, 0x8385, - 0x837c, 0x83b6, 0x83a9, 0x837d, 0x83b8, 0x837b, 0x8398, 0x839e, - 0x83a8, 0x83ba, 0x83bc, 0x83c1, 0x8401, 0x83e5, 0x83d8, 0x5807, - 0x8418, 0x840b, 0x83dd, 0x83fd, 0x83d6, 0x841c, 0x8438, 0x8411, - 0x8406, 0x83d4, 0x83df, 0x840f, 0x8403, 0x83f8, 0x83f9, 0x83ea, - 0x83c5, 0x83c0, 0x8426, 0x83f0, 0x83e1, 0x845c, 0x8451, 0x845a, - 0x8459, 0x8473, 0x8487, 0x8488, 0x847a, 0x8489, 0x8478, 0x843c, - 0x8446, 0x8469, 0x8476, 0x848c, 0x848e, 0x8431, 0x846d, 0x84c1, - 0x84cd, 0x84d0, 0x84e6, 0x84bd, 0x84d3, 0x84ca, 0x84bf, 0x84ba, - 0x84e0, 0x84a1, 0x84b9, 0x84b4, 0x8497, 0x84e5, 0x84e3, 0x850c, - 0x750d, 0x8538, 0x84f0, 0x8539, 0x851f, 0x853a, - /* 0x5e */ - 0x8556, 0x853b, 0x84ff, 0x84fc, 0x8559, 0x8548, 0x8568, 0x8564, - 0x855e, 0x857a, 0x77a2, 0x8543, 0x8572, 0x857b, 0x85a4, 0x85a8, - 0x8587, 0x858f, 0x8579, 0x85ae, 0x859c, 0x8585, 0x85b9, 0x85b7, - 0x85b0, 0x85d3, 0x85c1, 0x85dc, 0x85ff, 0x8627, 0x8605, 0x8629, - 0x8616, 0x863c, 0x5efe, 0x5f08, 0x593c, 0x5941, 0x8037, 0x5955, - 0x595a, 0x5958, 0x530f, 0x5c22, 0x5c25, 0x5c2c, 0x5c34, 0x624c, - 0x626a, 0x629f, 0x62bb, 0x62ca, 0x62da, 0x62d7, 0x62ee, 0x6322, - 0x62f6, 0x6339, 0x634b, 0x6343, 0x63ad, 0x63f6, 0x6371, 0x637a, - 0x638e, 0x63b4, 0x636d, 0x63ac, 0x638a, 0x6369, 0x63ae, 0x63bc, - 0x63f2, 0x63f8, 0x63e0, 0x63ff, 0x63c4, 0x63de, 0x63ce, 0x6452, - 0x63c6, 0x63be, 0x6445, 0x6441, 0x640b, 0x641b, 0x6420, 0x640c, - 0x6426, 0x6421, 0x645e, 0x6484, 0x646d, 0x6496, - /* 0x5f */ - 0x647a, 0x64b7, 0x64b8, 0x6499, 0x64ba, 0x64c0, 0x64d0, 0x64d7, - 0x64e4, 0x64e2, 0x6509, 0x6525, 0x652e, 0x5f0b, 0x5fd2, 0x7519, - 0x5f11, 0x535f, 0x53f1, 0x53fd, 0x53e9, 0x53e8, 0x53fb, 0x5412, - 0x5416, 0x5406, 0x544b, 0x5452, 0x5453, 0x5454, 0x5456, 0x5443, - 0x5421, 0x5457, 0x5459, 0x5423, 0x5432, 0x5482, 0x5494, 0x5477, - 0x5471, 0x5464, 0x549a, 0x549b, 0x5484, 0x5476, 0x5466, 0x549d, - 0x54d0, 0x54ad, 0x54c2, 0x54b4, 0x54d2, 0x54a7, 0x54a6, 0x54d3, - 0x54d4, 0x5472, 0x54a3, 0x54d5, 0x54bb, 0x54bf, 0x54cc, 0x54d9, - 0x54da, 0x54dc, 0x54a9, 0x54aa, 0x54a4, 0x54dd, 0x54cf, 0x54de, - 0x551b, 0x54e7, 0x5520, 0x54fd, 0x5514, 0x54f3, 0x5522, 0x5523, - 0x550f, 0x5511, 0x5527, 0x552a, 0x5567, 0x558f, 0x55b5, 0x5549, - 0x556d, 0x5541, 0x5555, 0x553f, 0x5550, 0x553c, - /* 0x60 */ - 0x5537, 0x5556, 0x5575, 0x5576, 0x5577, 0x5533, 0x5530, 0x555c, - 0x558b, 0x55d2, 0x5583, 0x55b1, 0x55b9, 0x5588, 0x5581, 0x559f, - 0x557e, 0x55d6, 0x5591, 0x557b, 0x55df, 0x55bd, 0x55be, 0x5594, - 0x5599, 0x55ea, 0x55f7, 0x55c9, 0x561f, 0x55d1, 0x55eb, 0x55ec, - 0x55d4, 0x55e6, 0x55dd, 0x55c4, 0x55ef, 0x55e5, 0x55f2, 0x55f3, - 0x55cc, 0x55cd, 0x55e8, 0x55f5, 0x55e4, 0x8f94, 0x561e, 0x5608, - 0x560c, 0x5601, 0x5624, 0x5623, 0x55fe, 0x5600, 0x5627, 0x562d, - 0x5658, 0x5639, 0x5657, 0x562c, 0x564d, 0x5662, 0x5659, 0x565c, - 0x564c, 0x5654, 0x5686, 0x5664, 0x5671, 0x566b, 0x567b, 0x567c, - 0x5685, 0x5693, 0x56af, 0x56d4, 0x56d7, 0x56dd, 0x56e1, 0x56f5, - 0x56eb, 0x56f9, 0x56ff, 0x5704, 0x570a, 0x5709, 0x571c, 0x5e0f, - 0x5e19, 0x5e14, 0x5e11, 0x5e31, 0x5e3b, 0x5e3c, - /* 0x61 */ - 0x5e37, 0x5e44, 0x5e54, 0x5e5b, 0x5e5e, 0x5e61, 0x5c8c, 0x5c7a, - 0x5c8d, 0x5c90, 0x5c96, 0x5c88, 0x5c98, 0x5c99, 0x5c91, 0x5c9a, - 0x5c9c, 0x5cb5, 0x5ca2, 0x5cbd, 0x5cac, 0x5cab, 0x5cb1, 0x5ca3, - 0x5cc1, 0x5cb7, 0x5cc4, 0x5cd2, 0x5ce4, 0x5ccb, 0x5ce5, 0x5d02, - 0x5d03, 0x5d27, 0x5d26, 0x5d2e, 0x5d24, 0x5d1e, 0x5d06, 0x5d1b, - 0x5d58, 0x5d3e, 0x5d34, 0x5d3d, 0x5d6c, 0x5d5b, 0x5d6f, 0x5d5d, - 0x5d6b, 0x5d4b, 0x5d4a, 0x5d69, 0x5d74, 0x5d82, 0x5d99, 0x5d9d, - 0x8c73, 0x5db7, 0x5dc5, 0x5f73, 0x5f77, 0x5f82, 0x5f87, 0x5f89, - 0x5f8c, 0x5f95, 0x5f99, 0x5f9c, 0x5fa8, 0x5fad, 0x5fb5, 0x5fbc, - 0x8862, 0x5f61, 0x72ad, 0x72b0, 0x72b4, 0x72b7, 0x72b8, 0x72c3, - 0x72c1, 0x72ce, 0x72cd, 0x72d2, 0x72e8, 0x72ef, 0x72e9, 0x72f2, - 0x72f4, 0x72f7, 0x7301, 0x72f3, 0x7303, 0x72fa, - /* 0x62 */ - 0x72fb, 0x7317, 0x7313, 0x7321, 0x730a, 0x731e, 0x731d, 0x7315, - 0x7322, 0x7339, 0x7325, 0x732c, 0x7338, 0x7331, 0x7350, 0x734d, - 0x7357, 0x7360, 0x736c, 0x736f, 0x737e, 0x821b, 0x5925, 0x98e7, - 0x5924, 0x5902, 0x9963, 0x9967, 0x9968, 0x9969, 0x996a, 0x996b, - 0x996c, 0x9974, 0x9977, 0x997d, 0x9980, 0x9984, 0x9987, 0x998a, - 0x998d, 0x9990, 0x9991, 0x9993, 0x9994, 0x9995, 0x5e80, 0x5e91, - 0x5e8b, 0x5e96, 0x5ea5, 0x5ea0, 0x5eb9, 0x5eb5, 0x5ebe, 0x5eb3, - 0x8d53, 0x5ed2, 0x5ed1, 0x5edb, 0x5ee8, 0x5eea, 0x81ba, 0x5fc4, - 0x5fc9, 0x5fd6, 0x5fcf, 0x6003, 0x5fee, 0x6004, 0x5fe1, 0x5fe4, - 0x5ffe, 0x6005, 0x6006, 0x5fea, 0x5fed, 0x5ff8, 0x6019, 0x6035, - 0x6026, 0x601b, 0x600f, 0x600d, 0x6029, 0x602b, 0x600a, 0x603f, - 0x6021, 0x6078, 0x6079, 0x607b, 0x607a, 0x6042, - /* 0x63 */ - 0x606a, 0x607d, 0x6096, 0x609a, 0x60ad, 0x609d, 0x6083, 0x6092, - 0x608c, 0x609b, 0x60ec, 0x60bb, 0x60b1, 0x60dd, 0x60d8, 0x60c6, - 0x60da, 0x60b4, 0x6120, 0x6126, 0x6115, 0x6123, 0x60f4, 0x6100, - 0x610e, 0x612b, 0x614a, 0x6175, 0x61ac, 0x6194, 0x61a7, 0x61b7, - 0x61d4, 0x61f5, 0x5fdd, 0x96b3, 0x95e9, 0x95eb, 0x95f1, 0x95f3, - 0x95f5, 0x95f6, 0x95fc, 0x95fe, 0x9603, 0x9604, 0x9606, 0x9608, - 0x960a, 0x960b, 0x960c, 0x960d, 0x960f, 0x9612, 0x9615, 0x9616, - 0x9617, 0x9619, 0x961a, 0x4e2c, 0x723f, 0x6215, 0x6c35, 0x6c54, - 0x6c5c, 0x6c4a, 0x6ca3, 0x6c85, 0x6c90, 0x6c94, 0x6c8c, 0x6c68, - 0x6c69, 0x6c74, 0x6c76, 0x6c86, 0x6ca9, 0x6cd0, 0x6cd4, 0x6cad, - 0x6cf7, 0x6cf8, 0x6cf1, 0x6cd7, 0x6cb2, 0x6ce0, 0x6cd6, 0x6cfa, - 0x6ceb, 0x6cee, 0x6cb1, 0x6cd3, 0x6cef, 0x6cfe, - /* 0x64 */ - 0x6d39, 0x6d27, 0x6d0c, 0x6d43, 0x6d48, 0x6d07, 0x6d04, 0x6d19, - 0x6d0e, 0x6d2b, 0x6d4d, 0x6d2e, 0x6d35, 0x6d1a, 0x6d4f, 0x6d52, - 0x6d54, 0x6d33, 0x6d91, 0x6d6f, 0x6d9e, 0x6da0, 0x6d5e, 0x6d93, - 0x6d94, 0x6d5c, 0x6d60, 0x6d7c, 0x6d63, 0x6e1a, 0x6dc7, 0x6dc5, - 0x6dde, 0x6e0e, 0x6dbf, 0x6de0, 0x6e11, 0x6de6, 0x6ddd, 0x6dd9, - 0x6e16, 0x6dab, 0x6e0c, 0x6dae, 0x6e2b, 0x6e6e, 0x6e4e, 0x6e6b, - 0x6eb2, 0x6e5f, 0x6e86, 0x6e53, 0x6e54, 0x6e32, 0x6e25, 0x6e44, - 0x6edf, 0x6eb1, 0x6e98, 0x6ee0, 0x6f2d, 0x6ee2, 0x6ea5, 0x6ea7, - 0x6ebd, 0x6ebb, 0x6eb7, 0x6ed7, 0x6eb4, 0x6ecf, 0x6e8f, 0x6ec2, - 0x6e9f, 0x6f62, 0x6f46, 0x6f47, 0x6f24, 0x6f15, 0x6ef9, 0x6f2f, - 0x6f36, 0x6f4b, 0x6f74, 0x6f2a, 0x6f09, 0x6f29, 0x6f89, 0x6f8d, - 0x6f8c, 0x6f78, 0x6f72, 0x6f7c, 0x6f7a, 0x6fd1, - /* 0x65 */ - 0x6fc9, 0x6fa7, 0x6fb9, 0x6fb6, 0x6fc2, 0x6fe1, 0x6fee, 0x6fde, - 0x6fe0, 0x6fef, 0x701a, 0x7023, 0x701b, 0x7039, 0x7035, 0x704f, - 0x705e, 0x5b80, 0x5b84, 0x5b95, 0x5b93, 0x5ba5, 0x5bb8, 0x752f, - 0x9a9e, 0x6434, 0x5be4, 0x5bee, 0x8930, 0x5bf0, 0x8e47, 0x8b07, - 0x8fb6, 0x8fd3, 0x8fd5, 0x8fe5, 0x8fee, 0x8fe4, 0x8fe9, 0x8fe6, - 0x8ff3, 0x8fe8, 0x9005, 0x9004, 0x900b, 0x9026, 0x9011, 0x900d, - 0x9016, 0x9021, 0x9035, 0x9036, 0x902d, 0x902f, 0x9044, 0x9051, - 0x9052, 0x9050, 0x9068, 0x9058, 0x9062, 0x905b, 0x66b9, 0x9074, - 0x907d, 0x9082, 0x9088, 0x9083, 0x908b, 0x5f50, 0x5f57, 0x5f56, - 0x5f58, 0x5c3b, 0x54ab, 0x5c50, 0x5c59, 0x5b71, 0x5c63, 0x5c66, - 0x7fbc, 0x5f2a, 0x5f29, 0x5f2d, 0x8274, 0x5f3c, 0x9b3b, 0x5c6e, - 0x5981, 0x5983, 0x598d, 0x59a9, 0x59aa, 0x59a3, - /* 0x66 */ - 0x5997, 0x59ca, 0x59ab, 0x599e, 0x59a4, 0x59d2, 0x59b2, 0x59af, - 0x59d7, 0x59be, 0x5a05, 0x5a06, 0x59dd, 0x5a08, 0x59e3, 0x59d8, - 0x59f9, 0x5a0c, 0x5a09, 0x5a32, 0x5a34, 0x5a11, 0x5a23, 0x5a13, - 0x5a40, 0x5a67, 0x5a4a, 0x5a55, 0x5a3c, 0x5a62, 0x5a75, 0x80ec, - 0x5aaa, 0x5a9b, 0x5a77, 0x5a7a, 0x5abe, 0x5aeb, 0x5ab2, 0x5ad2, - 0x5ad4, 0x5ab8, 0x5ae0, 0x5ae3, 0x5af1, 0x5ad6, 0x5ae6, 0x5ad8, - 0x5adc, 0x5b09, 0x5b17, 0x5b16, 0x5b32, 0x5b37, 0x5b40, 0x5c15, - 0x5c1c, 0x5b5a, 0x5b65, 0x5b73, 0x5b51, 0x5b53, 0x5b62, 0x9a75, - 0x9a77, 0x9a78, 0x9a7a, 0x9a7f, 0x9a7d, 0x9a80, 0x9a81, 0x9a85, - 0x9a88, 0x9a8a, 0x9a90, 0x9a92, 0x9a93, 0x9a96, 0x9a98, 0x9a9b, - 0x9a9c, 0x9a9d, 0x9a9f, 0x9aa0, 0x9aa2, 0x9aa3, 0x9aa5, 0x9aa7, - 0x7e9f, 0x7ea1, 0x7ea3, 0x7ea5, 0x7ea8, 0x7ea9, - /* 0x67 */ - 0x7ead, 0x7eb0, 0x7ebe, 0x7ec0, 0x7ec1, 0x7ec2, 0x7ec9, 0x7ecb, - 0x7ecc, 0x7ed0, 0x7ed4, 0x7ed7, 0x7edb, 0x7ee0, 0x7ee1, 0x7ee8, - 0x7eeb, 0x7eee, 0x7eef, 0x7ef1, 0x7ef2, 0x7f0d, 0x7ef6, 0x7efa, - 0x7efb, 0x7efe, 0x7f01, 0x7f02, 0x7f03, 0x7f07, 0x7f08, 0x7f0b, - 0x7f0c, 0x7f0f, 0x7f11, 0x7f12, 0x7f17, 0x7f19, 0x7f1c, 0x7f1b, - 0x7f1f, 0x7f21, 0x7f22, 0x7f23, 0x7f24, 0x7f25, 0x7f26, 0x7f27, - 0x7f2a, 0x7f2b, 0x7f2c, 0x7f2d, 0x7f2f, 0x7f30, 0x7f31, 0x7f32, - 0x7f33, 0x7f35, 0x5e7a, 0x757f, 0x5ddb, 0x753e, 0x9095, 0x738e, - 0x7391, 0x73ae, 0x73a2, 0x739f, 0x73cf, 0x73c2, 0x73d1, 0x73b7, - 0x73b3, 0x73c0, 0x73c9, 0x73c8, 0x73e5, 0x73d9, 0x987c, 0x740a, - 0x73e9, 0x73e7, 0x73de, 0x73ba, 0x73f2, 0x740f, 0x742a, 0x745b, - 0x7426, 0x7425, 0x7428, 0x7430, 0x742e, 0x742c, - /* 0x68 */ - 0x741b, 0x741a, 0x7441, 0x745c, 0x7457, 0x7455, 0x7459, 0x7477, - 0x746d, 0x747e, 0x749c, 0x748e, 0x7480, 0x7481, 0x7487, 0x748b, - 0x749e, 0x74a8, 0x74a9, 0x7490, 0x74a7, 0x74d2, 0x74ba, 0x97ea, - 0x97eb, 0x97ec, 0x674c, 0x6753, 0x675e, 0x6748, 0x6769, 0x67a5, - 0x6787, 0x676a, 0x6773, 0x6798, 0x67a7, 0x6775, 0x67a8, 0x679e, - 0x67ad, 0x678b, 0x6777, 0x677c, 0x67f0, 0x6809, 0x67d8, 0x680a, - 0x67e9, 0x67b0, 0x680c, 0x67d9, 0x67b5, 0x67da, 0x67b3, 0x67dd, - 0x6800, 0x67c3, 0x67b8, 0x67e2, 0x680e, 0x67c1, 0x67fd, 0x6832, - 0x6833, 0x6860, 0x6861, 0x684e, 0x6862, 0x6844, 0x6864, 0x6883, - 0x681d, 0x6855, 0x6866, 0x6841, 0x6867, 0x6840, 0x683e, 0x684a, - 0x6849, 0x6829, 0x68b5, 0x688f, 0x6874, 0x6877, 0x6893, 0x686b, - 0x68c2, 0x696e, 0x68fc, 0x691f, 0x6920, 0x68f9, - /* 0x69 */ - 0x6924, 0x68f0, 0x690b, 0x6901, 0x6957, 0x68e3, 0x6910, 0x6971, - 0x6939, 0x6960, 0x6942, 0x695d, 0x6984, 0x696b, 0x6980, 0x6998, - 0x6978, 0x6934, 0x69cc, 0x6987, 0x6988, 0x69ce, 0x6989, 0x6966, - 0x6963, 0x6979, 0x699b, 0x69a7, 0x69bb, 0x69ab, 0x69ad, 0x69d4, - 0x69b1, 0x69c1, 0x69ca, 0x69df, 0x6995, 0x69e0, 0x698d, 0x69ff, - 0x6a2f, 0x69ed, 0x6a17, 0x6a18, 0x6a65, 0x69f2, 0x6a44, 0x6a3e, - 0x6aa0, 0x6a50, 0x6a5b, 0x6a35, 0x6a8e, 0x6a79, 0x6a3d, 0x6a28, - 0x6a58, 0x6a7c, 0x6a91, 0x6a90, 0x6aa9, 0x6a97, 0x6aab, 0x7337, - 0x7352, 0x6b81, 0x6b82, 0x6b87, 0x6b84, 0x6b92, 0x6b93, 0x6b8d, - 0x6b9a, 0x6b9b, 0x6ba1, 0x6baa, 0x8f6b, 0x8f6d, 0x8f71, 0x8f72, - 0x8f73, 0x8f75, 0x8f76, 0x8f78, 0x8f77, 0x8f79, 0x8f7a, 0x8f7c, - 0x8f7e, 0x8f81, 0x8f82, 0x8f84, 0x8f87, 0x8f8b, - /* 0x6a */ - 0x8f8d, 0x8f8e, 0x8f8f, 0x8f98, 0x8f9a, 0x8ece, 0x620b, 0x6217, - 0x621b, 0x621f, 0x6222, 0x6221, 0x6225, 0x6224, 0x622c, 0x81e7, - 0x74ef, 0x74f4, 0x74ff, 0x750f, 0x7511, 0x7513, 0x6534, 0x65ee, - 0x65ef, 0x65f0, 0x660a, 0x6619, 0x6772, 0x6603, 0x6615, 0x6600, - 0x7085, 0x66f7, 0x661d, 0x6634, 0x6631, 0x6636, 0x6635, 0x8006, - 0x665f, 0x6654, 0x6641, 0x664f, 0x6656, 0x6661, 0x6657, 0x6677, - 0x6684, 0x668c, 0x66a7, 0x669d, 0x66be, 0x66db, 0x66dc, 0x66e6, - 0x66e9, 0x8d32, 0x8d33, 0x8d36, 0x8d3b, 0x8d3d, 0x8d40, 0x8d45, - 0x8d46, 0x8d48, 0x8d49, 0x8d47, 0x8d4d, 0x8d55, 0x8d59, 0x89c7, - 0x89ca, 0x89cb, 0x89cc, 0x89ce, 0x89cf, 0x89d0, 0x89d1, 0x726e, - 0x729f, 0x725d, 0x7266, 0x726f, 0x727e, 0x727f, 0x7284, 0x728b, - 0x728d, 0x728f, 0x7292, 0x6308, 0x6332, 0x63b0, - /* 0x6b */ - 0x643f, 0x64d8, 0x8004, 0x6bea, 0x6bf3, 0x6bfd, 0x6bf5, 0x6bf9, - 0x6c05, 0x6c07, 0x6c06, 0x6c0d, 0x6c15, 0x6c18, 0x6c19, 0x6c1a, - 0x6c21, 0x6c29, 0x6c24, 0x6c2a, 0x6c32, 0x6535, 0x6555, 0x656b, - 0x724d, 0x7252, 0x7256, 0x7230, 0x8662, 0x5216, 0x809f, 0x809c, - 0x8093, 0x80bc, 0x670a, 0x80bd, 0x80b1, 0x80ab, 0x80ad, 0x80b4, - 0x80b7, 0x80e7, 0x80e8, 0x80e9, 0x80ea, 0x80db, 0x80c2, 0x80c4, - 0x80d9, 0x80cd, 0x80d7, 0x6710, 0x80dd, 0x80eb, 0x80f1, 0x80f4, - 0x80ed, 0x810d, 0x810e, 0x80f2, 0x80fc, 0x6715, 0x8112, 0x8c5a, - 0x8136, 0x811e, 0x812c, 0x8118, 0x8132, 0x8148, 0x814c, 0x8153, - 0x8174, 0x8159, 0x815a, 0x8171, 0x8160, 0x8169, 0x817c, 0x817d, - 0x816d, 0x8167, 0x584d, 0x5ab5, 0x8188, 0x8182, 0x8191, 0x6ed5, - 0x81a3, 0x81aa, 0x81cc, 0x6726, 0x81ca, 0x81bb, - /* 0x6c */ - 0x81c1, 0x81a6, 0x6b24, 0x6b37, 0x6b39, 0x6b43, 0x6b46, 0x6b59, - 0x98d1, 0x98d2, 0x98d3, 0x98d5, 0x98d9, 0x98da, 0x6bb3, 0x5f40, - 0x6bc2, 0x89f3, 0x6590, 0x9f51, 0x6593, 0x65bc, 0x65c6, 0x65c4, - 0x65c3, 0x65cc, 0x65ce, 0x65d2, 0x65d6, 0x7080, 0x709c, 0x7096, - 0x709d, 0x70bb, 0x70c0, 0x70b7, 0x70ab, 0x70b1, 0x70e8, 0x70ca, - 0x7110, 0x7113, 0x7116, 0x712f, 0x7131, 0x7173, 0x715c, 0x7168, - 0x7145, 0x7172, 0x714a, 0x7178, 0x717a, 0x7198, 0x71b3, 0x71b5, - 0x71a8, 0x71a0, 0x71e0, 0x71d4, 0x71e7, 0x71f9, 0x721d, 0x7228, - 0x706c, 0x7118, 0x7166, 0x71b9, 0x623e, 0x623d, 0x6243, 0x6248, - 0x6249, 0x793b, 0x7940, 0x7946, 0x7949, 0x795b, 0x795c, 0x7953, - 0x795a, 0x7962, 0x7957, 0x7960, 0x796f, 0x7967, 0x797a, 0x7985, - 0x798a, 0x799a, 0x79a7, 0x79b3, 0x5fd1, 0x5fd0, - /* 0x6d */ - 0x603c, 0x605d, 0x605a, 0x6067, 0x6041, 0x6059, 0x6063, 0x60ab, - 0x6106, 0x610d, 0x615d, 0x61a9, 0x619d, 0x61cb, 0x61d1, 0x6206, - 0x8080, 0x807f, 0x6c93, 0x6cf6, 0x6dfc, 0x77f6, 0x77f8, 0x7800, - 0x7809, 0x7817, 0x7818, 0x7811, 0x65ab, 0x782d, 0x781c, 0x781d, - 0x7839, 0x783a, 0x783b, 0x781f, 0x783c, 0x7825, 0x782c, 0x7823, - 0x7829, 0x784e, 0x786d, 0x7856, 0x7857, 0x7826, 0x7850, 0x7847, - 0x784c, 0x786a, 0x789b, 0x7893, 0x789a, 0x7887, 0x789c, 0x78a1, - 0x78a3, 0x78b2, 0x78b9, 0x78a5, 0x78d4, 0x78d9, 0x78c9, 0x78ec, - 0x78f2, 0x7905, 0x78f4, 0x7913, 0x7924, 0x791e, 0x7934, 0x9f9b, - 0x9ef9, 0x9efb, 0x9efc, 0x76f1, 0x7704, 0x770d, 0x76f9, 0x7707, - 0x7708, 0x771a, 0x7722, 0x7719, 0x772d, 0x7726, 0x7735, 0x7738, - 0x7750, 0x7751, 0x7747, 0x7743, 0x775a, 0x7768, - /* 0x6e */ - 0x7762, 0x7765, 0x777f, 0x778d, 0x777d, 0x7780, 0x778c, 0x7791, - 0x779f, 0x77a0, 0x77b0, 0x77b5, 0x77bd, 0x753a, 0x7540, 0x754e, - 0x754b, 0x7548, 0x755b, 0x7572, 0x7579, 0x7583, 0x7f58, 0x7f61, - 0x7f5f, 0x8a48, 0x7f68, 0x7f74, 0x7f71, 0x7f79, 0x7f81, 0x7f7e, - 0x76cd, 0x76e5, 0x8832, 0x9485, 0x9486, 0x9487, 0x948b, 0x948a, - 0x948c, 0x948d, 0x948f, 0x9490, 0x9494, 0x9497, 0x9495, 0x949a, - 0x949b, 0x949c, 0x94a3, 0x94a4, 0x94ab, 0x94aa, 0x94ad, 0x94ac, - 0x94af, 0x94b0, 0x94b2, 0x94b4, 0x94b6, 0x94b7, 0x94b8, 0x94b9, - 0x94ba, 0x94bc, 0x94bd, 0x94bf, 0x94c4, 0x94c8, 0x94c9, 0x94ca, - 0x94cb, 0x94cc, 0x94cd, 0x94ce, 0x94d0, 0x94d1, 0x94d2, 0x94d5, - 0x94d6, 0x94d7, 0x94d9, 0x94d8, 0x94db, 0x94de, 0x94df, 0x94e0, - 0x94e2, 0x94e4, 0x94e5, 0x94e7, 0x94e8, 0x94ea, - /* 0x6f */ - 0x94e9, 0x94eb, 0x94ee, 0x94ef, 0x94f3, 0x94f4, 0x94f5, 0x94f7, - 0x94f9, 0x94fc, 0x94fd, 0x94ff, 0x9503, 0x9502, 0x9506, 0x9507, - 0x9509, 0x950a, 0x950d, 0x950e, 0x950f, 0x9512, 0x9513, 0x9514, - 0x9515, 0x9516, 0x9518, 0x951b, 0x951d, 0x951e, 0x951f, 0x9522, - 0x952a, 0x952b, 0x9529, 0x952c, 0x9531, 0x9532, 0x9534, 0x9536, - 0x9537, 0x9538, 0x953c, 0x953e, 0x953f, 0x9542, 0x9535, 0x9544, - 0x9545, 0x9546, 0x9549, 0x954c, 0x954e, 0x954f, 0x9552, 0x9553, - 0x9554, 0x9556, 0x9557, 0x9558, 0x9559, 0x955b, 0x955e, 0x955f, - 0x955d, 0x9561, 0x9562, 0x9564, 0x9565, 0x9566, 0x9567, 0x9568, - 0x9569, 0x956a, 0x956b, 0x956c, 0x956f, 0x9571, 0x9572, 0x9573, - 0x953a, 0x77e7, 0x77ec, 0x96c9, 0x79d5, 0x79ed, 0x79e3, 0x79eb, - 0x7a06, 0x5d47, 0x7a03, 0x7a02, 0x7a1e, 0x7a14, - /* 0x70 */ - 0x7a39, 0x7a37, 0x7a51, 0x9ecf, 0x99a5, 0x7a70, 0x7688, 0x768e, - 0x7693, 0x7699, 0x76a4, 0x74de, 0x74e0, 0x752c, 0x9e20, 0x9e22, - 0x9e28, 0x9e29, 0x9e2a, 0x9e2b, 0x9e2c, 0x9e32, 0x9e31, 0x9e36, - 0x9e38, 0x9e37, 0x9e39, 0x9e3a, 0x9e3e, 0x9e41, 0x9e42, 0x9e44, - 0x9e46, 0x9e47, 0x9e48, 0x9e49, 0x9e4b, 0x9e4c, 0x9e4e, 0x9e51, - 0x9e55, 0x9e57, 0x9e5a, 0x9e5b, 0x9e5c, 0x9e5e, 0x9e63, 0x9e66, - 0x9e67, 0x9e68, 0x9e69, 0x9e6a, 0x9e6b, 0x9e6c, 0x9e71, 0x9e6d, - 0x9e73, 0x7592, 0x7594, 0x7596, 0x75a0, 0x759d, 0x75ac, 0x75a3, - 0x75b3, 0x75b4, 0x75b8, 0x75c4, 0x75b1, 0x75b0, 0x75c3, 0x75c2, - 0x75d6, 0x75cd, 0x75e3, 0x75e8, 0x75e6, 0x75e4, 0x75eb, 0x75e7, - 0x7603, 0x75f1, 0x75fc, 0x75ff, 0x7610, 0x7600, 0x7605, 0x760c, - 0x7617, 0x760a, 0x7625, 0x7618, 0x7615, 0x7619, - /* 0x71 */ - 0x761b, 0x763c, 0x7622, 0x7620, 0x7640, 0x762d, 0x7630, 0x763f, - 0x7635, 0x7643, 0x763e, 0x7633, 0x764d, 0x765e, 0x7654, 0x765c, - 0x7656, 0x766b, 0x766f, 0x7fca, 0x7ae6, 0x7a78, 0x7a79, 0x7a80, - 0x7a86, 0x7a88, 0x7a95, 0x7aa6, 0x7aa0, 0x7aac, 0x7aa8, 0x7aad, - 0x7ab3, 0x8864, 0x8869, 0x8872, 0x887d, 0x887f, 0x8882, 0x88a2, - 0x88c6, 0x88b7, 0x88bc, 0x88c9, 0x88e2, 0x88ce, 0x88e3, 0x88e5, - 0x88f1, 0x891a, 0x88fc, 0x88e8, 0x88fe, 0x88f0, 0x8921, 0x8919, - 0x8913, 0x891b, 0x890a, 0x8934, 0x892b, 0x8936, 0x8941, 0x8966, - 0x897b, 0x758b, 0x80e5, 0x76b2, 0x76b4, 0x77dc, 0x8012, 0x8014, - 0x8016, 0x801c, 0x8020, 0x8022, 0x8025, 0x8026, 0x8027, 0x8029, - 0x8028, 0x8031, 0x800b, 0x8035, 0x8043, 0x8046, 0x804d, 0x8052, - 0x8069, 0x8071, 0x8983, 0x9878, 0x9880, 0x9883, - /* 0x72 */ - 0x9889, 0x988c, 0x988d, 0x988f, 0x9894, 0x989a, 0x989b, 0x989e, - 0x989f, 0x98a1, 0x98a2, 0x98a5, 0x98a6, 0x864d, 0x8654, 0x866c, - 0x866e, 0x867f, 0x867a, 0x867c, 0x867b, 0x86a8, 0x868d, 0x868b, - 0x86ac, 0x869d, 0x86a7, 0x86a3, 0x86aa, 0x8693, 0x86a9, 0x86b6, - 0x86c4, 0x86b5, 0x86ce, 0x86b0, 0x86ba, 0x86b1, 0x86af, 0x86c9, - 0x86cf, 0x86b4, 0x86e9, 0x86f1, 0x86f2, 0x86ed, 0x86f3, 0x86d0, - 0x8713, 0x86de, 0x86f4, 0x86df, 0x86d8, 0x86d1, 0x8703, 0x8707, - 0x86f8, 0x8708, 0x870a, 0x870d, 0x8709, 0x8723, 0x873b, 0x871e, - 0x8725, 0x872e, 0x871a, 0x873e, 0x8748, 0x8734, 0x8731, 0x8729, - 0x8737, 0x873f, 0x8782, 0x8722, 0x877d, 0x877e, 0x877b, 0x8760, - 0x8770, 0x874c, 0x876e, 0x878b, 0x8753, 0x8763, 0x877c, 0x8764, - 0x8759, 0x8765, 0x8793, 0x87af, 0x87a8, 0x87d2, - /* 0x73 */ - 0x87c6, 0x8788, 0x8785, 0x87ad, 0x8797, 0x8783, 0x87ab, 0x87e5, - 0x87ac, 0x87b5, 0x87b3, 0x87cb, 0x87d3, 0x87bd, 0x87d1, 0x87c0, - 0x87ca, 0x87db, 0x87ea, 0x87e0, 0x87ee, 0x8816, 0x8813, 0x87fe, - 0x880a, 0x881b, 0x8821, 0x8839, 0x883c, 0x7f36, 0x7f42, 0x7f44, - 0x7f45, 0x8210, 0x7afa, 0x7afd, 0x7b08, 0x7b03, 0x7b04, 0x7b15, - 0x7b0a, 0x7b2b, 0x7b0f, 0x7b47, 0x7b38, 0x7b2a, 0x7b19, 0x7b2e, - 0x7b31, 0x7b20, 0x7b25, 0x7b24, 0x7b33, 0x7b3e, 0x7b1e, 0x7b58, - 0x7b5a, 0x7b45, 0x7b75, 0x7b4c, 0x7b5d, 0x7b60, 0x7b6e, 0x7b7b, - 0x7b62, 0x7b72, 0x7b71, 0x7b90, 0x7ba6, 0x7ba7, 0x7bb8, 0x7bac, - 0x7b9d, 0x7ba8, 0x7b85, 0x7baa, 0x7b9c, 0x7ba2, 0x7bab, 0x7bb4, - 0x7bd1, 0x7bc1, 0x7bcc, 0x7bdd, 0x7bda, 0x7be5, 0x7be6, 0x7bea, - 0x7c0c, 0x7bfe, 0x7bfc, 0x7c0f, 0x7c16, 0x7c0b, - /* 0x74 */ - 0x7c1f, 0x7c2a, 0x7c26, 0x7c38, 0x7c41, 0x7c40, 0x81fe, 0x8201, - 0x8202, 0x8204, 0x81ec, 0x8844, 0x8221, 0x8222, 0x8223, 0x822d, - 0x822f, 0x8228, 0x822b, 0x8238, 0x823b, 0x8233, 0x8234, 0x823e, - 0x8244, 0x8249, 0x824b, 0x824f, 0x825a, 0x825f, 0x8268, 0x887e, - 0x8885, 0x8888, 0x88d8, 0x88df, 0x895e, 0x7f9d, 0x7f9f, 0x7fa7, - 0x7faf, 0x7fb0, 0x7fb2, 0x7c7c, 0x6549, 0x7c91, 0x7c9d, 0x7c9c, - 0x7c9e, 0x7ca2, 0x7cb2, 0x7cbc, 0x7cbd, 0x7cc1, 0x7cc7, 0x7ccc, - 0x7ccd, 0x7cc8, 0x7cc5, 0x7cd7, 0x7ce8, 0x826e, 0x66a8, 0x7fbf, - 0x7fce, 0x7fd5, 0x7fe5, 0x7fe1, 0x7fe6, 0x7fe9, 0x7fee, 0x7ff3, - 0x7cf8, 0x7d77, 0x7da6, 0x7dae, 0x7e47, 0x7e9b, 0x9eb8, 0x9eb4, - 0x8d73, 0x8d84, 0x8d94, 0x8d91, 0x8db1, 0x8d67, 0x8d6d, 0x8c47, - 0x8c49, 0x914a, 0x9150, 0x914e, 0x914f, 0x9164, - /* 0x75 */ - 0x9162, 0x9161, 0x9170, 0x9169, 0x916f, 0x917d, 0x917e, 0x9172, - 0x9174, 0x9179, 0x918c, 0x9185, 0x9190, 0x918d, 0x9191, 0x91a2, - 0x91a3, 0x91aa, 0x91ad, 0x91ae, 0x91af, 0x91b5, 0x91b4, 0x91ba, - 0x8c55, 0x9e7e, 0x8db8, 0x8deb, 0x8e05, 0x8e59, 0x8e69, 0x8db5, - 0x8dbf, 0x8dbc, 0x8dba, 0x8dc4, 0x8dd6, 0x8dd7, 0x8dda, 0x8dde, - 0x8dce, 0x8dcf, 0x8ddb, 0x8dc6, 0x8dec, 0x8df7, 0x8df8, 0x8de3, - 0x8df9, 0x8dfb, 0x8de4, 0x8e09, 0x8dfd, 0x8e14, 0x8e1d, 0x8e1f, - 0x8e2c, 0x8e2e, 0x8e23, 0x8e2f, 0x8e3a, 0x8e40, 0x8e39, 0x8e35, - 0x8e3d, 0x8e31, 0x8e49, 0x8e41, 0x8e42, 0x8e51, 0x8e52, 0x8e4a, - 0x8e70, 0x8e76, 0x8e7c, 0x8e6f, 0x8e74, 0x8e85, 0x8e8f, 0x8e94, - 0x8e90, 0x8e9c, 0x8e9e, 0x8c78, 0x8c82, 0x8c8a, 0x8c85, 0x8c98, - 0x8c94, 0x659b, 0x89d6, 0x89de, 0x89da, 0x89dc, - /* 0x76 */ - 0x89e5, 0x89eb, 0x89ef, 0x8a3e, 0x8b26, 0x9753, 0x96e9, 0x96f3, - 0x96ef, 0x9706, 0x9701, 0x9708, 0x970f, 0x970e, 0x972a, 0x972d, - 0x9730, 0x973e, 0x9f80, 0x9f83, 0x9f85, 0x9f86, 0x9f87, 0x9f88, - 0x9f89, 0x9f8a, 0x9f8c, 0x9efe, 0x9f0b, 0x9f0d, 0x96b9, 0x96bc, - 0x96bd, 0x96ce, 0x96d2, 0x77bf, 0x96e0, 0x928e, 0x92ae, 0x92c8, - 0x933e, 0x936a, 0x93ca, 0x938f, 0x943e, 0x946b, 0x9c7f, 0x9c82, - 0x9c85, 0x9c86, 0x9c87, 0x9c88, 0x7a23, 0x9c8b, 0x9c8e, 0x9c90, - 0x9c91, 0x9c92, 0x9c94, 0x9c95, 0x9c9a, 0x9c9b, 0x9c9e, 0x9c9f, - 0x9ca0, 0x9ca1, 0x9ca2, 0x9ca3, 0x9ca5, 0x9ca6, 0x9ca7, 0x9ca8, - 0x9ca9, 0x9cab, 0x9cad, 0x9cae, 0x9cb0, 0x9cb1, 0x9cb2, 0x9cb3, - 0x9cb4, 0x9cb5, 0x9cb6, 0x9cb7, 0x9cba, 0x9cbb, 0x9cbc, 0x9cbd, - 0x9cc4, 0x9cc5, 0x9cc6, 0x9cc7, 0x9cca, 0x9ccb, - /* 0x77 */ - 0x9ccc, 0x9ccd, 0x9cce, 0x9ccf, 0x9cd0, 0x9cd3, 0x9cd4, 0x9cd5, - 0x9cd7, 0x9cd8, 0x9cd9, 0x9cdc, 0x9cdd, 0x9cdf, 0x9ce2, 0x977c, - 0x9785, 0x9791, 0x9792, 0x9794, 0x97af, 0x97ab, 0x97a3, 0x97b2, - 0x97b4, 0x9ab1, 0x9ab0, 0x9ab7, 0x9e58, 0x9ab6, 0x9aba, 0x9abc, - 0x9ac1, 0x9ac0, 0x9ac5, 0x9ac2, 0x9acb, 0x9acc, 0x9ad1, 0x9b45, - 0x9b43, 0x9b47, 0x9b49, 0x9b48, 0x9b4d, 0x9b51, 0x98e8, 0x990d, - 0x992e, 0x9955, 0x9954, 0x9adf, 0x9ae1, 0x9ae6, 0x9aef, 0x9aeb, - 0x9afb, 0x9aed, 0x9af9, 0x9b08, 0x9b0f, 0x9b13, 0x9b1f, 0x9b23, - 0x9ebd, 0x9ebe, 0x7e3b, 0x9e82, 0x9e87, 0x9e88, 0x9e8b, 0x9e92, - 0x93d6, 0x9e9d, 0x9e9f, 0x9edb, 0x9edc, 0x9edd, 0x9ee0, 0x9edf, - 0x9ee2, 0x9ee9, 0x9ee7, 0x9ee5, 0x9eea, 0x9eef, 0x9f22, 0x9f2c, - 0x9f2f, 0x9f39, 0x9f37, 0x9f3d, 0x9f3e, 0x9f44, -}; - - - -static const u16 gbkext1_2uni_page81[6080] = { - /* 0x81 */ - 0x4e02, 0x4e04, 0x4e05, 0x4e06, 0x4e0f, 0x4e12, 0x4e17, 0x4e1f, - 0x4e20, 0x4e21, 0x4e23, 0x4e26, 0x4e29, 0x4e2e, 0x4e2f, 0x4e31, - 0x4e33, 0x4e35, 0x4e37, 0x4e3c, 0x4e40, 0x4e41, 0x4e42, 0x4e44, - 0x4e46, 0x4e4a, 0x4e51, 0x4e55, 0x4e57, 0x4e5a, 0x4e5b, 0x4e62, - 0x4e63, 0x4e64, 0x4e65, 0x4e67, 0x4e68, 0x4e6a, 0x4e6b, 0x4e6c, - 0x4e6d, 0x4e6e, 0x4e6f, 0x4e72, 0x4e74, 0x4e75, 0x4e76, 0x4e77, - 0x4e78, 0x4e79, 0x4e7a, 0x4e7b, 0x4e7c, 0x4e7d, 0x4e7f, 0x4e80, - 0x4e81, 0x4e82, 0x4e83, 0x4e84, 0x4e85, 0x4e87, 0x4e8a, 0x4e90, - 0x4e96, 0x4e97, 0x4e99, 0x4e9c, 0x4e9d, 0x4e9e, 0x4ea3, 0x4eaa, - 0x4eaf, 0x4eb0, 0x4eb1, 0x4eb4, 0x4eb6, 0x4eb7, 0x4eb8, 0x4eb9, - 0x4ebc, 0x4ebd, 0x4ebe, 0x4ec8, 0x4ecc, 0x4ecf, 0x4ed0, 0x4ed2, - 0x4eda, 0x4edb, 0x4edc, 0x4ee0, 0x4ee2, 0x4ee6, 0x4ee7, 0x4ee9, - 0x4eed, 0x4eee, 0x4eef, 0x4ef1, 0x4ef4, 0x4ef8, 0x4ef9, 0x4efa, - 0x4efc, 0x4efe, 0x4f00, 0x4f02, 0x4f03, 0x4f04, 0x4f05, 0x4f06, - 0x4f07, 0x4f08, 0x4f0b, 0x4f0c, 0x4f12, 0x4f13, 0x4f14, 0x4f15, - 0x4f16, 0x4f1c, 0x4f1d, 0x4f21, 0x4f23, 0x4f28, 0x4f29, 0x4f2c, - 0x4f2d, 0x4f2e, 0x4f31, 0x4f33, 0x4f35, 0x4f37, 0x4f39, 0x4f3b, - 0x4f3e, 0x4f3f, 0x4f40, 0x4f41, 0x4f42, 0x4f44, 0x4f45, 0x4f47, - 0x4f48, 0x4f49, 0x4f4a, 0x4f4b, 0x4f4c, 0x4f52, 0x4f54, 0x4f56, - 0x4f61, 0x4f62, 0x4f66, 0x4f68, 0x4f6a, 0x4f6b, 0x4f6d, 0x4f6e, - 0x4f71, 0x4f72, 0x4f75, 0x4f77, 0x4f78, 0x4f79, 0x4f7a, 0x4f7d, - 0x4f80, 0x4f81, 0x4f82, 0x4f85, 0x4f86, 0x4f87, 0x4f8a, 0x4f8c, - 0x4f8e, 0x4f90, 0x4f92, 0x4f93, 0x4f95, 0x4f96, 0x4f98, 0x4f99, - 0x4f9a, 0x4f9c, 0x4f9e, 0x4f9f, 0x4fa1, 0x4fa2, - /* 0x82 */ - 0x4fa4, 0x4fab, 0x4fad, 0x4fb0, 0x4fb1, 0x4fb2, 0x4fb3, 0x4fb4, - 0x4fb6, 0x4fb7, 0x4fb8, 0x4fb9, 0x4fba, 0x4fbb, 0x4fbc, 0x4fbd, - 0x4fbe, 0x4fc0, 0x4fc1, 0x4fc2, 0x4fc6, 0x4fc7, 0x4fc8, 0x4fc9, - 0x4fcb, 0x4fcc, 0x4fcd, 0x4fd2, 0x4fd3, 0x4fd4, 0x4fd5, 0x4fd6, - 0x4fd9, 0x4fdb, 0x4fe0, 0x4fe2, 0x4fe4, 0x4fe5, 0x4fe7, 0x4feb, - 0x4fec, 0x4ff0, 0x4ff2, 0x4ff4, 0x4ff5, 0x4ff6, 0x4ff7, 0x4ff9, - 0x4ffb, 0x4ffc, 0x4ffd, 0x4fff, 0x5000, 0x5001, 0x5002, 0x5003, - 0x5004, 0x5005, 0x5006, 0x5007, 0x5008, 0x5009, 0x500a, 0x500b, - 0x500e, 0x5010, 0x5011, 0x5013, 0x5015, 0x5016, 0x5017, 0x501b, - 0x501d, 0x501e, 0x5020, 0x5022, 0x5023, 0x5024, 0x5027, 0x502b, - 0x502f, 0x5030, 0x5031, 0x5032, 0x5033, 0x5034, 0x5035, 0x5036, - 0x5037, 0x5038, 0x5039, 0x503b, 0x503d, 0x503f, 0x5040, 0x5041, - 0x5042, 0x5044, 0x5045, 0x5046, 0x5049, 0x504a, 0x504b, 0x504d, - 0x5050, 0x5051, 0x5052, 0x5053, 0x5054, 0x5056, 0x5057, 0x5058, - 0x5059, 0x505b, 0x505d, 0x505e, 0x505f, 0x5060, 0x5061, 0x5062, - 0x5063, 0x5064, 0x5066, 0x5067, 0x5068, 0x5069, 0x506a, 0x506b, - 0x506d, 0x506e, 0x506f, 0x5070, 0x5071, 0x5072, 0x5073, 0x5074, - 0x5075, 0x5078, 0x5079, 0x507a, 0x507c, 0x507d, 0x5081, 0x5082, - 0x5083, 0x5084, 0x5086, 0x5087, 0x5089, 0x508a, 0x508b, 0x508c, - 0x508e, 0x508f, 0x5090, 0x5091, 0x5092, 0x5093, 0x5094, 0x5095, - 0x5096, 0x5097, 0x5098, 0x5099, 0x509a, 0x509b, 0x509c, 0x509d, - 0x509e, 0x509f, 0x50a0, 0x50a1, 0x50a2, 0x50a4, 0x50a6, 0x50aa, - 0x50ab, 0x50ad, 0x50ae, 0x50af, 0x50b0, 0x50b1, 0x50b3, 0x50b4, - 0x50b5, 0x50b6, 0x50b7, 0x50b8, 0x50b9, 0x50bc, - /* 0x83 */ - 0x50bd, 0x50be, 0x50bf, 0x50c0, 0x50c1, 0x50c2, 0x50c3, 0x50c4, - 0x50c5, 0x50c6, 0x50c7, 0x50c8, 0x50c9, 0x50ca, 0x50cb, 0x50cc, - 0x50cd, 0x50ce, 0x50d0, 0x50d1, 0x50d2, 0x50d3, 0x50d4, 0x50d5, - 0x50d7, 0x50d8, 0x50d9, 0x50db, 0x50dc, 0x50dd, 0x50de, 0x50df, - 0x50e0, 0x50e1, 0x50e2, 0x50e3, 0x50e4, 0x50e5, 0x50e8, 0x50e9, - 0x50ea, 0x50eb, 0x50ef, 0x50f0, 0x50f1, 0x50f2, 0x50f4, 0x50f6, - 0x50f7, 0x50f8, 0x50f9, 0x50fa, 0x50fc, 0x50fd, 0x50fe, 0x50ff, - 0x5100, 0x5101, 0x5102, 0x5103, 0x5104, 0x5105, 0x5108, 0x5109, - 0x510a, 0x510c, 0x510d, 0x510e, 0x510f, 0x5110, 0x5111, 0x5113, - 0x5114, 0x5115, 0x5116, 0x5117, 0x5118, 0x5119, 0x511a, 0x511b, - 0x511c, 0x511d, 0x511e, 0x511f, 0x5120, 0x5122, 0x5123, 0x5124, - 0x5125, 0x5126, 0x5127, 0x5128, 0x5129, 0x512a, 0x512b, 0x512c, - 0x512d, 0x512e, 0x512f, 0x5130, 0x5131, 0x5132, 0x5133, 0x5134, - 0x5135, 0x5136, 0x5137, 0x5138, 0x5139, 0x513a, 0x513b, 0x513c, - 0x513d, 0x513e, 0x5142, 0x5147, 0x514a, 0x514c, 0x514e, 0x514f, - 0x5150, 0x5152, 0x5153, 0x5157, 0x5158, 0x5159, 0x515b, 0x515d, - 0x515e, 0x515f, 0x5160, 0x5161, 0x5163, 0x5164, 0x5166, 0x5167, - 0x5169, 0x516a, 0x516f, 0x5172, 0x517a, 0x517e, 0x517f, 0x5183, - 0x5184, 0x5186, 0x5187, 0x518a, 0x518b, 0x518e, 0x518f, 0x5190, - 0x5191, 0x5193, 0x5194, 0x5198, 0x519a, 0x519d, 0x519e, 0x519f, - 0x51a1, 0x51a3, 0x51a6, 0x51a7, 0x51a8, 0x51a9, 0x51aa, 0x51ad, - 0x51ae, 0x51b4, 0x51b8, 0x51b9, 0x51ba, 0x51be, 0x51bf, 0x51c1, - 0x51c2, 0x51c3, 0x51c5, 0x51c8, 0x51ca, 0x51cd, 0x51ce, 0x51d0, - 0x51d2, 0x51d3, 0x51d4, 0x51d5, 0x51d6, 0x51d7, - /* 0x84 */ - 0x51d8, 0x51d9, 0x51da, 0x51dc, 0x51de, 0x51df, 0x51e2, 0x51e3, - 0x51e5, 0x51e6, 0x51e7, 0x51e8, 0x51e9, 0x51ea, 0x51ec, 0x51ee, - 0x51f1, 0x51f2, 0x51f4, 0x51f7, 0x51fe, 0x5204, 0x5205, 0x5209, - 0x520b, 0x520c, 0x520f, 0x5210, 0x5213, 0x5214, 0x5215, 0x521c, - 0x521e, 0x521f, 0x5221, 0x5222, 0x5223, 0x5225, 0x5226, 0x5227, - 0x522a, 0x522c, 0x522f, 0x5231, 0x5232, 0x5234, 0x5235, 0x523c, - 0x523e, 0x5244, 0x5245, 0x5246, 0x5247, 0x5248, 0x5249, 0x524b, - 0x524e, 0x524f, 0x5252, 0x5253, 0x5255, 0x5257, 0x5258, 0x5259, - 0x525a, 0x525b, 0x525d, 0x525f, 0x5260, 0x5262, 0x5263, 0x5264, - 0x5266, 0x5268, 0x526b, 0x526c, 0x526d, 0x526e, 0x5270, 0x5271, - 0x5273, 0x5274, 0x5275, 0x5276, 0x5277, 0x5278, 0x5279, 0x527a, - 0x527b, 0x527c, 0x527e, 0x5280, 0x5283, 0x5284, 0x5285, 0x5286, - 0x5287, 0x5289, 0x528a, 0x528b, 0x528c, 0x528d, 0x528e, 0x528f, - 0x5291, 0x5292, 0x5294, 0x5295, 0x5296, 0x5297, 0x5298, 0x5299, - 0x529a, 0x529c, 0x52a4, 0x52a5, 0x52a6, 0x52a7, 0x52ae, 0x52af, - 0x52b0, 0x52b4, 0x52b5, 0x52b6, 0x52b7, 0x52b8, 0x52b9, 0x52ba, - 0x52bb, 0x52bc, 0x52bd, 0x52c0, 0x52c1, 0x52c2, 0x52c4, 0x52c5, - 0x52c6, 0x52c8, 0x52ca, 0x52cc, 0x52cd, 0x52ce, 0x52cf, 0x52d1, - 0x52d3, 0x52d4, 0x52d5, 0x52d7, 0x52d9, 0x52da, 0x52db, 0x52dc, - 0x52dd, 0x52de, 0x52e0, 0x52e1, 0x52e2, 0x52e3, 0x52e5, 0x52e6, - 0x52e7, 0x52e8, 0x52e9, 0x52ea, 0x52eb, 0x52ec, 0x52ed, 0x52ee, - 0x52ef, 0x52f1, 0x52f2, 0x52f3, 0x52f4, 0x52f5, 0x52f6, 0x52f7, - 0x52f8, 0x52fb, 0x52fc, 0x52fd, 0x5301, 0x5302, 0x5303, 0x5304, - 0x5307, 0x5309, 0x530a, 0x530b, 0x530c, 0x530e, - /* 0x85 */ - 0x5311, 0x5312, 0x5313, 0x5314, 0x5318, 0x531b, 0x531c, 0x531e, - 0x531f, 0x5322, 0x5324, 0x5325, 0x5327, 0x5328, 0x5329, 0x532b, - 0x532c, 0x532d, 0x532f, 0x5330, 0x5331, 0x5332, 0x5333, 0x5334, - 0x5335, 0x5336, 0x5337, 0x5338, 0x533c, 0x533d, 0x5340, 0x5342, - 0x5344, 0x5346, 0x534b, 0x534c, 0x534d, 0x5350, 0x5354, 0x5358, - 0x5359, 0x535b, 0x535d, 0x5365, 0x5368, 0x536a, 0x536c, 0x536d, - 0x5372, 0x5376, 0x5379, 0x537b, 0x537c, 0x537d, 0x537e, 0x5380, - 0x5381, 0x5383, 0x5387, 0x5388, 0x538a, 0x538e, 0x538f, 0x5390, - 0x5391, 0x5392, 0x5393, 0x5394, 0x5396, 0x5397, 0x5399, 0x539b, - 0x539c, 0x539e, 0x53a0, 0x53a1, 0x53a4, 0x53a7, 0x53aa, 0x53ab, - 0x53ac, 0x53ad, 0x53af, 0x53b0, 0x53b1, 0x53b2, 0x53b3, 0x53b4, - 0x53b5, 0x53b7, 0x53b8, 0x53b9, 0x53ba, 0x53bc, 0x53bd, 0x53be, - 0x53c0, 0x53c3, 0x53c4, 0x53c5, 0x53c6, 0x53c7, 0x53ce, 0x53cf, - 0x53d0, 0x53d2, 0x53d3, 0x53d5, 0x53da, 0x53dc, 0x53dd, 0x53de, - 0x53e1, 0x53e2, 0x53e7, 0x53f4, 0x53fa, 0x53fe, 0x53ff, 0x5400, - 0x5402, 0x5405, 0x5407, 0x540b, 0x5414, 0x5418, 0x5419, 0x541a, - 0x541c, 0x5422, 0x5424, 0x5425, 0x542a, 0x5430, 0x5433, 0x5436, - 0x5437, 0x543a, 0x543d, 0x543f, 0x5441, 0x5442, 0x5444, 0x5445, - 0x5447, 0x5449, 0x544c, 0x544d, 0x544e, 0x544f, 0x5451, 0x545a, - 0x545d, 0x545e, 0x545f, 0x5460, 0x5461, 0x5463, 0x5465, 0x5467, - 0x5469, 0x546a, 0x546b, 0x546c, 0x546d, 0x546e, 0x546f, 0x5470, - 0x5474, 0x5479, 0x547a, 0x547e, 0x547f, 0x5481, 0x5483, 0x5485, - 0x5487, 0x5488, 0x5489, 0x548a, 0x548d, 0x5491, 0x5493, 0x5497, - 0x5498, 0x549c, 0x549e, 0x549f, 0x54a0, 0x54a1, - /* 0x86 */ - 0x54a2, 0x54a5, 0x54ae, 0x54b0, 0x54b2, 0x54b5, 0x54b6, 0x54b7, - 0x54b9, 0x54ba, 0x54bc, 0x54be, 0x54c3, 0x54c5, 0x54ca, 0x54cb, - 0x54d6, 0x54d8, 0x54db, 0x54e0, 0x54e1, 0x54e2, 0x54e3, 0x54e4, - 0x54eb, 0x54ec, 0x54ef, 0x54f0, 0x54f1, 0x54f4, 0x54f5, 0x54f6, - 0x54f7, 0x54f8, 0x54f9, 0x54fb, 0x54fe, 0x5500, 0x5502, 0x5503, - 0x5504, 0x5505, 0x5508, 0x550a, 0x550b, 0x550c, 0x550d, 0x550e, - 0x5512, 0x5513, 0x5515, 0x5516, 0x5517, 0x5518, 0x5519, 0x551a, - 0x551c, 0x551d, 0x551e, 0x551f, 0x5521, 0x5525, 0x5526, 0x5528, - 0x5529, 0x552b, 0x552d, 0x5532, 0x5534, 0x5535, 0x5536, 0x5538, - 0x5539, 0x553a, 0x553b, 0x553d, 0x5540, 0x5542, 0x5545, 0x5547, - 0x5548, 0x554b, 0x554c, 0x554d, 0x554e, 0x554f, 0x5551, 0x5552, - 0x5553, 0x5554, 0x5557, 0x5558, 0x5559, 0x555a, 0x555b, 0x555d, - 0x555e, 0x555f, 0x5560, 0x5562, 0x5563, 0x5568, 0x5569, 0x556b, - 0x556f, 0x5570, 0x5571, 0x5572, 0x5573, 0x5574, 0x5579, 0x557a, - 0x557d, 0x557f, 0x5585, 0x5586, 0x558c, 0x558d, 0x558e, 0x5590, - 0x5592, 0x5593, 0x5595, 0x5596, 0x5597, 0x559a, 0x559b, 0x559e, - 0x55a0, 0x55a1, 0x55a2, 0x55a3, 0x55a4, 0x55a5, 0x55a6, 0x55a8, - 0x55a9, 0x55aa, 0x55ab, 0x55ac, 0x55ad, 0x55ae, 0x55af, 0x55b0, - 0x55b2, 0x55b4, 0x55b6, 0x55b8, 0x55ba, 0x55bc, 0x55bf, 0x55c0, - 0x55c1, 0x55c2, 0x55c3, 0x55c6, 0x55c7, 0x55c8, 0x55ca, 0x55cb, - 0x55ce, 0x55cf, 0x55d0, 0x55d5, 0x55d7, 0x55d8, 0x55d9, 0x55da, - 0x55db, 0x55de, 0x55e0, 0x55e2, 0x55e7, 0x55e9, 0x55ed, 0x55ee, - 0x55f0, 0x55f1, 0x55f4, 0x55f6, 0x55f8, 0x55f9, 0x55fa, 0x55fb, - 0x55fc, 0x55ff, 0x5602, 0x5603, 0x5604, 0x5605, - /* 0x87 */ - 0x5606, 0x5607, 0x560a, 0x560b, 0x560d, 0x5610, 0x5611, 0x5612, - 0x5613, 0x5614, 0x5615, 0x5616, 0x5617, 0x5619, 0x561a, 0x561c, - 0x561d, 0x5620, 0x5621, 0x5622, 0x5625, 0x5626, 0x5628, 0x5629, - 0x562a, 0x562b, 0x562e, 0x562f, 0x5630, 0x5633, 0x5635, 0x5637, - 0x5638, 0x563a, 0x563c, 0x563d, 0x563e, 0x5640, 0x5641, 0x5642, - 0x5643, 0x5644, 0x5645, 0x5646, 0x5647, 0x5648, 0x5649, 0x564a, - 0x564b, 0x564f, 0x5650, 0x5651, 0x5652, 0x5653, 0x5655, 0x5656, - 0x565a, 0x565b, 0x565d, 0x565e, 0x565f, 0x5660, 0x5661, 0x5663, - 0x5665, 0x5666, 0x5667, 0x566d, 0x566e, 0x566f, 0x5670, 0x5672, - 0x5673, 0x5674, 0x5675, 0x5677, 0x5678, 0x5679, 0x567a, 0x567d, - 0x567e, 0x567f, 0x5680, 0x5681, 0x5682, 0x5683, 0x5684, 0x5687, - 0x5688, 0x5689, 0x568a, 0x568b, 0x568c, 0x568d, 0x5690, 0x5691, - 0x5692, 0x5694, 0x5695, 0x5696, 0x5697, 0x5698, 0x5699, 0x569a, - 0x569b, 0x569c, 0x569d, 0x569e, 0x569f, 0x56a0, 0x56a1, 0x56a2, - 0x56a4, 0x56a5, 0x56a6, 0x56a7, 0x56a8, 0x56a9, 0x56aa, 0x56ab, - 0x56ac, 0x56ad, 0x56ae, 0x56b0, 0x56b1, 0x56b2, 0x56b3, 0x56b4, - 0x56b5, 0x56b6, 0x56b8, 0x56b9, 0x56ba, 0x56bb, 0x56bd, 0x56be, - 0x56bf, 0x56c0, 0x56c1, 0x56c2, 0x56c3, 0x56c4, 0x56c5, 0x56c6, - 0x56c7, 0x56c8, 0x56c9, 0x56cb, 0x56cc, 0x56cd, 0x56ce, 0x56cf, - 0x56d0, 0x56d1, 0x56d2, 0x56d3, 0x56d5, 0x56d6, 0x56d8, 0x56d9, - 0x56dc, 0x56e3, 0x56e5, 0x56e6, 0x56e7, 0x56e8, 0x56e9, 0x56ea, - 0x56ec, 0x56ee, 0x56ef, 0x56f2, 0x56f3, 0x56f6, 0x56f7, 0x56f8, - 0x56fb, 0x56fc, 0x5700, 0x5701, 0x5702, 0x5705, 0x5707, 0x570b, - 0x570c, 0x570d, 0x570e, 0x570f, 0x5710, 0x5711, - /* 0x88 */ - 0x5712, 0x5713, 0x5714, 0x5715, 0x5716, 0x5717, 0x5718, 0x5719, - 0x571a, 0x571b, 0x571d, 0x571e, 0x5720, 0x5721, 0x5722, 0x5724, - 0x5725, 0x5726, 0x5727, 0x572b, 0x5731, 0x5732, 0x5734, 0x5735, - 0x5736, 0x5737, 0x5738, 0x573c, 0x573d, 0x573f, 0x5741, 0x5743, - 0x5744, 0x5745, 0x5746, 0x5748, 0x5749, 0x574b, 0x5752, 0x5753, - 0x5754, 0x5755, 0x5756, 0x5758, 0x5759, 0x5762, 0x5763, 0x5765, - 0x5767, 0x576c, 0x576e, 0x5770, 0x5771, 0x5772, 0x5774, 0x5775, - 0x5778, 0x5779, 0x577a, 0x577d, 0x577e, 0x577f, 0x5780, 0x5781, - 0x5787, 0x5788, 0x5789, 0x578a, 0x578d, 0x578e, 0x578f, 0x5790, - 0x5791, 0x5794, 0x5795, 0x5796, 0x5797, 0x5798, 0x5799, 0x579a, - 0x579c, 0x579d, 0x579e, 0x579f, 0x57a5, 0x57a8, 0x57aa, 0x57ac, - 0x57af, 0x57b0, 0x57b1, 0x57b3, 0x57b5, 0x57b6, 0x57b7, 0x57b9, - 0x57ba, 0x57bb, 0x57bc, 0x57bd, 0x57be, 0x57bf, 0x57c0, 0x57c1, - 0x57c4, 0x57c5, 0x57c6, 0x57c7, 0x57c8, 0x57c9, 0x57ca, 0x57cc, - 0x57cd, 0x57d0, 0x57d1, 0x57d3, 0x57d6, 0x57d7, 0x57db, 0x57dc, - 0x57de, 0x57e1, 0x57e2, 0x57e3, 0x57e5, 0x57e6, 0x57e7, 0x57e8, - 0x57e9, 0x57ea, 0x57eb, 0x57ec, 0x57ee, 0x57f0, 0x57f1, 0x57f2, - 0x57f3, 0x57f5, 0x57f6, 0x57f7, 0x57fb, 0x57fc, 0x57fe, 0x57ff, - 0x5801, 0x5803, 0x5804, 0x5805, 0x5808, 0x5809, 0x580a, 0x580c, - 0x580e, 0x580f, 0x5810, 0x5812, 0x5813, 0x5814, 0x5816, 0x5817, - 0x5818, 0x581a, 0x581b, 0x581c, 0x581d, 0x581f, 0x5822, 0x5823, - 0x5825, 0x5826, 0x5827, 0x5828, 0x5829, 0x582b, 0x582c, 0x582d, - 0x582e, 0x582f, 0x5831, 0x5832, 0x5833, 0x5834, 0x5836, 0x5837, - 0x5838, 0x5839, 0x583a, 0x583b, 0x583c, 0x583d, - /* 0x89 */ - 0x583e, 0x583f, 0x5840, 0x5841, 0x5842, 0x5843, 0x5845, 0x5846, - 0x5847, 0x5848, 0x5849, 0x584a, 0x584b, 0x584e, 0x584f, 0x5850, - 0x5852, 0x5853, 0x5855, 0x5856, 0x5857, 0x5859, 0x585a, 0x585b, - 0x585c, 0x585d, 0x585f, 0x5860, 0x5861, 0x5862, 0x5863, 0x5864, - 0x5866, 0x5867, 0x5868, 0x5869, 0x586a, 0x586d, 0x586e, 0x586f, - 0x5870, 0x5871, 0x5872, 0x5873, 0x5874, 0x5875, 0x5876, 0x5877, - 0x5878, 0x5879, 0x587a, 0x587b, 0x587c, 0x587d, 0x587f, 0x5882, - 0x5884, 0x5886, 0x5887, 0x5888, 0x588a, 0x588b, 0x588c, 0x588d, - 0x588e, 0x588f, 0x5890, 0x5891, 0x5894, 0x5895, 0x5896, 0x5897, - 0x5898, 0x589b, 0x589c, 0x589d, 0x58a0, 0x58a1, 0x58a2, 0x58a3, - 0x58a4, 0x58a5, 0x58a6, 0x58a7, 0x58aa, 0x58ab, 0x58ac, 0x58ad, - 0x58ae, 0x58af, 0x58b0, 0x58b1, 0x58b2, 0x58b3, 0x58b4, 0x58b5, - 0x58b6, 0x58b7, 0x58b8, 0x58b9, 0x58ba, 0x58bb, 0x58bd, 0x58be, - 0x58bf, 0x58c0, 0x58c2, 0x58c3, 0x58c4, 0x58c6, 0x58c7, 0x58c8, - 0x58c9, 0x58ca, 0x58cb, 0x58cc, 0x58cd, 0x58ce, 0x58cf, 0x58d0, - 0x58d2, 0x58d3, 0x58d4, 0x58d6, 0x58d7, 0x58d8, 0x58d9, 0x58da, - 0x58db, 0x58dc, 0x58dd, 0x58de, 0x58df, 0x58e0, 0x58e1, 0x58e2, - 0x58e3, 0x58e5, 0x58e6, 0x58e7, 0x58e8, 0x58e9, 0x58ea, 0x58ed, - 0x58ef, 0x58f1, 0x58f2, 0x58f4, 0x58f5, 0x58f7, 0x58f8, 0x58fa, - 0x58fb, 0x58fc, 0x58fd, 0x58fe, 0x58ff, 0x5900, 0x5901, 0x5903, - 0x5905, 0x5906, 0x5908, 0x5909, 0x590a, 0x590b, 0x590c, 0x590e, - 0x5910, 0x5911, 0x5912, 0x5913, 0x5917, 0x5918, 0x591b, 0x591d, - 0x591e, 0x5920, 0x5921, 0x5922, 0x5923, 0x5926, 0x5928, 0x592c, - 0x5930, 0x5932, 0x5933, 0x5935, 0x5936, 0x593b, - /* 0x8a */ - 0x593d, 0x593e, 0x593f, 0x5940, 0x5943, 0x5945, 0x5946, 0x594a, - 0x594c, 0x594d, 0x5950, 0x5952, 0x5953, 0x5959, 0x595b, 0x595c, - 0x595d, 0x595e, 0x595f, 0x5961, 0x5963, 0x5964, 0x5966, 0x5967, - 0x5968, 0x5969, 0x596a, 0x596b, 0x596c, 0x596d, 0x596e, 0x596f, - 0x5970, 0x5971, 0x5972, 0x5975, 0x5977, 0x597a, 0x597b, 0x597c, - 0x597e, 0x597f, 0x5980, 0x5985, 0x5989, 0x598b, 0x598c, 0x598e, - 0x598f, 0x5990, 0x5991, 0x5994, 0x5995, 0x5998, 0x599a, 0x599b, - 0x599c, 0x599d, 0x599f, 0x59a0, 0x59a1, 0x59a2, 0x59a6, 0x59a7, - 0x59ac, 0x59ad, 0x59b0, 0x59b1, 0x59b3, 0x59b4, 0x59b5, 0x59b6, - 0x59b7, 0x59b8, 0x59ba, 0x59bc, 0x59bd, 0x59bf, 0x59c0, 0x59c1, - 0x59c2, 0x59c3, 0x59c4, 0x59c5, 0x59c7, 0x59c8, 0x59c9, 0x59cc, - 0x59cd, 0x59ce, 0x59cf, 0x59d5, 0x59d6, 0x59d9, 0x59db, 0x59de, - 0x59df, 0x59e0, 0x59e1, 0x59e2, 0x59e4, 0x59e6, 0x59e7, 0x59e9, - 0x59ea, 0x59eb, 0x59ed, 0x59ee, 0x59ef, 0x59f0, 0x59f1, 0x59f2, - 0x59f3, 0x59f4, 0x59f5, 0x59f6, 0x59f7, 0x59f8, 0x59fa, 0x59fc, - 0x59fd, 0x59fe, 0x5a00, 0x5a02, 0x5a0a, 0x5a0b, 0x5a0d, 0x5a0e, - 0x5a0f, 0x5a10, 0x5a12, 0x5a14, 0x5a15, 0x5a16, 0x5a17, 0x5a19, - 0x5a1a, 0x5a1b, 0x5a1d, 0x5a1e, 0x5a21, 0x5a22, 0x5a24, 0x5a26, - 0x5a27, 0x5a28, 0x5a2a, 0x5a2b, 0x5a2c, 0x5a2d, 0x5a2e, 0x5a2f, - 0x5a30, 0x5a33, 0x5a35, 0x5a37, 0x5a38, 0x5a39, 0x5a3a, 0x5a3b, - 0x5a3d, 0x5a3e, 0x5a3f, 0x5a41, 0x5a42, 0x5a43, 0x5a44, 0x5a45, - 0x5a47, 0x5a48, 0x5a4b, 0x5a4c, 0x5a4d, 0x5a4e, 0x5a4f, 0x5a50, - 0x5a51, 0x5a52, 0x5a53, 0x5a54, 0x5a56, 0x5a57, 0x5a58, 0x5a59, - 0x5a5b, 0x5a5c, 0x5a5d, 0x5a5e, 0x5a5f, 0x5a60, - /* 0x8b */ - 0x5a61, 0x5a63, 0x5a64, 0x5a65, 0x5a66, 0x5a68, 0x5a69, 0x5a6b, - 0x5a6c, 0x5a6d, 0x5a6e, 0x5a6f, 0x5a70, 0x5a71, 0x5a72, 0x5a73, - 0x5a78, 0x5a79, 0x5a7b, 0x5a7c, 0x5a7d, 0x5a7e, 0x5a80, 0x5a81, - 0x5a82, 0x5a83, 0x5a84, 0x5a85, 0x5a86, 0x5a87, 0x5a88, 0x5a89, - 0x5a8a, 0x5a8b, 0x5a8c, 0x5a8d, 0x5a8e, 0x5a8f, 0x5a90, 0x5a91, - 0x5a93, 0x5a94, 0x5a95, 0x5a96, 0x5a97, 0x5a98, 0x5a99, 0x5a9c, - 0x5a9d, 0x5a9e, 0x5a9f, 0x5aa0, 0x5aa1, 0x5aa2, 0x5aa3, 0x5aa4, - 0x5aa5, 0x5aa6, 0x5aa7, 0x5aa8, 0x5aa9, 0x5aab, 0x5aac, 0x5aad, - 0x5aae, 0x5aaf, 0x5ab0, 0x5ab1, 0x5ab4, 0x5ab6, 0x5ab7, 0x5ab9, - 0x5aba, 0x5abb, 0x5abc, 0x5abd, 0x5abf, 0x5ac0, 0x5ac3, 0x5ac4, - 0x5ac5, 0x5ac6, 0x5ac7, 0x5ac8, 0x5aca, 0x5acb, 0x5acd, 0x5ace, - 0x5acf, 0x5ad0, 0x5ad1, 0x5ad3, 0x5ad5, 0x5ad7, 0x5ad9, 0x5ada, - 0x5adb, 0x5add, 0x5ade, 0x5adf, 0x5ae2, 0x5ae4, 0x5ae5, 0x5ae7, - 0x5ae8, 0x5aea, 0x5aec, 0x5aed, 0x5aee, 0x5aef, 0x5af0, 0x5af2, - 0x5af3, 0x5af4, 0x5af5, 0x5af6, 0x5af7, 0x5af8, 0x5af9, 0x5afa, - 0x5afb, 0x5afc, 0x5afd, 0x5afe, 0x5aff, 0x5b00, 0x5b01, 0x5b02, - 0x5b03, 0x5b04, 0x5b05, 0x5b06, 0x5b07, 0x5b08, 0x5b0a, 0x5b0b, - 0x5b0c, 0x5b0d, 0x5b0e, 0x5b0f, 0x5b10, 0x5b11, 0x5b12, 0x5b13, - 0x5b14, 0x5b15, 0x5b18, 0x5b19, 0x5b1a, 0x5b1b, 0x5b1c, 0x5b1d, - 0x5b1e, 0x5b1f, 0x5b20, 0x5b21, 0x5b22, 0x5b23, 0x5b24, 0x5b25, - 0x5b26, 0x5b27, 0x5b28, 0x5b29, 0x5b2a, 0x5b2b, 0x5b2c, 0x5b2d, - 0x5b2e, 0x5b2f, 0x5b30, 0x5b31, 0x5b33, 0x5b35, 0x5b36, 0x5b38, - 0x5b39, 0x5b3a, 0x5b3b, 0x5b3c, 0x5b3d, 0x5b3e, 0x5b3f, 0x5b41, - 0x5b42, 0x5b43, 0x5b44, 0x5b45, 0x5b46, 0x5b47, - /* 0x8c */ - 0x5b48, 0x5b49, 0x5b4a, 0x5b4b, 0x5b4c, 0x5b4d, 0x5b4e, 0x5b4f, - 0x5b52, 0x5b56, 0x5b5e, 0x5b60, 0x5b61, 0x5b67, 0x5b68, 0x5b6b, - 0x5b6d, 0x5b6e, 0x5b6f, 0x5b72, 0x5b74, 0x5b76, 0x5b77, 0x5b78, - 0x5b79, 0x5b7b, 0x5b7c, 0x5b7e, 0x5b7f, 0x5b82, 0x5b86, 0x5b8a, - 0x5b8d, 0x5b8e, 0x5b90, 0x5b91, 0x5b92, 0x5b94, 0x5b96, 0x5b9f, - 0x5ba7, 0x5ba8, 0x5ba9, 0x5bac, 0x5bad, 0x5bae, 0x5baf, 0x5bb1, - 0x5bb2, 0x5bb7, 0x5bba, 0x5bbb, 0x5bbc, 0x5bc0, 0x5bc1, 0x5bc3, - 0x5bc8, 0x5bc9, 0x5bca, 0x5bcb, 0x5bcd, 0x5bce, 0x5bcf, 0x5bd1, - 0x5bd4, 0x5bd5, 0x5bd6, 0x5bd7, 0x5bd8, 0x5bd9, 0x5bda, 0x5bdb, - 0x5bdc, 0x5be0, 0x5be2, 0x5be3, 0x5be6, 0x5be7, 0x5be9, 0x5bea, - 0x5beb, 0x5bec, 0x5bed, 0x5bef, 0x5bf1, 0x5bf2, 0x5bf3, 0x5bf4, - 0x5bf5, 0x5bf6, 0x5bf7, 0x5bfd, 0x5bfe, 0x5c00, 0x5c02, 0x5c03, - 0x5c05, 0x5c07, 0x5c08, 0x5c0b, 0x5c0c, 0x5c0d, 0x5c0e, 0x5c10, - 0x5c12, 0x5c13, 0x5c17, 0x5c19, 0x5c1b, 0x5c1e, 0x5c1f, 0x5c20, - 0x5c21, 0x5c23, 0x5c26, 0x5c28, 0x5c29, 0x5c2a, 0x5c2b, 0x5c2d, - 0x5c2e, 0x5c2f, 0x5c30, 0x5c32, 0x5c33, 0x5c35, 0x5c36, 0x5c37, - 0x5c43, 0x5c44, 0x5c46, 0x5c47, 0x5c4c, 0x5c4d, 0x5c52, 0x5c53, - 0x5c54, 0x5c56, 0x5c57, 0x5c58, 0x5c5a, 0x5c5b, 0x5c5c, 0x5c5d, - 0x5c5f, 0x5c62, 0x5c64, 0x5c67, 0x5c68, 0x5c69, 0x5c6a, 0x5c6b, - 0x5c6c, 0x5c6d, 0x5c70, 0x5c72, 0x5c73, 0x5c74, 0x5c75, 0x5c76, - 0x5c77, 0x5c78, 0x5c7b, 0x5c7c, 0x5c7d, 0x5c7e, 0x5c80, 0x5c83, - 0x5c84, 0x5c85, 0x5c86, 0x5c87, 0x5c89, 0x5c8a, 0x5c8b, 0x5c8e, - 0x5c8f, 0x5c92, 0x5c93, 0x5c95, 0x5c9d, 0x5c9e, 0x5c9f, 0x5ca0, - 0x5ca1, 0x5ca4, 0x5ca5, 0x5ca6, 0x5ca7, 0x5ca8, - /* 0x8d */ - 0x5caa, 0x5cae, 0x5caf, 0x5cb0, 0x5cb2, 0x5cb4, 0x5cb6, 0x5cb9, - 0x5cba, 0x5cbb, 0x5cbc, 0x5cbe, 0x5cc0, 0x5cc2, 0x5cc3, 0x5cc5, - 0x5cc6, 0x5cc7, 0x5cc8, 0x5cc9, 0x5cca, 0x5ccc, 0x5ccd, 0x5cce, - 0x5ccf, 0x5cd0, 0x5cd1, 0x5cd3, 0x5cd4, 0x5cd5, 0x5cd6, 0x5cd7, - 0x5cd8, 0x5cda, 0x5cdb, 0x5cdc, 0x5cdd, 0x5cde, 0x5cdf, 0x5ce0, - 0x5ce2, 0x5ce3, 0x5ce7, 0x5ce9, 0x5ceb, 0x5cec, 0x5cee, 0x5cef, - 0x5cf1, 0x5cf2, 0x5cf3, 0x5cf4, 0x5cf5, 0x5cf6, 0x5cf7, 0x5cf8, - 0x5cf9, 0x5cfa, 0x5cfc, 0x5cfd, 0x5cfe, 0x5cff, 0x5d00, 0x5d01, - 0x5d04, 0x5d05, 0x5d08, 0x5d09, 0x5d0a, 0x5d0b, 0x5d0c, 0x5d0d, - 0x5d0f, 0x5d10, 0x5d11, 0x5d12, 0x5d13, 0x5d15, 0x5d17, 0x5d18, - 0x5d19, 0x5d1a, 0x5d1c, 0x5d1d, 0x5d1f, 0x5d20, 0x5d21, 0x5d22, - 0x5d23, 0x5d25, 0x5d28, 0x5d2a, 0x5d2b, 0x5d2c, 0x5d2f, 0x5d30, - 0x5d31, 0x5d32, 0x5d33, 0x5d35, 0x5d36, 0x5d37, 0x5d38, 0x5d39, - 0x5d3a, 0x5d3b, 0x5d3c, 0x5d3f, 0x5d40, 0x5d41, 0x5d42, 0x5d43, - 0x5d44, 0x5d45, 0x5d46, 0x5d48, 0x5d49, 0x5d4d, 0x5d4e, 0x5d4f, - 0x5d50, 0x5d51, 0x5d52, 0x5d53, 0x5d54, 0x5d55, 0x5d56, 0x5d57, - 0x5d59, 0x5d5a, 0x5d5c, 0x5d5e, 0x5d5f, 0x5d60, 0x5d61, 0x5d62, - 0x5d63, 0x5d64, 0x5d65, 0x5d66, 0x5d67, 0x5d68, 0x5d6a, 0x5d6d, - 0x5d6e, 0x5d70, 0x5d71, 0x5d72, 0x5d73, 0x5d75, 0x5d76, 0x5d77, - 0x5d78, 0x5d79, 0x5d7a, 0x5d7b, 0x5d7c, 0x5d7d, 0x5d7e, 0x5d7f, - 0x5d80, 0x5d81, 0x5d83, 0x5d84, 0x5d85, 0x5d86, 0x5d87, 0x5d88, - 0x5d89, 0x5d8a, 0x5d8b, 0x5d8c, 0x5d8d, 0x5d8e, 0x5d8f, 0x5d90, - 0x5d91, 0x5d92, 0x5d93, 0x5d94, 0x5d95, 0x5d96, 0x5d97, 0x5d98, - 0x5d9a, 0x5d9b, 0x5d9c, 0x5d9e, 0x5d9f, 0x5da0, - /* 0x8e */ - 0x5da1, 0x5da2, 0x5da3, 0x5da4, 0x5da5, 0x5da6, 0x5da7, 0x5da8, - 0x5da9, 0x5daa, 0x5dab, 0x5dac, 0x5dad, 0x5dae, 0x5daf, 0x5db0, - 0x5db1, 0x5db2, 0x5db3, 0x5db4, 0x5db5, 0x5db6, 0x5db8, 0x5db9, - 0x5dba, 0x5dbb, 0x5dbc, 0x5dbd, 0x5dbe, 0x5dbf, 0x5dc0, 0x5dc1, - 0x5dc2, 0x5dc3, 0x5dc4, 0x5dc6, 0x5dc7, 0x5dc8, 0x5dc9, 0x5dca, - 0x5dcb, 0x5dcc, 0x5dce, 0x5dcf, 0x5dd0, 0x5dd1, 0x5dd2, 0x5dd3, - 0x5dd4, 0x5dd5, 0x5dd6, 0x5dd7, 0x5dd8, 0x5dd9, 0x5dda, 0x5ddc, - 0x5ddf, 0x5de0, 0x5de3, 0x5de4, 0x5dea, 0x5dec, 0x5ded, 0x5df0, - 0x5df5, 0x5df6, 0x5df8, 0x5df9, 0x5dfa, 0x5dfb, 0x5dfc, 0x5dff, - 0x5e00, 0x5e04, 0x5e07, 0x5e09, 0x5e0a, 0x5e0b, 0x5e0d, 0x5e0e, - 0x5e12, 0x5e13, 0x5e17, 0x5e1e, 0x5e1f, 0x5e20, 0x5e21, 0x5e22, - 0x5e23, 0x5e24, 0x5e25, 0x5e28, 0x5e29, 0x5e2a, 0x5e2b, 0x5e2c, - 0x5e2f, 0x5e30, 0x5e32, 0x5e33, 0x5e34, 0x5e35, 0x5e36, 0x5e39, - 0x5e3a, 0x5e3e, 0x5e3f, 0x5e40, 0x5e41, 0x5e43, 0x5e46, 0x5e47, - 0x5e48, 0x5e49, 0x5e4a, 0x5e4b, 0x5e4d, 0x5e4e, 0x5e4f, 0x5e50, - 0x5e51, 0x5e52, 0x5e53, 0x5e56, 0x5e57, 0x5e58, 0x5e59, 0x5e5a, - 0x5e5c, 0x5e5d, 0x5e5f, 0x5e60, 0x5e63, 0x5e64, 0x5e65, 0x5e66, - 0x5e67, 0x5e68, 0x5e69, 0x5e6a, 0x5e6b, 0x5e6c, 0x5e6d, 0x5e6e, - 0x5e6f, 0x5e70, 0x5e71, 0x5e75, 0x5e77, 0x5e79, 0x5e7e, 0x5e81, - 0x5e82, 0x5e83, 0x5e85, 0x5e88, 0x5e89, 0x5e8c, 0x5e8d, 0x5e8e, - 0x5e92, 0x5e98, 0x5e9b, 0x5e9d, 0x5ea1, 0x5ea2, 0x5ea3, 0x5ea4, - 0x5ea8, 0x5ea9, 0x5eaa, 0x5eab, 0x5eac, 0x5eae, 0x5eaf, 0x5eb0, - 0x5eb1, 0x5eb2, 0x5eb4, 0x5eba, 0x5ebb, 0x5ebc, 0x5ebd, 0x5ebf, - 0x5ec0, 0x5ec1, 0x5ec2, 0x5ec3, 0x5ec4, 0x5ec5, - /* 0x8f */ - 0x5ec6, 0x5ec7, 0x5ec8, 0x5ecb, 0x5ecc, 0x5ecd, 0x5ece, 0x5ecf, - 0x5ed0, 0x5ed4, 0x5ed5, 0x5ed7, 0x5ed8, 0x5ed9, 0x5eda, 0x5edc, - 0x5edd, 0x5ede, 0x5edf, 0x5ee0, 0x5ee1, 0x5ee2, 0x5ee3, 0x5ee4, - 0x5ee5, 0x5ee6, 0x5ee7, 0x5ee9, 0x5eeb, 0x5eec, 0x5eed, 0x5eee, - 0x5eef, 0x5ef0, 0x5ef1, 0x5ef2, 0x5ef3, 0x5ef5, 0x5ef8, 0x5ef9, - 0x5efb, 0x5efc, 0x5efd, 0x5f05, 0x5f06, 0x5f07, 0x5f09, 0x5f0c, - 0x5f0d, 0x5f0e, 0x5f10, 0x5f12, 0x5f14, 0x5f16, 0x5f19, 0x5f1a, - 0x5f1c, 0x5f1d, 0x5f1e, 0x5f21, 0x5f22, 0x5f23, 0x5f24, 0x5f28, - 0x5f2b, 0x5f2c, 0x5f2e, 0x5f30, 0x5f32, 0x5f33, 0x5f34, 0x5f35, - 0x5f36, 0x5f37, 0x5f38, 0x5f3b, 0x5f3d, 0x5f3e, 0x5f3f, 0x5f41, - 0x5f42, 0x5f43, 0x5f44, 0x5f45, 0x5f46, 0x5f47, 0x5f48, 0x5f49, - 0x5f4a, 0x5f4b, 0x5f4c, 0x5f4d, 0x5f4e, 0x5f4f, 0x5f51, 0x5f54, - 0x5f59, 0x5f5a, 0x5f5b, 0x5f5c, 0x5f5e, 0x5f5f, 0x5f60, 0x5f63, - 0x5f65, 0x5f67, 0x5f68, 0x5f6b, 0x5f6e, 0x5f6f, 0x5f72, 0x5f74, - 0x5f75, 0x5f76, 0x5f78, 0x5f7a, 0x5f7d, 0x5f7e, 0x5f7f, 0x5f83, - 0x5f86, 0x5f8d, 0x5f8e, 0x5f8f, 0x5f91, 0x5f93, 0x5f94, 0x5f96, - 0x5f9a, 0x5f9b, 0x5f9d, 0x5f9e, 0x5f9f, 0x5fa0, 0x5fa2, 0x5fa3, - 0x5fa4, 0x5fa5, 0x5fa6, 0x5fa7, 0x5fa9, 0x5fab, 0x5fac, 0x5faf, - 0x5fb0, 0x5fb1, 0x5fb2, 0x5fb3, 0x5fb4, 0x5fb6, 0x5fb8, 0x5fb9, - 0x5fba, 0x5fbb, 0x5fbe, 0x5fbf, 0x5fc0, 0x5fc1, 0x5fc2, 0x5fc7, - 0x5fc8, 0x5fca, 0x5fcb, 0x5fce, 0x5fd3, 0x5fd4, 0x5fd5, 0x5fda, - 0x5fdb, 0x5fdc, 0x5fde, 0x5fdf, 0x5fe2, 0x5fe3, 0x5fe5, 0x5fe6, - 0x5fe8, 0x5fe9, 0x5fec, 0x5fef, 0x5ff0, 0x5ff2, 0x5ff3, 0x5ff4, - 0x5ff6, 0x5ff7, 0x5ff9, 0x5ffa, 0x5ffc, 0x6007, - /* 0x90 */ - 0x6008, 0x6009, 0x600b, 0x600c, 0x6010, 0x6011, 0x6013, 0x6017, - 0x6018, 0x601a, 0x601e, 0x601f, 0x6022, 0x6023, 0x6024, 0x602c, - 0x602d, 0x602e, 0x6030, 0x6031, 0x6032, 0x6033, 0x6034, 0x6036, - 0x6037, 0x6038, 0x6039, 0x603a, 0x603d, 0x603e, 0x6040, 0x6044, - 0x6045, 0x6046, 0x6047, 0x6048, 0x6049, 0x604a, 0x604c, 0x604e, - 0x604f, 0x6051, 0x6053, 0x6054, 0x6056, 0x6057, 0x6058, 0x605b, - 0x605c, 0x605e, 0x605f, 0x6060, 0x6061, 0x6065, 0x6066, 0x606e, - 0x6071, 0x6072, 0x6074, 0x6075, 0x6077, 0x607e, 0x6080, 0x6081, - 0x6082, 0x6085, 0x6086, 0x6087, 0x6088, 0x608a, 0x608b, 0x608e, - 0x608f, 0x6090, 0x6091, 0x6093, 0x6095, 0x6097, 0x6098, 0x6099, - 0x609c, 0x609e, 0x60a1, 0x60a2, 0x60a4, 0x60a5, 0x60a7, 0x60a9, - 0x60aa, 0x60ae, 0x60b0, 0x60b3, 0x60b5, 0x60b6, 0x60b7, 0x60b9, - 0x60ba, 0x60bd, 0x60be, 0x60bf, 0x60c0, 0x60c1, 0x60c2, 0x60c3, - 0x60c4, 0x60c7, 0x60c8, 0x60c9, 0x60cc, 0x60cd, 0x60ce, 0x60cf, - 0x60d0, 0x60d2, 0x60d3, 0x60d4, 0x60d6, 0x60d7, 0x60d9, 0x60db, - 0x60de, 0x60e1, 0x60e2, 0x60e3, 0x60e4, 0x60e5, 0x60ea, 0x60f1, - 0x60f2, 0x60f5, 0x60f7, 0x60f8, 0x60fb, 0x60fc, 0x60fd, 0x60fe, - 0x60ff, 0x6102, 0x6103, 0x6104, 0x6105, 0x6107, 0x610a, 0x610b, - 0x610c, 0x6110, 0x6111, 0x6112, 0x6113, 0x6114, 0x6116, 0x6117, - 0x6118, 0x6119, 0x611b, 0x611c, 0x611d, 0x611e, 0x6121, 0x6122, - 0x6125, 0x6128, 0x6129, 0x612a, 0x612c, 0x612d, 0x612e, 0x612f, - 0x6130, 0x6131, 0x6132, 0x6133, 0x6134, 0x6135, 0x6136, 0x6137, - 0x6138, 0x6139, 0x613a, 0x613b, 0x613c, 0x613d, 0x613e, 0x6140, - 0x6141, 0x6142, 0x6143, 0x6144, 0x6145, 0x6146, - /* 0x91 */ - 0x6147, 0x6149, 0x614b, 0x614d, 0x614f, 0x6150, 0x6152, 0x6153, - 0x6154, 0x6156, 0x6157, 0x6158, 0x6159, 0x615a, 0x615b, 0x615c, - 0x615e, 0x615f, 0x6160, 0x6161, 0x6163, 0x6164, 0x6165, 0x6166, - 0x6169, 0x616a, 0x616b, 0x616c, 0x616d, 0x616e, 0x616f, 0x6171, - 0x6172, 0x6173, 0x6174, 0x6176, 0x6178, 0x6179, 0x617a, 0x617b, - 0x617c, 0x617d, 0x617e, 0x617f, 0x6180, 0x6181, 0x6182, 0x6183, - 0x6184, 0x6185, 0x6186, 0x6187, 0x6188, 0x6189, 0x618a, 0x618c, - 0x618d, 0x618f, 0x6190, 0x6191, 0x6192, 0x6193, 0x6195, 0x6196, - 0x6197, 0x6198, 0x6199, 0x619a, 0x619b, 0x619c, 0x619e, 0x619f, - 0x61a0, 0x61a1, 0x61a2, 0x61a3, 0x61a4, 0x61a5, 0x61a6, 0x61aa, - 0x61ab, 0x61ad, 0x61ae, 0x61af, 0x61b0, 0x61b1, 0x61b2, 0x61b3, - 0x61b4, 0x61b5, 0x61b6, 0x61b8, 0x61b9, 0x61ba, 0x61bb, 0x61bc, - 0x61bd, 0x61bf, 0x61c0, 0x61c1, 0x61c3, 0x61c4, 0x61c5, 0x61c6, - 0x61c7, 0x61c9, 0x61cc, 0x61cd, 0x61ce, 0x61cf, 0x61d0, 0x61d3, - 0x61d5, 0x61d6, 0x61d7, 0x61d8, 0x61d9, 0x61da, 0x61db, 0x61dc, - 0x61dd, 0x61de, 0x61df, 0x61e0, 0x61e1, 0x61e2, 0x61e3, 0x61e4, - 0x61e5, 0x61e7, 0x61e8, 0x61e9, 0x61ea, 0x61eb, 0x61ec, 0x61ed, - 0x61ee, 0x61ef, 0x61f0, 0x61f1, 0x61f2, 0x61f3, 0x61f4, 0x61f6, - 0x61f7, 0x61f8, 0x61f9, 0x61fa, 0x61fb, 0x61fc, 0x61fd, 0x61fe, - 0x6200, 0x6201, 0x6202, 0x6203, 0x6204, 0x6205, 0x6207, 0x6209, - 0x6213, 0x6214, 0x6219, 0x621c, 0x621d, 0x621e, 0x6220, 0x6223, - 0x6226, 0x6227, 0x6228, 0x6229, 0x622b, 0x622d, 0x622f, 0x6230, - 0x6231, 0x6232, 0x6235, 0x6236, 0x6238, 0x6239, 0x623a, 0x623b, - 0x623c, 0x6242, 0x6244, 0x6245, 0x6246, 0x624a, - /* 0x92 */ - 0x624f, 0x6250, 0x6255, 0x6256, 0x6257, 0x6259, 0x625a, 0x625c, - 0x625d, 0x625e, 0x625f, 0x6260, 0x6261, 0x6262, 0x6264, 0x6265, - 0x6268, 0x6271, 0x6272, 0x6274, 0x6275, 0x6277, 0x6278, 0x627a, - 0x627b, 0x627d, 0x6281, 0x6282, 0x6283, 0x6285, 0x6286, 0x6287, - 0x6288, 0x628b, 0x628c, 0x628d, 0x628e, 0x628f, 0x6290, 0x6294, - 0x6299, 0x629c, 0x629d, 0x629e, 0x62a3, 0x62a6, 0x62a7, 0x62a9, - 0x62aa, 0x62ad, 0x62ae, 0x62af, 0x62b0, 0x62b2, 0x62b3, 0x62b4, - 0x62b6, 0x62b7, 0x62b8, 0x62ba, 0x62be, 0x62c0, 0x62c1, 0x62c3, - 0x62cb, 0x62cf, 0x62d1, 0x62d5, 0x62dd, 0x62de, 0x62e0, 0x62e1, - 0x62e4, 0x62ea, 0x62eb, 0x62f0, 0x62f2, 0x62f5, 0x62f8, 0x62f9, - 0x62fa, 0x62fb, 0x6300, 0x6303, 0x6304, 0x6305, 0x6306, 0x630a, - 0x630b, 0x630c, 0x630d, 0x630f, 0x6310, 0x6312, 0x6313, 0x6314, - 0x6315, 0x6317, 0x6318, 0x6319, 0x631c, 0x6326, 0x6327, 0x6329, - 0x632c, 0x632d, 0x632e, 0x6330, 0x6331, 0x6333, 0x6334, 0x6335, - 0x6336, 0x6337, 0x6338, 0x633b, 0x633c, 0x633e, 0x633f, 0x6340, - 0x6341, 0x6344, 0x6347, 0x6348, 0x634a, 0x6351, 0x6352, 0x6353, - 0x6354, 0x6356, 0x6357, 0x6358, 0x6359, 0x635a, 0x635b, 0x635c, - 0x635d, 0x6360, 0x6364, 0x6365, 0x6366, 0x6368, 0x636a, 0x636b, - 0x636c, 0x636f, 0x6370, 0x6372, 0x6373, 0x6374, 0x6375, 0x6378, - 0x6379, 0x637c, 0x637d, 0x637e, 0x637f, 0x6381, 0x6383, 0x6384, - 0x6385, 0x6386, 0x638b, 0x638d, 0x6391, 0x6393, 0x6394, 0x6395, - 0x6397, 0x6399, 0x639a, 0x639b, 0x639c, 0x639d, 0x639e, 0x639f, - 0x63a1, 0x63a4, 0x63a6, 0x63ab, 0x63af, 0x63b1, 0x63b2, 0x63b5, - 0x63b6, 0x63b9, 0x63bb, 0x63bd, 0x63bf, 0x63c0, - /* 0x93 */ - 0x63c1, 0x63c2, 0x63c3, 0x63c5, 0x63c7, 0x63c8, 0x63ca, 0x63cb, - 0x63cc, 0x63d1, 0x63d3, 0x63d4, 0x63d5, 0x63d7, 0x63d8, 0x63d9, - 0x63da, 0x63db, 0x63dc, 0x63dd, 0x63df, 0x63e2, 0x63e4, 0x63e5, - 0x63e6, 0x63e7, 0x63e8, 0x63eb, 0x63ec, 0x63ee, 0x63ef, 0x63f0, - 0x63f1, 0x63f3, 0x63f5, 0x63f7, 0x63f9, 0x63fa, 0x63fb, 0x63fc, - 0x63fe, 0x6403, 0x6404, 0x6406, 0x6407, 0x6408, 0x6409, 0x640a, - 0x640d, 0x640e, 0x6411, 0x6412, 0x6415, 0x6416, 0x6417, 0x6418, - 0x6419, 0x641a, 0x641d, 0x641f, 0x6422, 0x6423, 0x6424, 0x6425, - 0x6427, 0x6428, 0x6429, 0x642b, 0x642e, 0x642f, 0x6430, 0x6431, - 0x6432, 0x6433, 0x6435, 0x6436, 0x6437, 0x6438, 0x6439, 0x643b, - 0x643c, 0x643e, 0x6440, 0x6442, 0x6443, 0x6449, 0x644b, 0x644c, - 0x644d, 0x644e, 0x644f, 0x6450, 0x6451, 0x6453, 0x6455, 0x6456, - 0x6457, 0x6459, 0x645a, 0x645b, 0x645c, 0x645d, 0x645f, 0x6460, - 0x6461, 0x6462, 0x6463, 0x6464, 0x6465, 0x6466, 0x6468, 0x646a, - 0x646b, 0x646c, 0x646e, 0x646f, 0x6470, 0x6471, 0x6472, 0x6473, - 0x6474, 0x6475, 0x6476, 0x6477, 0x647b, 0x647c, 0x647d, 0x647e, - 0x647f, 0x6480, 0x6481, 0x6483, 0x6486, 0x6488, 0x6489, 0x648a, - 0x648b, 0x648c, 0x648d, 0x648e, 0x648f, 0x6490, 0x6493, 0x6494, - 0x6497, 0x6498, 0x649a, 0x649b, 0x649c, 0x649d, 0x649f, 0x64a0, - 0x64a1, 0x64a2, 0x64a3, 0x64a5, 0x64a6, 0x64a7, 0x64a8, 0x64aa, - 0x64ab, 0x64af, 0x64b1, 0x64b2, 0x64b3, 0x64b4, 0x64b6, 0x64b9, - 0x64bb, 0x64bd, 0x64be, 0x64bf, 0x64c1, 0x64c3, 0x64c4, 0x64c6, - 0x64c7, 0x64c8, 0x64c9, 0x64ca, 0x64cb, 0x64cc, 0x64cf, 0x64d1, - 0x64d3, 0x64d4, 0x64d5, 0x64d6, 0x64d9, 0x64da, - /* 0x94 */ - 0x64db, 0x64dc, 0x64dd, 0x64df, 0x64e0, 0x64e1, 0x64e3, 0x64e5, - 0x64e7, 0x64e8, 0x64e9, 0x64ea, 0x64eb, 0x64ec, 0x64ed, 0x64ee, - 0x64ef, 0x64f0, 0x64f1, 0x64f2, 0x64f3, 0x64f4, 0x64f5, 0x64f6, - 0x64f7, 0x64f8, 0x64f9, 0x64fa, 0x64fb, 0x64fc, 0x64fd, 0x64fe, - 0x64ff, 0x6501, 0x6502, 0x6503, 0x6504, 0x6505, 0x6506, 0x6507, - 0x6508, 0x650a, 0x650b, 0x650c, 0x650d, 0x650e, 0x650f, 0x6510, - 0x6511, 0x6513, 0x6514, 0x6515, 0x6516, 0x6517, 0x6519, 0x651a, - 0x651b, 0x651c, 0x651d, 0x651e, 0x651f, 0x6520, 0x6521, 0x6522, - 0x6523, 0x6524, 0x6526, 0x6527, 0x6528, 0x6529, 0x652a, 0x652c, - 0x652d, 0x6530, 0x6531, 0x6532, 0x6533, 0x6537, 0x653a, 0x653c, - 0x653d, 0x6540, 0x6541, 0x6542, 0x6543, 0x6544, 0x6546, 0x6547, - 0x654a, 0x654b, 0x654d, 0x654e, 0x6550, 0x6552, 0x6553, 0x6554, - 0x6557, 0x6558, 0x655a, 0x655c, 0x655f, 0x6560, 0x6561, 0x6564, - 0x6565, 0x6567, 0x6568, 0x6569, 0x656a, 0x656d, 0x656e, 0x656f, - 0x6571, 0x6573, 0x6575, 0x6576, 0x6578, 0x6579, 0x657a, 0x657b, - 0x657c, 0x657d, 0x657e, 0x657f, 0x6580, 0x6581, 0x6582, 0x6583, - 0x6584, 0x6585, 0x6586, 0x6588, 0x6589, 0x658a, 0x658d, 0x658e, - 0x658f, 0x6592, 0x6594, 0x6595, 0x6596, 0x6598, 0x659a, 0x659d, - 0x659e, 0x65a0, 0x65a2, 0x65a3, 0x65a6, 0x65a8, 0x65aa, 0x65ac, - 0x65ae, 0x65b1, 0x65b2, 0x65b3, 0x65b4, 0x65b5, 0x65b6, 0x65b7, - 0x65b8, 0x65ba, 0x65bb, 0x65be, 0x65bf, 0x65c0, 0x65c2, 0x65c7, - 0x65c8, 0x65c9, 0x65ca, 0x65cd, 0x65d0, 0x65d1, 0x65d3, 0x65d4, - 0x65d5, 0x65d8, 0x65d9, 0x65da, 0x65db, 0x65dc, 0x65dd, 0x65de, - 0x65df, 0x65e1, 0x65e3, 0x65e4, 0x65ea, 0x65eb, - /* 0x95 */ - 0x65f2, 0x65f3, 0x65f4, 0x65f5, 0x65f8, 0x65f9, 0x65fb, 0x65fc, - 0x65fd, 0x65fe, 0x65ff, 0x6601, 0x6604, 0x6605, 0x6607, 0x6608, - 0x6609, 0x660b, 0x660d, 0x6610, 0x6611, 0x6612, 0x6616, 0x6617, - 0x6618, 0x661a, 0x661b, 0x661c, 0x661e, 0x6621, 0x6622, 0x6623, - 0x6624, 0x6626, 0x6629, 0x662a, 0x662b, 0x662c, 0x662e, 0x6630, - 0x6632, 0x6633, 0x6637, 0x6638, 0x6639, 0x663a, 0x663b, 0x663d, - 0x663f, 0x6640, 0x6642, 0x6644, 0x6645, 0x6646, 0x6647, 0x6648, - 0x6649, 0x664a, 0x664d, 0x664e, 0x6650, 0x6651, 0x6658, 0x6659, - 0x665b, 0x665c, 0x665d, 0x665e, 0x6660, 0x6662, 0x6663, 0x6665, - 0x6667, 0x6669, 0x666a, 0x666b, 0x666c, 0x666d, 0x6671, 0x6672, - 0x6673, 0x6675, 0x6678, 0x6679, 0x667b, 0x667c, 0x667d, 0x667f, - 0x6680, 0x6681, 0x6683, 0x6685, 0x6686, 0x6688, 0x6689, 0x668a, - 0x668b, 0x668d, 0x668e, 0x668f, 0x6690, 0x6692, 0x6693, 0x6694, - 0x6695, 0x6698, 0x6699, 0x669a, 0x669b, 0x669c, 0x669e, 0x669f, - 0x66a0, 0x66a1, 0x66a2, 0x66a3, 0x66a4, 0x66a5, 0x66a6, 0x66a9, - 0x66aa, 0x66ab, 0x66ac, 0x66ad, 0x66af, 0x66b0, 0x66b1, 0x66b2, - 0x66b3, 0x66b5, 0x66b6, 0x66b7, 0x66b8, 0x66ba, 0x66bb, 0x66bc, - 0x66bd, 0x66bf, 0x66c0, 0x66c1, 0x66c2, 0x66c3, 0x66c4, 0x66c5, - 0x66c6, 0x66c7, 0x66c8, 0x66c9, 0x66ca, 0x66cb, 0x66cc, 0x66cd, - 0x66ce, 0x66cf, 0x66d0, 0x66d1, 0x66d2, 0x66d3, 0x66d4, 0x66d5, - 0x66d6, 0x66d7, 0x66d8, 0x66da, 0x66de, 0x66df, 0x66e0, 0x66e1, - 0x66e2, 0x66e3, 0x66e4, 0x66e5, 0x66e7, 0x66e8, 0x66ea, 0x66eb, - 0x66ec, 0x66ed, 0x66ee, 0x66ef, 0x66f1, 0x66f5, 0x66f6, 0x66f8, - 0x66fa, 0x66fb, 0x66fd, 0x6701, 0x6702, 0x6703, - /* 0x96 */ - 0x6704, 0x6705, 0x6706, 0x6707, 0x670c, 0x670e, 0x670f, 0x6711, - 0x6712, 0x6713, 0x6716, 0x6718, 0x6719, 0x671a, 0x671c, 0x671e, - 0x6720, 0x6721, 0x6722, 0x6723, 0x6724, 0x6725, 0x6727, 0x6729, - 0x672e, 0x6730, 0x6732, 0x6733, 0x6736, 0x6737, 0x6738, 0x6739, - 0x673b, 0x673c, 0x673e, 0x673f, 0x6741, 0x6744, 0x6745, 0x6747, - 0x674a, 0x674b, 0x674d, 0x6752, 0x6754, 0x6755, 0x6757, 0x6758, - 0x6759, 0x675a, 0x675b, 0x675d, 0x6762, 0x6763, 0x6764, 0x6766, - 0x6767, 0x676b, 0x676c, 0x676e, 0x6771, 0x6774, 0x6776, 0x6778, - 0x6779, 0x677a, 0x677b, 0x677d, 0x6780, 0x6782, 0x6783, 0x6785, - 0x6786, 0x6788, 0x678a, 0x678c, 0x678d, 0x678e, 0x678f, 0x6791, - 0x6792, 0x6793, 0x6794, 0x6796, 0x6799, 0x679b, 0x679f, 0x67a0, - 0x67a1, 0x67a4, 0x67a6, 0x67a9, 0x67ac, 0x67ae, 0x67b1, 0x67b2, - 0x67b4, 0x67b9, 0x67ba, 0x67bb, 0x67bc, 0x67bd, 0x67be, 0x67bf, - 0x67c0, 0x67c2, 0x67c5, 0x67c6, 0x67c7, 0x67c8, 0x67c9, 0x67ca, - 0x67cb, 0x67cc, 0x67cd, 0x67ce, 0x67d5, 0x67d6, 0x67d7, 0x67db, - 0x67df, 0x67e1, 0x67e3, 0x67e4, 0x67e6, 0x67e7, 0x67e8, 0x67ea, - 0x67eb, 0x67ed, 0x67ee, 0x67f2, 0x67f5, 0x67f6, 0x67f7, 0x67f8, - 0x67f9, 0x67fa, 0x67fb, 0x67fc, 0x67fe, 0x6801, 0x6802, 0x6803, - 0x6804, 0x6806, 0x680d, 0x6810, 0x6812, 0x6814, 0x6815, 0x6818, - 0x6819, 0x681a, 0x681b, 0x681c, 0x681e, 0x681f, 0x6820, 0x6822, - 0x6823, 0x6824, 0x6825, 0x6826, 0x6827, 0x6828, 0x682b, 0x682c, - 0x682d, 0x682e, 0x682f, 0x6830, 0x6831, 0x6834, 0x6835, 0x6836, - 0x683a, 0x683b, 0x683f, 0x6847, 0x684b, 0x684d, 0x684f, 0x6852, - 0x6856, 0x6857, 0x6858, 0x6859, 0x685a, 0x685b, - /* 0x97 */ - 0x685c, 0x685d, 0x685e, 0x685f, 0x686a, 0x686c, 0x686d, 0x686e, - 0x686f, 0x6870, 0x6871, 0x6872, 0x6873, 0x6875, 0x6878, 0x6879, - 0x687a, 0x687b, 0x687c, 0x687d, 0x687e, 0x687f, 0x6880, 0x6882, - 0x6884, 0x6887, 0x6888, 0x6889, 0x688a, 0x688b, 0x688c, 0x688d, - 0x688e, 0x6890, 0x6891, 0x6892, 0x6894, 0x6895, 0x6896, 0x6898, - 0x6899, 0x689a, 0x689b, 0x689c, 0x689d, 0x689e, 0x689f, 0x68a0, - 0x68a1, 0x68a3, 0x68a4, 0x68a5, 0x68a9, 0x68aa, 0x68ab, 0x68ac, - 0x68ae, 0x68b1, 0x68b2, 0x68b4, 0x68b6, 0x68b7, 0x68b8, 0x68b9, - 0x68ba, 0x68bb, 0x68bc, 0x68bd, 0x68be, 0x68bf, 0x68c1, 0x68c3, - 0x68c4, 0x68c5, 0x68c6, 0x68c7, 0x68c8, 0x68ca, 0x68cc, 0x68ce, - 0x68cf, 0x68d0, 0x68d1, 0x68d3, 0x68d4, 0x68d6, 0x68d7, 0x68d9, - 0x68db, 0x68dc, 0x68dd, 0x68de, 0x68df, 0x68e1, 0x68e2, 0x68e4, - 0x68e5, 0x68e6, 0x68e7, 0x68e8, 0x68e9, 0x68ea, 0x68eb, 0x68ec, - 0x68ed, 0x68ef, 0x68f2, 0x68f3, 0x68f4, 0x68f6, 0x68f7, 0x68f8, - 0x68fb, 0x68fd, 0x68fe, 0x68ff, 0x6900, 0x6902, 0x6903, 0x6904, - 0x6906, 0x6907, 0x6908, 0x6909, 0x690a, 0x690c, 0x690f, 0x6911, - 0x6913, 0x6914, 0x6915, 0x6916, 0x6917, 0x6918, 0x6919, 0x691a, - 0x691b, 0x691c, 0x691d, 0x691e, 0x6921, 0x6922, 0x6923, 0x6925, - 0x6926, 0x6927, 0x6928, 0x6929, 0x692a, 0x692b, 0x692c, 0x692e, - 0x692f, 0x6931, 0x6932, 0x6933, 0x6935, 0x6936, 0x6937, 0x6938, - 0x693a, 0x693b, 0x693c, 0x693e, 0x6940, 0x6941, 0x6943, 0x6944, - 0x6945, 0x6946, 0x6947, 0x6948, 0x6949, 0x694a, 0x694b, 0x694c, - 0x694d, 0x694e, 0x694f, 0x6950, 0x6951, 0x6952, 0x6953, 0x6955, - 0x6956, 0x6958, 0x6959, 0x695b, 0x695c, 0x695f, - /* 0x98 */ - 0x6961, 0x6962, 0x6964, 0x6965, 0x6967, 0x6968, 0x6969, 0x696a, - 0x696c, 0x696d, 0x696f, 0x6970, 0x6972, 0x6973, 0x6974, 0x6975, - 0x6976, 0x697a, 0x697b, 0x697d, 0x697e, 0x697f, 0x6981, 0x6983, - 0x6985, 0x698a, 0x698b, 0x698c, 0x698e, 0x698f, 0x6990, 0x6991, - 0x6992, 0x6993, 0x6996, 0x6997, 0x6999, 0x699a, 0x699d, 0x699e, - 0x699f, 0x69a0, 0x69a1, 0x69a2, 0x69a3, 0x69a4, 0x69a5, 0x69a6, - 0x69a9, 0x69aa, 0x69ac, 0x69ae, 0x69af, 0x69b0, 0x69b2, 0x69b3, - 0x69b5, 0x69b6, 0x69b8, 0x69b9, 0x69ba, 0x69bc, 0x69bd, 0x69be, - 0x69bf, 0x69c0, 0x69c2, 0x69c3, 0x69c4, 0x69c5, 0x69c6, 0x69c7, - 0x69c8, 0x69c9, 0x69cb, 0x69cd, 0x69cf, 0x69d1, 0x69d2, 0x69d3, - 0x69d5, 0x69d6, 0x69d7, 0x69d8, 0x69d9, 0x69da, 0x69dc, 0x69dd, - 0x69de, 0x69e1, 0x69e2, 0x69e3, 0x69e4, 0x69e5, 0x69e6, 0x69e7, - 0x69e8, 0x69e9, 0x69ea, 0x69eb, 0x69ec, 0x69ee, 0x69ef, 0x69f0, - 0x69f1, 0x69f3, 0x69f4, 0x69f5, 0x69f6, 0x69f7, 0x69f8, 0x69f9, - 0x69fa, 0x69fb, 0x69fc, 0x69fe, 0x6a00, 0x6a01, 0x6a02, 0x6a03, - 0x6a04, 0x6a05, 0x6a06, 0x6a07, 0x6a08, 0x6a09, 0x6a0b, 0x6a0c, - 0x6a0d, 0x6a0e, 0x6a0f, 0x6a10, 0x6a11, 0x6a12, 0x6a13, 0x6a14, - 0x6a15, 0x6a16, 0x6a19, 0x6a1a, 0x6a1b, 0x6a1c, 0x6a1d, 0x6a1e, - 0x6a20, 0x6a22, 0x6a23, 0x6a24, 0x6a25, 0x6a26, 0x6a27, 0x6a29, - 0x6a2b, 0x6a2c, 0x6a2d, 0x6a2e, 0x6a30, 0x6a32, 0x6a33, 0x6a34, - 0x6a36, 0x6a37, 0x6a38, 0x6a39, 0x6a3a, 0x6a3b, 0x6a3c, 0x6a3f, - 0x6a40, 0x6a41, 0x6a42, 0x6a43, 0x6a45, 0x6a46, 0x6a48, 0x6a49, - 0x6a4a, 0x6a4b, 0x6a4c, 0x6a4d, 0x6a4e, 0x6a4f, 0x6a51, 0x6a52, - 0x6a53, 0x6a54, 0x6a55, 0x6a56, 0x6a57, 0x6a5a, - /* 0x99 */ - 0x6a5c, 0x6a5d, 0x6a5e, 0x6a5f, 0x6a60, 0x6a62, 0x6a63, 0x6a64, - 0x6a66, 0x6a67, 0x6a68, 0x6a69, 0x6a6a, 0x6a6b, 0x6a6c, 0x6a6d, - 0x6a6e, 0x6a6f, 0x6a70, 0x6a72, 0x6a73, 0x6a74, 0x6a75, 0x6a76, - 0x6a77, 0x6a78, 0x6a7a, 0x6a7b, 0x6a7d, 0x6a7e, 0x6a7f, 0x6a81, - 0x6a82, 0x6a83, 0x6a85, 0x6a86, 0x6a87, 0x6a88, 0x6a89, 0x6a8a, - 0x6a8b, 0x6a8c, 0x6a8d, 0x6a8f, 0x6a92, 0x6a93, 0x6a94, 0x6a95, - 0x6a96, 0x6a98, 0x6a99, 0x6a9a, 0x6a9b, 0x6a9c, 0x6a9d, 0x6a9e, - 0x6a9f, 0x6aa1, 0x6aa2, 0x6aa3, 0x6aa4, 0x6aa5, 0x6aa6, 0x6aa7, - 0x6aa8, 0x6aaa, 0x6aad, 0x6aae, 0x6aaf, 0x6ab0, 0x6ab1, 0x6ab2, - 0x6ab3, 0x6ab4, 0x6ab5, 0x6ab6, 0x6ab7, 0x6ab8, 0x6ab9, 0x6aba, - 0x6abb, 0x6abc, 0x6abd, 0x6abe, 0x6abf, 0x6ac0, 0x6ac1, 0x6ac2, - 0x6ac3, 0x6ac4, 0x6ac5, 0x6ac6, 0x6ac7, 0x6ac8, 0x6ac9, 0x6aca, - 0x6acb, 0x6acc, 0x6acd, 0x6ace, 0x6acf, 0x6ad0, 0x6ad1, 0x6ad2, - 0x6ad3, 0x6ad4, 0x6ad5, 0x6ad6, 0x6ad7, 0x6ad8, 0x6ad9, 0x6ada, - 0x6adb, 0x6adc, 0x6add, 0x6ade, 0x6adf, 0x6ae0, 0x6ae1, 0x6ae2, - 0x6ae3, 0x6ae4, 0x6ae5, 0x6ae6, 0x6ae7, 0x6ae8, 0x6ae9, 0x6aea, - 0x6aeb, 0x6aec, 0x6aed, 0x6aee, 0x6aef, 0x6af0, 0x6af1, 0x6af2, - 0x6af3, 0x6af4, 0x6af5, 0x6af6, 0x6af7, 0x6af8, 0x6af9, 0x6afa, - 0x6afb, 0x6afc, 0x6afd, 0x6afe, 0x6aff, 0x6b00, 0x6b01, 0x6b02, - 0x6b03, 0x6b04, 0x6b05, 0x6b06, 0x6b07, 0x6b08, 0x6b09, 0x6b0a, - 0x6b0b, 0x6b0c, 0x6b0d, 0x6b0e, 0x6b0f, 0x6b10, 0x6b11, 0x6b12, - 0x6b13, 0x6b14, 0x6b15, 0x6b16, 0x6b17, 0x6b18, 0x6b19, 0x6b1a, - 0x6b1b, 0x6b1c, 0x6b1d, 0x6b1e, 0x6b1f, 0x6b25, 0x6b26, 0x6b28, - 0x6b29, 0x6b2a, 0x6b2b, 0x6b2c, 0x6b2d, 0x6b2e, - /* 0x9a */ - 0x6b2f, 0x6b30, 0x6b31, 0x6b33, 0x6b34, 0x6b35, 0x6b36, 0x6b38, - 0x6b3b, 0x6b3c, 0x6b3d, 0x6b3f, 0x6b40, 0x6b41, 0x6b42, 0x6b44, - 0x6b45, 0x6b48, 0x6b4a, 0x6b4b, 0x6b4d, 0x6b4e, 0x6b4f, 0x6b50, - 0x6b51, 0x6b52, 0x6b53, 0x6b54, 0x6b55, 0x6b56, 0x6b57, 0x6b58, - 0x6b5a, 0x6b5b, 0x6b5c, 0x6b5d, 0x6b5e, 0x6b5f, 0x6b60, 0x6b61, - 0x6b68, 0x6b69, 0x6b6b, 0x6b6c, 0x6b6d, 0x6b6e, 0x6b6f, 0x6b70, - 0x6b71, 0x6b72, 0x6b73, 0x6b74, 0x6b75, 0x6b76, 0x6b77, 0x6b78, - 0x6b7a, 0x6b7d, 0x6b7e, 0x6b7f, 0x6b80, 0x6b85, 0x6b88, 0x6b8c, - 0x6b8e, 0x6b8f, 0x6b90, 0x6b91, 0x6b94, 0x6b95, 0x6b97, 0x6b98, - 0x6b99, 0x6b9c, 0x6b9d, 0x6b9e, 0x6b9f, 0x6ba0, 0x6ba2, 0x6ba3, - 0x6ba4, 0x6ba5, 0x6ba6, 0x6ba7, 0x6ba8, 0x6ba9, 0x6bab, 0x6bac, - 0x6bad, 0x6bae, 0x6baf, 0x6bb0, 0x6bb1, 0x6bb2, 0x6bb6, 0x6bb8, - 0x6bb9, 0x6bba, 0x6bbb, 0x6bbc, 0x6bbd, 0x6bbe, 0x6bc0, 0x6bc3, - 0x6bc4, 0x6bc6, 0x6bc7, 0x6bc8, 0x6bc9, 0x6bca, 0x6bcc, 0x6bce, - 0x6bd0, 0x6bd1, 0x6bd8, 0x6bda, 0x6bdc, 0x6bdd, 0x6bde, 0x6bdf, - 0x6be0, 0x6be2, 0x6be3, 0x6be4, 0x6be5, 0x6be6, 0x6be7, 0x6be8, - 0x6be9, 0x6bec, 0x6bed, 0x6bee, 0x6bf0, 0x6bf1, 0x6bf2, 0x6bf4, - 0x6bf6, 0x6bf7, 0x6bf8, 0x6bfa, 0x6bfb, 0x6bfc, 0x6bfe, 0x6bff, - 0x6c00, 0x6c01, 0x6c02, 0x6c03, 0x6c04, 0x6c08, 0x6c09, 0x6c0a, - 0x6c0b, 0x6c0c, 0x6c0e, 0x6c12, 0x6c17, 0x6c1c, 0x6c1d, 0x6c1e, - 0x6c20, 0x6c23, 0x6c25, 0x6c2b, 0x6c2c, 0x6c2d, 0x6c31, 0x6c33, - 0x6c36, 0x6c37, 0x6c39, 0x6c3a, 0x6c3b, 0x6c3c, 0x6c3e, 0x6c3f, - 0x6c43, 0x6c44, 0x6c45, 0x6c48, 0x6c4b, 0x6c4c, 0x6c4d, 0x6c4e, - 0x6c4f, 0x6c51, 0x6c52, 0x6c53, 0x6c56, 0x6c58, - /* 0x9b */ - 0x6c59, 0x6c5a, 0x6c62, 0x6c63, 0x6c65, 0x6c66, 0x6c67, 0x6c6b, - 0x6c6c, 0x6c6d, 0x6c6e, 0x6c6f, 0x6c71, 0x6c73, 0x6c75, 0x6c77, - 0x6c78, 0x6c7a, 0x6c7b, 0x6c7c, 0x6c7f, 0x6c80, 0x6c84, 0x6c87, - 0x6c8a, 0x6c8b, 0x6c8d, 0x6c8e, 0x6c91, 0x6c92, 0x6c95, 0x6c96, - 0x6c97, 0x6c98, 0x6c9a, 0x6c9c, 0x6c9d, 0x6c9e, 0x6ca0, 0x6ca2, - 0x6ca8, 0x6cac, 0x6caf, 0x6cb0, 0x6cb4, 0x6cb5, 0x6cb6, 0x6cb7, - 0x6cba, 0x6cc0, 0x6cc1, 0x6cc2, 0x6cc3, 0x6cc6, 0x6cc7, 0x6cc8, - 0x6ccb, 0x6ccd, 0x6cce, 0x6ccf, 0x6cd1, 0x6cd2, 0x6cd8, 0x6cd9, - 0x6cda, 0x6cdc, 0x6cdd, 0x6cdf, 0x6ce4, 0x6ce6, 0x6ce7, 0x6ce9, - 0x6cec, 0x6ced, 0x6cf2, 0x6cf4, 0x6cf9, 0x6cff, 0x6d00, 0x6d02, - 0x6d03, 0x6d05, 0x6d06, 0x6d08, 0x6d09, 0x6d0a, 0x6d0d, 0x6d0f, - 0x6d10, 0x6d11, 0x6d13, 0x6d14, 0x6d15, 0x6d16, 0x6d18, 0x6d1c, - 0x6d1d, 0x6d1f, 0x6d20, 0x6d21, 0x6d22, 0x6d23, 0x6d24, 0x6d26, - 0x6d28, 0x6d29, 0x6d2c, 0x6d2d, 0x6d2f, 0x6d30, 0x6d34, 0x6d36, - 0x6d37, 0x6d38, 0x6d3a, 0x6d3f, 0x6d40, 0x6d42, 0x6d44, 0x6d49, - 0x6d4c, 0x6d50, 0x6d55, 0x6d56, 0x6d57, 0x6d58, 0x6d5b, 0x6d5d, - 0x6d5f, 0x6d61, 0x6d62, 0x6d64, 0x6d65, 0x6d67, 0x6d68, 0x6d6b, - 0x6d6c, 0x6d6d, 0x6d70, 0x6d71, 0x6d72, 0x6d73, 0x6d75, 0x6d76, - 0x6d79, 0x6d7a, 0x6d7b, 0x6d7d, 0x6d7e, 0x6d7f, 0x6d80, 0x6d81, - 0x6d83, 0x6d84, 0x6d86, 0x6d87, 0x6d8a, 0x6d8b, 0x6d8d, 0x6d8f, - 0x6d90, 0x6d92, 0x6d96, 0x6d97, 0x6d98, 0x6d99, 0x6d9a, 0x6d9c, - 0x6da2, 0x6da5, 0x6dac, 0x6dad, 0x6db0, 0x6db1, 0x6db3, 0x6db4, - 0x6db6, 0x6db7, 0x6db9, 0x6dba, 0x6dbb, 0x6dbc, 0x6dbd, 0x6dbe, - 0x6dc1, 0x6dc2, 0x6dc3, 0x6dc8, 0x6dc9, 0x6dca, - /* 0x9c */ - 0x6dcd, 0x6dce, 0x6dcf, 0x6dd0, 0x6dd2, 0x6dd3, 0x6dd4, 0x6dd5, - 0x6dd7, 0x6dda, 0x6ddb, 0x6ddc, 0x6ddf, 0x6de2, 0x6de3, 0x6de5, - 0x6de7, 0x6de8, 0x6de9, 0x6dea, 0x6ded, 0x6def, 0x6df0, 0x6df2, - 0x6df4, 0x6df5, 0x6df6, 0x6df8, 0x6dfa, 0x6dfd, 0x6dfe, 0x6dff, - 0x6e00, 0x6e01, 0x6e02, 0x6e03, 0x6e04, 0x6e06, 0x6e07, 0x6e08, - 0x6e09, 0x6e0b, 0x6e0f, 0x6e12, 0x6e13, 0x6e15, 0x6e18, 0x6e19, - 0x6e1b, 0x6e1c, 0x6e1e, 0x6e1f, 0x6e22, 0x6e26, 0x6e27, 0x6e28, - 0x6e2a, 0x6e2c, 0x6e2e, 0x6e30, 0x6e31, 0x6e33, 0x6e35, 0x6e36, - 0x6e37, 0x6e39, 0x6e3b, 0x6e3c, 0x6e3d, 0x6e3e, 0x6e3f, 0x6e40, - 0x6e41, 0x6e42, 0x6e45, 0x6e46, 0x6e47, 0x6e48, 0x6e49, 0x6e4a, - 0x6e4b, 0x6e4c, 0x6e4f, 0x6e50, 0x6e51, 0x6e52, 0x6e55, 0x6e57, - 0x6e59, 0x6e5a, 0x6e5c, 0x6e5d, 0x6e5e, 0x6e60, 0x6e61, 0x6e62, - 0x6e63, 0x6e64, 0x6e65, 0x6e66, 0x6e67, 0x6e68, 0x6e69, 0x6e6a, - 0x6e6c, 0x6e6d, 0x6e6f, 0x6e70, 0x6e71, 0x6e72, 0x6e73, 0x6e74, - 0x6e75, 0x6e76, 0x6e77, 0x6e78, 0x6e79, 0x6e7a, 0x6e7b, 0x6e7c, - 0x6e7d, 0x6e80, 0x6e81, 0x6e82, 0x6e84, 0x6e87, 0x6e88, 0x6e8a, - 0x6e8b, 0x6e8c, 0x6e8d, 0x6e8e, 0x6e91, 0x6e92, 0x6e93, 0x6e94, - 0x6e95, 0x6e96, 0x6e97, 0x6e99, 0x6e9a, 0x6e9b, 0x6e9d, 0x6e9e, - 0x6ea0, 0x6ea1, 0x6ea3, 0x6ea4, 0x6ea6, 0x6ea8, 0x6ea9, 0x6eab, - 0x6eac, 0x6ead, 0x6eae, 0x6eb0, 0x6eb3, 0x6eb5, 0x6eb8, 0x6eb9, - 0x6ebc, 0x6ebe, 0x6ebf, 0x6ec0, 0x6ec3, 0x6ec4, 0x6ec5, 0x6ec6, - 0x6ec8, 0x6ec9, 0x6eca, 0x6ecc, 0x6ecd, 0x6ece, 0x6ed0, 0x6ed2, - 0x6ed6, 0x6ed8, 0x6ed9, 0x6edb, 0x6edc, 0x6edd, 0x6ee3, 0x6ee7, - 0x6eea, 0x6eeb, 0x6eec, 0x6eed, 0x6eee, 0x6eef, - /* 0x9d */ - 0x6ef0, 0x6ef1, 0x6ef2, 0x6ef3, 0x6ef5, 0x6ef6, 0x6ef7, 0x6ef8, - 0x6efa, 0x6efb, 0x6efc, 0x6efd, 0x6efe, 0x6eff, 0x6f00, 0x6f01, - 0x6f03, 0x6f04, 0x6f05, 0x6f07, 0x6f08, 0x6f0a, 0x6f0b, 0x6f0c, - 0x6f0d, 0x6f0e, 0x6f10, 0x6f11, 0x6f12, 0x6f16, 0x6f17, 0x6f18, - 0x6f19, 0x6f1a, 0x6f1b, 0x6f1c, 0x6f1d, 0x6f1e, 0x6f1f, 0x6f21, - 0x6f22, 0x6f23, 0x6f25, 0x6f26, 0x6f27, 0x6f28, 0x6f2c, 0x6f2e, - 0x6f30, 0x6f32, 0x6f34, 0x6f35, 0x6f37, 0x6f38, 0x6f39, 0x6f3a, - 0x6f3b, 0x6f3c, 0x6f3d, 0x6f3f, 0x6f40, 0x6f41, 0x6f42, 0x6f43, - 0x6f44, 0x6f45, 0x6f48, 0x6f49, 0x6f4a, 0x6f4c, 0x6f4e, 0x6f4f, - 0x6f50, 0x6f51, 0x6f52, 0x6f53, 0x6f54, 0x6f55, 0x6f56, 0x6f57, - 0x6f59, 0x6f5a, 0x6f5b, 0x6f5d, 0x6f5f, 0x6f60, 0x6f61, 0x6f63, - 0x6f64, 0x6f65, 0x6f67, 0x6f68, 0x6f69, 0x6f6a, 0x6f6b, 0x6f6c, - 0x6f6f, 0x6f70, 0x6f71, 0x6f73, 0x6f75, 0x6f76, 0x6f77, 0x6f79, - 0x6f7b, 0x6f7d, 0x6f7e, 0x6f7f, 0x6f80, 0x6f81, 0x6f82, 0x6f83, - 0x6f85, 0x6f86, 0x6f87, 0x6f8a, 0x6f8b, 0x6f8f, 0x6f90, 0x6f91, - 0x6f92, 0x6f93, 0x6f94, 0x6f95, 0x6f96, 0x6f97, 0x6f98, 0x6f99, - 0x6f9a, 0x6f9b, 0x6f9d, 0x6f9e, 0x6f9f, 0x6fa0, 0x6fa2, 0x6fa3, - 0x6fa4, 0x6fa5, 0x6fa6, 0x6fa8, 0x6fa9, 0x6faa, 0x6fab, 0x6fac, - 0x6fad, 0x6fae, 0x6faf, 0x6fb0, 0x6fb1, 0x6fb2, 0x6fb4, 0x6fb5, - 0x6fb7, 0x6fb8, 0x6fba, 0x6fbb, 0x6fbc, 0x6fbd, 0x6fbe, 0x6fbf, - 0x6fc1, 0x6fc3, 0x6fc4, 0x6fc5, 0x6fc6, 0x6fc7, 0x6fc8, 0x6fca, - 0x6fcb, 0x6fcc, 0x6fcd, 0x6fce, 0x6fcf, 0x6fd0, 0x6fd3, 0x6fd4, - 0x6fd5, 0x6fd6, 0x6fd7, 0x6fd8, 0x6fd9, 0x6fda, 0x6fdb, 0x6fdc, - 0x6fdd, 0x6fdf, 0x6fe2, 0x6fe3, 0x6fe4, 0x6fe5, - /* 0x9e */ - 0x6fe6, 0x6fe7, 0x6fe8, 0x6fe9, 0x6fea, 0x6feb, 0x6fec, 0x6fed, - 0x6ff0, 0x6ff1, 0x6ff2, 0x6ff3, 0x6ff4, 0x6ff5, 0x6ff6, 0x6ff7, - 0x6ff8, 0x6ff9, 0x6ffa, 0x6ffb, 0x6ffc, 0x6ffd, 0x6ffe, 0x6fff, - 0x7000, 0x7001, 0x7002, 0x7003, 0x7004, 0x7005, 0x7006, 0x7007, - 0x7008, 0x7009, 0x700a, 0x700b, 0x700c, 0x700d, 0x700e, 0x700f, - 0x7010, 0x7012, 0x7013, 0x7014, 0x7015, 0x7016, 0x7017, 0x7018, - 0x7019, 0x701c, 0x701d, 0x701e, 0x701f, 0x7020, 0x7021, 0x7022, - 0x7024, 0x7025, 0x7026, 0x7027, 0x7028, 0x7029, 0x702a, 0x702b, - 0x702c, 0x702d, 0x702e, 0x702f, 0x7030, 0x7031, 0x7032, 0x7033, - 0x7034, 0x7036, 0x7037, 0x7038, 0x703a, 0x703b, 0x703c, 0x703d, - 0x703e, 0x703f, 0x7040, 0x7041, 0x7042, 0x7043, 0x7044, 0x7045, - 0x7046, 0x7047, 0x7048, 0x7049, 0x704a, 0x704b, 0x704d, 0x704e, - 0x7050, 0x7051, 0x7052, 0x7053, 0x7054, 0x7055, 0x7056, 0x7057, - 0x7058, 0x7059, 0x705a, 0x705b, 0x705c, 0x705d, 0x705f, 0x7060, - 0x7061, 0x7062, 0x7063, 0x7064, 0x7065, 0x7066, 0x7067, 0x7068, - 0x7069, 0x706a, 0x706e, 0x7071, 0x7072, 0x7073, 0x7074, 0x7077, - 0x7079, 0x707a, 0x707b, 0x707d, 0x7081, 0x7082, 0x7083, 0x7084, - 0x7086, 0x7087, 0x7088, 0x708b, 0x708c, 0x708d, 0x708f, 0x7090, - 0x7091, 0x7093, 0x7097, 0x7098, 0x709a, 0x709b, 0x709e, 0x709f, - 0x70a0, 0x70a1, 0x70a2, 0x70a3, 0x70a4, 0x70a5, 0x70a6, 0x70a7, - 0x70a8, 0x70a9, 0x70aa, 0x70b0, 0x70b2, 0x70b4, 0x70b5, 0x70b6, - 0x70ba, 0x70be, 0x70bf, 0x70c4, 0x70c5, 0x70c6, 0x70c7, 0x70c9, - 0x70cb, 0x70cc, 0x70cd, 0x70ce, 0x70cf, 0x70d0, 0x70d1, 0x70d2, - 0x70d3, 0x70d4, 0x70d5, 0x70d6, 0x70d7, 0x70da, - /* 0x9f */ - 0x70dc, 0x70dd, 0x70de, 0x70e0, 0x70e1, 0x70e2, 0x70e3, 0x70e5, - 0x70ea, 0x70ee, 0x70f0, 0x70f1, 0x70f2, 0x70f3, 0x70f4, 0x70f5, - 0x70f6, 0x70f8, 0x70fa, 0x70fb, 0x70fc, 0x70fe, 0x70ff, 0x7100, - 0x7101, 0x7102, 0x7103, 0x7104, 0x7105, 0x7106, 0x7107, 0x7108, - 0x710b, 0x710c, 0x710d, 0x710e, 0x710f, 0x7111, 0x7112, 0x7114, - 0x7117, 0x711b, 0x711c, 0x711d, 0x711e, 0x711f, 0x7120, 0x7121, - 0x7122, 0x7123, 0x7124, 0x7125, 0x7127, 0x7128, 0x7129, 0x712a, - 0x712b, 0x712c, 0x712d, 0x712e, 0x7132, 0x7133, 0x7134, 0x7135, - 0x7137, 0x7138, 0x7139, 0x713a, 0x713b, 0x713c, 0x713d, 0x713e, - 0x713f, 0x7140, 0x7141, 0x7142, 0x7143, 0x7144, 0x7146, 0x7147, - 0x7148, 0x7149, 0x714b, 0x714d, 0x714f, 0x7150, 0x7151, 0x7152, - 0x7153, 0x7154, 0x7155, 0x7156, 0x7157, 0x7158, 0x7159, 0x715a, - 0x715b, 0x715d, 0x715f, 0x7160, 0x7161, 0x7162, 0x7163, 0x7165, - 0x7169, 0x716a, 0x716b, 0x716c, 0x716d, 0x716f, 0x7170, 0x7171, - 0x7174, 0x7175, 0x7176, 0x7177, 0x7179, 0x717b, 0x717c, 0x717e, - 0x717f, 0x7180, 0x7181, 0x7182, 0x7183, 0x7185, 0x7186, 0x7187, - 0x7188, 0x7189, 0x718b, 0x718c, 0x718d, 0x718e, 0x7190, 0x7191, - 0x7192, 0x7193, 0x7195, 0x7196, 0x7197, 0x719a, 0x719b, 0x719c, - 0x719d, 0x719e, 0x71a1, 0x71a2, 0x71a3, 0x71a4, 0x71a5, 0x71a6, - 0x71a7, 0x71a9, 0x71aa, 0x71ab, 0x71ad, 0x71ae, 0x71af, 0x71b0, - 0x71b1, 0x71b2, 0x71b4, 0x71b6, 0x71b7, 0x71b8, 0x71ba, 0x71bb, - 0x71bc, 0x71bd, 0x71be, 0x71bf, 0x71c0, 0x71c1, 0x71c2, 0x71c4, - 0x71c5, 0x71c6, 0x71c7, 0x71c8, 0x71c9, 0x71ca, 0x71cb, 0x71cc, - 0x71cd, 0x71cf, 0x71d0, 0x71d1, 0x71d2, 0x71d3, - /* 0xa0 */ - 0x71d6, 0x71d7, 0x71d8, 0x71d9, 0x71da, 0x71db, 0x71dc, 0x71dd, - 0x71de, 0x71df, 0x71e1, 0x71e2, 0x71e3, 0x71e4, 0x71e6, 0x71e8, - 0x71e9, 0x71ea, 0x71eb, 0x71ec, 0x71ed, 0x71ef, 0x71f0, 0x71f1, - 0x71f2, 0x71f3, 0x71f4, 0x71f5, 0x71f6, 0x71f7, 0x71f8, 0x71fa, - 0x71fb, 0x71fc, 0x71fd, 0x71fe, 0x71ff, 0x7200, 0x7201, 0x7202, - 0x7203, 0x7204, 0x7205, 0x7207, 0x7208, 0x7209, 0x720a, 0x720b, - 0x720c, 0x720d, 0x720e, 0x720f, 0x7210, 0x7211, 0x7212, 0x7213, - 0x7214, 0x7215, 0x7216, 0x7217, 0x7218, 0x7219, 0x721a, 0x721b, - 0x721c, 0x721e, 0x721f, 0x7220, 0x7221, 0x7222, 0x7223, 0x7224, - 0x7225, 0x7226, 0x7227, 0x7229, 0x722b, 0x722d, 0x722e, 0x722f, - 0x7232, 0x7233, 0x7234, 0x723a, 0x723c, 0x723e, 0x7240, 0x7241, - 0x7242, 0x7243, 0x7244, 0x7245, 0x7246, 0x7249, 0x724a, 0x724b, - 0x724e, 0x724f, 0x7250, 0x7251, 0x7253, 0x7254, 0x7255, 0x7257, - 0x7258, 0x725a, 0x725c, 0x725e, 0x7260, 0x7263, 0x7264, 0x7265, - 0x7268, 0x726a, 0x726b, 0x726c, 0x726d, 0x7270, 0x7271, 0x7273, - 0x7274, 0x7276, 0x7277, 0x7278, 0x727b, 0x727c, 0x727d, 0x7282, - 0x7283, 0x7285, 0x7286, 0x7287, 0x7288, 0x7289, 0x728c, 0x728e, - 0x7290, 0x7291, 0x7293, 0x7294, 0x7295, 0x7296, 0x7297, 0x7298, - 0x7299, 0x729a, 0x729b, 0x729c, 0x729d, 0x729e, 0x72a0, 0x72a1, - 0x72a2, 0x72a3, 0x72a4, 0x72a5, 0x72a6, 0x72a7, 0x72a8, 0x72a9, - 0x72aa, 0x72ab, 0x72ae, 0x72b1, 0x72b2, 0x72b3, 0x72b5, 0x72ba, - 0x72bb, 0x72bc, 0x72bd, 0x72be, 0x72bf, 0x72c0, 0x72c5, 0x72c6, - 0x72c7, 0x72c9, 0x72ca, 0x72cb, 0x72cc, 0x72cf, 0x72d1, 0x72d3, - 0x72d4, 0x72d5, 0x72d6, 0x72d8, 0x72da, 0x72db, -}; - - -static const u16 gbkext2_2uni_pagea8[8272] = { - /* 0xa8 */ - 0x02ca, 0x02cb, 0x02d9, 0x2013, 0x2015, 0x2025, 0x2035, 0x2105, - 0x2109, 0x2196, 0x2197, 0x2198, 0x2199, 0x2215, 0x221f, 0x2223, - 0x2252, 0x2266, 0x2267, 0x22bf, 0x2550, 0x2551, 0x2552, 0x2553, - 0x2554, 0x2555, 0x2556, 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, - 0x255c, 0x255d, 0x255e, 0x255f, 0x2560, 0x2561, 0x2562, 0x2563, - 0x2564, 0x2565, 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, - 0x256c, 0x256d, 0x256e, 0x256f, 0x2570, 0x2571, 0x2572, 0x2573, - 0x2581, 0x2582, 0x2583, 0x2584, 0x2585, 0x2586, 0x2587, 0x2588, - 0x2589, 0x258a, 0x258b, 0x258c, 0x258d, 0x258e, 0x258f, 0x2593, - 0x2594, 0x2595, 0x25bc, 0x25bd, 0x25e2, 0x25e3, 0x25e4, 0x25e5, - 0x2609, 0x2295, 0x3012, 0x301d, 0x301e, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - /* 0xa9 */ - 0x3021, 0x3022, 0x3023, 0x3024, 0x3025, 0x3026, 0x3027, 0x3028, - 0x3029, 0x32a3, 0x338e, 0x338f, 0x339c, 0x339d, 0x339e, 0x33a1, - 0x33c4, 0x33ce, 0x33d1, 0x33d2, 0x33d5, 0xfe30, 0xffe2, 0xffe4, - 0xfffd, 0x2121, 0x3231, 0xfffd, 0x2010, 0xfffd, 0xfffd, 0xfffd, - 0x30fc, 0x309b, 0x309c, 0x30fd, 0x30fe, 0x3006, 0x309d, 0x309e, - 0xfe49, 0xfe4a, 0xfe4b, 0xfe4c, 0xfe4d, 0xfe4e, 0xfe4f, 0xfe50, - 0xfe51, 0xfe52, 0xfe54, 0xfe55, 0xfe56, 0xfe57, 0xfe59, 0xfe5a, - 0xfe5b, 0xfe5c, 0xfe5d, 0xfe5e, 0xfe5f, 0xfe60, 0xfe61, 0xfe62, - 0xfe63, 0xfe64, 0xfe65, 0xfe66, 0xfe68, 0xfe69, 0xfe6a, 0xfe6b, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x3007, 0xfffd, 0xfffd, - 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, - /* 0xaa */ - 0x72dc, 0x72dd, 0x72df, 0x72e2, 0x72e3, 0x72e4, 0x72e5, 0x72e6, - 0x72e7, 0x72ea, 0x72eb, 0x72f5, 0x72f6, 0x72f9, 0x72fd, 0x72fe, - 0x72ff, 0x7300, 0x7302, 0x7304, 0x7305, 0x7306, 0x7307, 0x7308, - 0x7309, 0x730b, 0x730c, 0x730d, 0x730f, 0x7310, 0x7311, 0x7312, - 0x7314, 0x7318, 0x7319, 0x731a, 0x731f, 0x7320, 0x7323, 0x7324, - 0x7326, 0x7327, 0x7328, 0x732d, 0x732f, 0x7330, 0x7332, 0x7333, - 0x7335, 0x7336, 0x733a, 0x733b, 0x733c, 0x733d, 0x7340, 0x7341, - 0x7342, 0x7343, 0x7344, 0x7345, 0x7346, 0x7347, 0x7348, 0x7349, - 0x734a, 0x734b, 0x734c, 0x734e, 0x734f, 0x7351, 0x7353, 0x7354, - 0x7355, 0x7356, 0x7358, 0x7359, 0x735a, 0x735b, 0x735c, 0x735d, - 0x735e, 0x735f, 0x7361, 0x7362, 0x7363, 0x7364, 0x7365, 0x7366, - 0x7367, 0x7368, 0x7369, 0x736a, 0x736b, 0x736e, 0x7370, 0x7371, - /* 0xab */ - 0x7372, 0x7373, 0x7374, 0x7375, 0x7376, 0x7377, 0x7378, 0x7379, - 0x737a, 0x737b, 0x737c, 0x737d, 0x737f, 0x7380, 0x7381, 0x7382, - 0x7383, 0x7385, 0x7386, 0x7388, 0x738a, 0x738c, 0x738d, 0x738f, - 0x7390, 0x7392, 0x7393, 0x7394, 0x7395, 0x7397, 0x7398, 0x7399, - 0x739a, 0x739c, 0x739d, 0x739e, 0x73a0, 0x73a1, 0x73a3, 0x73a4, - 0x73a5, 0x73a6, 0x73a7, 0x73a8, 0x73aa, 0x73ac, 0x73ad, 0x73b1, - 0x73b4, 0x73b5, 0x73b6, 0x73b8, 0x73b9, 0x73bc, 0x73bd, 0x73be, - 0x73bf, 0x73c1, 0x73c3, 0x73c4, 0x73c5, 0x73c6, 0x73c7, 0x73cb, - 0x73cc, 0x73ce, 0x73d2, 0x73d3, 0x73d4, 0x73d5, 0x73d6, 0x73d7, - 0x73d8, 0x73da, 0x73db, 0x73dc, 0x73dd, 0x73df, 0x73e1, 0x73e2, - 0x73e3, 0x73e4, 0x73e6, 0x73e8, 0x73ea, 0x73eb, 0x73ec, 0x73ee, - 0x73ef, 0x73f0, 0x73f1, 0x73f3, 0x73f4, 0x73f5, 0x73f6, 0x73f7, - /* 0xac */ - 0x73f8, 0x73f9, 0x73fa, 0x73fb, 0x73fc, 0x73fd, 0x73fe, 0x73ff, - 0x7400, 0x7401, 0x7402, 0x7404, 0x7407, 0x7408, 0x740b, 0x740c, - 0x740d, 0x740e, 0x7411, 0x7412, 0x7413, 0x7414, 0x7415, 0x7416, - 0x7417, 0x7418, 0x7419, 0x741c, 0x741d, 0x741e, 0x741f, 0x7420, - 0x7421, 0x7423, 0x7424, 0x7427, 0x7429, 0x742b, 0x742d, 0x742f, - 0x7431, 0x7432, 0x7437, 0x7438, 0x7439, 0x743a, 0x743b, 0x743d, - 0x743e, 0x743f, 0x7440, 0x7442, 0x7443, 0x7444, 0x7445, 0x7446, - 0x7447, 0x7448, 0x7449, 0x744a, 0x744b, 0x744c, 0x744d, 0x744e, - 0x744f, 0x7450, 0x7451, 0x7452, 0x7453, 0x7454, 0x7456, 0x7458, - 0x745d, 0x7460, 0x7461, 0x7462, 0x7463, 0x7464, 0x7465, 0x7466, - 0x7467, 0x7468, 0x7469, 0x746a, 0x746b, 0x746c, 0x746e, 0x746f, - 0x7471, 0x7472, 0x7473, 0x7474, 0x7475, 0x7478, 0x7479, 0x747a, - /* 0xad */ - 0x747b, 0x747c, 0x747d, 0x747f, 0x7482, 0x7484, 0x7485, 0x7486, - 0x7488, 0x7489, 0x748a, 0x748c, 0x748d, 0x748f, 0x7491, 0x7492, - 0x7493, 0x7494, 0x7495, 0x7496, 0x7497, 0x7498, 0x7499, 0x749a, - 0x749b, 0x749d, 0x749f, 0x74a0, 0x74a1, 0x74a2, 0x74a3, 0x74a4, - 0x74a5, 0x74a6, 0x74aa, 0x74ab, 0x74ac, 0x74ad, 0x74ae, 0x74af, - 0x74b0, 0x74b1, 0x74b2, 0x74b3, 0x74b4, 0x74b5, 0x74b6, 0x74b7, - 0x74b8, 0x74b9, 0x74bb, 0x74bc, 0x74bd, 0x74be, 0x74bf, 0x74c0, - 0x74c1, 0x74c2, 0x74c3, 0x74c4, 0x74c5, 0x74c6, 0x74c7, 0x74c8, - 0x74c9, 0x74ca, 0x74cb, 0x74cc, 0x74cd, 0x74ce, 0x74cf, 0x74d0, - 0x74d1, 0x74d3, 0x74d4, 0x74d5, 0x74d6, 0x74d7, 0x74d8, 0x74d9, - 0x74da, 0x74db, 0x74dd, 0x74df, 0x74e1, 0x74e5, 0x74e7, 0x74e8, - 0x74e9, 0x74ea, 0x74eb, 0x74ec, 0x74ed, 0x74f0, 0x74f1, 0x74f2, - /* 0xae */ - 0x74f3, 0x74f5, 0x74f8, 0x74f9, 0x74fa, 0x74fb, 0x74fc, 0x74fd, - 0x74fe, 0x7500, 0x7501, 0x7502, 0x7503, 0x7505, 0x7506, 0x7507, - 0x7508, 0x7509, 0x750a, 0x750b, 0x750c, 0x750e, 0x7510, 0x7512, - 0x7514, 0x7515, 0x7516, 0x7517, 0x751b, 0x751d, 0x751e, 0x7520, - 0x7521, 0x7522, 0x7523, 0x7524, 0x7526, 0x7527, 0x752a, 0x752e, - 0x7534, 0x7536, 0x7539, 0x753c, 0x753d, 0x753f, 0x7541, 0x7542, - 0x7543, 0x7544, 0x7546, 0x7547, 0x7549, 0x754a, 0x754d, 0x7550, - 0x7551, 0x7552, 0x7553, 0x7555, 0x7556, 0x7557, 0x7558, 0x755d, - 0x755e, 0x755f, 0x7560, 0x7561, 0x7562, 0x7563, 0x7564, 0x7567, - 0x7568, 0x7569, 0x756b, 0x756c, 0x756d, 0x756e, 0x756f, 0x7570, - 0x7571, 0x7573, 0x7575, 0x7576, 0x7577, 0x757a, 0x757b, 0x757c, - 0x757d, 0x757e, 0x7580, 0x7581, 0x7582, 0x7584, 0x7585, 0x7587, - /* 0xaf */ - 0x7588, 0x7589, 0x758a, 0x758c, 0x758d, 0x758e, 0x7590, 0x7593, - 0x7595, 0x7598, 0x759b, 0x759c, 0x759e, 0x75a2, 0x75a6, 0x75a7, - 0x75a8, 0x75a9, 0x75aa, 0x75ad, 0x75b6, 0x75b7, 0x75ba, 0x75bb, - 0x75bf, 0x75c0, 0x75c1, 0x75c6, 0x75cb, 0x75cc, 0x75ce, 0x75cf, - 0x75d0, 0x75d1, 0x75d3, 0x75d7, 0x75d9, 0x75da, 0x75dc, 0x75dd, - 0x75df, 0x75e0, 0x75e1, 0x75e5, 0x75e9, 0x75ec, 0x75ed, 0x75ee, - 0x75ef, 0x75f2, 0x75f3, 0x75f5, 0x75f6, 0x75f7, 0x75f8, 0x75fa, - 0x75fb, 0x75fd, 0x75fe, 0x7602, 0x7604, 0x7606, 0x7607, 0x7608, - 0x7609, 0x760b, 0x760d, 0x760e, 0x760f, 0x7611, 0x7612, 0x7613, - 0x7614, 0x7616, 0x761a, 0x761c, 0x761d, 0x761e, 0x7621, 0x7623, - 0x7627, 0x7628, 0x762c, 0x762e, 0x762f, 0x7631, 0x7632, 0x7636, - 0x7637, 0x7639, 0x763a, 0x763b, 0x763d, 0x7641, 0x7642, 0x7644, - /* 0xb0 */ - 0x7645, 0x7646, 0x7647, 0x7648, 0x7649, 0x764a, 0x764b, 0x764e, - 0x764f, 0x7650, 0x7651, 0x7652, 0x7653, 0x7655, 0x7657, 0x7658, - 0x7659, 0x765a, 0x765b, 0x765d, 0x765f, 0x7660, 0x7661, 0x7662, - 0x7664, 0x7665, 0x7666, 0x7667, 0x7668, 0x7669, 0x766a, 0x766c, - 0x766d, 0x766e, 0x7670, 0x7671, 0x7672, 0x7673, 0x7674, 0x7675, - 0x7676, 0x7677, 0x7679, 0x767a, 0x767c, 0x767f, 0x7680, 0x7681, - 0x7683, 0x7685, 0x7689, 0x768a, 0x768c, 0x768d, 0x768f, 0x7690, - 0x7692, 0x7694, 0x7695, 0x7697, 0x7698, 0x769a, 0x769b, 0x769c, - 0x769d, 0x769e, 0x769f, 0x76a0, 0x76a1, 0x76a2, 0x76a3, 0x76a5, - 0x76a6, 0x76a7, 0x76a8, 0x76a9, 0x76aa, 0x76ab, 0x76ac, 0x76ad, - 0x76af, 0x76b0, 0x76b3, 0x76b5, 0x76b6, 0x76b7, 0x76b8, 0x76b9, - 0x76ba, 0x76bb, 0x76bc, 0x76bd, 0x76be, 0x76c0, 0x76c1, 0x76c3, - /* 0xb1 */ - 0x76c4, 0x76c7, 0x76c9, 0x76cb, 0x76cc, 0x76d3, 0x76d5, 0x76d9, - 0x76da, 0x76dc, 0x76dd, 0x76de, 0x76e0, 0x76e1, 0x76e2, 0x76e3, - 0x76e4, 0x76e6, 0x76e7, 0x76e8, 0x76e9, 0x76ea, 0x76eb, 0x76ec, - 0x76ed, 0x76f0, 0x76f3, 0x76f5, 0x76f6, 0x76f7, 0x76fa, 0x76fb, - 0x76fd, 0x76ff, 0x7700, 0x7702, 0x7703, 0x7705, 0x7706, 0x770a, - 0x770c, 0x770e, 0x770f, 0x7710, 0x7711, 0x7712, 0x7713, 0x7714, - 0x7715, 0x7716, 0x7717, 0x7718, 0x771b, 0x771c, 0x771d, 0x771e, - 0x7721, 0x7723, 0x7724, 0x7725, 0x7727, 0x772a, 0x772b, 0x772c, - 0x772e, 0x7730, 0x7731, 0x7732, 0x7733, 0x7734, 0x7739, 0x773b, - 0x773d, 0x773e, 0x773f, 0x7742, 0x7744, 0x7745, 0x7746, 0x7748, - 0x7749, 0x774a, 0x774b, 0x774c, 0x774d, 0x774e, 0x774f, 0x7752, - 0x7753, 0x7754, 0x7755, 0x7756, 0x7757, 0x7758, 0x7759, 0x775c, - /* 0xb2 */ - 0x775d, 0x775e, 0x775f, 0x7760, 0x7764, 0x7767, 0x7769, 0x776a, - 0x776d, 0x776e, 0x776f, 0x7770, 0x7771, 0x7772, 0x7773, 0x7774, - 0x7775, 0x7776, 0x7777, 0x7778, 0x777a, 0x777b, 0x777c, 0x7781, - 0x7782, 0x7783, 0x7786, 0x7787, 0x7788, 0x7789, 0x778a, 0x778b, - 0x778f, 0x7790, 0x7793, 0x7794, 0x7795, 0x7796, 0x7797, 0x7798, - 0x7799, 0x779a, 0x779b, 0x779c, 0x779d, 0x779e, 0x77a1, 0x77a3, - 0x77a4, 0x77a6, 0x77a8, 0x77ab, 0x77ad, 0x77ae, 0x77af, 0x77b1, - 0x77b2, 0x77b4, 0x77b6, 0x77b7, 0x77b8, 0x77b9, 0x77ba, 0x77bc, - 0x77be, 0x77c0, 0x77c1, 0x77c2, 0x77c3, 0x77c4, 0x77c5, 0x77c6, - 0x77c7, 0x77c8, 0x77c9, 0x77ca, 0x77cb, 0x77cc, 0x77ce, 0x77cf, - 0x77d0, 0x77d1, 0x77d2, 0x77d3, 0x77d4, 0x77d5, 0x77d6, 0x77d8, - 0x77d9, 0x77da, 0x77dd, 0x77de, 0x77df, 0x77e0, 0x77e1, 0x77e4, - /* 0xb3 */ - 0x77e6, 0x77e8, 0x77ea, 0x77ef, 0x77f0, 0x77f1, 0x77f2, 0x77f4, - 0x77f5, 0x77f7, 0x77f9, 0x77fa, 0x77fb, 0x77fc, 0x7803, 0x7804, - 0x7805, 0x7806, 0x7807, 0x7808, 0x780a, 0x780b, 0x780e, 0x780f, - 0x7810, 0x7813, 0x7815, 0x7819, 0x781b, 0x781e, 0x7820, 0x7821, - 0x7822, 0x7824, 0x7828, 0x782a, 0x782b, 0x782e, 0x782f, 0x7831, - 0x7832, 0x7833, 0x7835, 0x7836, 0x783d, 0x783f, 0x7841, 0x7842, - 0x7843, 0x7844, 0x7846, 0x7848, 0x7849, 0x784a, 0x784b, 0x784d, - 0x784f, 0x7851, 0x7853, 0x7854, 0x7858, 0x7859, 0x785a, 0x785b, - 0x785c, 0x785e, 0x785f, 0x7860, 0x7861, 0x7862, 0x7863, 0x7864, - 0x7865, 0x7866, 0x7867, 0x7868, 0x7869, 0x786f, 0x7870, 0x7871, - 0x7872, 0x7873, 0x7874, 0x7875, 0x7876, 0x7878, 0x7879, 0x787a, - 0x787b, 0x787d, 0x787e, 0x787f, 0x7880, 0x7881, 0x7882, 0x7883, - /* 0xb4 */ - 0x7884, 0x7885, 0x7886, 0x7888, 0x788a, 0x788b, 0x788f, 0x7890, - 0x7892, 0x7894, 0x7895, 0x7896, 0x7899, 0x789d, 0x789e, 0x78a0, - 0x78a2, 0x78a4, 0x78a6, 0x78a8, 0x78a9, 0x78aa, 0x78ab, 0x78ac, - 0x78ad, 0x78ae, 0x78af, 0x78b5, 0x78b6, 0x78b7, 0x78b8, 0x78ba, - 0x78bb, 0x78bc, 0x78bd, 0x78bf, 0x78c0, 0x78c2, 0x78c3, 0x78c4, - 0x78c6, 0x78c7, 0x78c8, 0x78cc, 0x78cd, 0x78ce, 0x78cf, 0x78d1, - 0x78d2, 0x78d3, 0x78d6, 0x78d7, 0x78d8, 0x78da, 0x78db, 0x78dc, - 0x78dd, 0x78de, 0x78df, 0x78e0, 0x78e1, 0x78e2, 0x78e3, 0x78e4, - 0x78e5, 0x78e6, 0x78e7, 0x78e9, 0x78ea, 0x78eb, 0x78ed, 0x78ee, - 0x78ef, 0x78f0, 0x78f1, 0x78f3, 0x78f5, 0x78f6, 0x78f8, 0x78f9, - 0x78fb, 0x78fc, 0x78fd, 0x78fe, 0x78ff, 0x7900, 0x7902, 0x7903, - 0x7904, 0x7906, 0x7907, 0x7908, 0x7909, 0x790a, 0x790b, 0x790c, - /* 0xb5 */ - 0x790d, 0x790e, 0x790f, 0x7910, 0x7911, 0x7912, 0x7914, 0x7915, - 0x7916, 0x7917, 0x7918, 0x7919, 0x791a, 0x791b, 0x791c, 0x791d, - 0x791f, 0x7920, 0x7921, 0x7922, 0x7923, 0x7925, 0x7926, 0x7927, - 0x7928, 0x7929, 0x792a, 0x792b, 0x792c, 0x792d, 0x792e, 0x792f, - 0x7930, 0x7931, 0x7932, 0x7933, 0x7935, 0x7936, 0x7937, 0x7938, - 0x7939, 0x793d, 0x793f, 0x7942, 0x7943, 0x7944, 0x7945, 0x7947, - 0x794a, 0x794b, 0x794c, 0x794d, 0x794e, 0x794f, 0x7950, 0x7951, - 0x7952, 0x7954, 0x7955, 0x7958, 0x7959, 0x7961, 0x7963, 0x7964, - 0x7966, 0x7969, 0x796a, 0x796b, 0x796c, 0x796e, 0x7970, 0x7971, - 0x7972, 0x7973, 0x7974, 0x7975, 0x7976, 0x7979, 0x797b, 0x797c, - 0x797d, 0x797e, 0x797f, 0x7982, 0x7983, 0x7986, 0x7987, 0x7988, - 0x7989, 0x798b, 0x798c, 0x798d, 0x798e, 0x7990, 0x7991, 0x7992, - /* 0xb6 */ - 0x7993, 0x7994, 0x7995, 0x7996, 0x7997, 0x7998, 0x7999, 0x799b, - 0x799c, 0x799d, 0x799e, 0x799f, 0x79a0, 0x79a1, 0x79a2, 0x79a3, - 0x79a4, 0x79a5, 0x79a6, 0x79a8, 0x79a9, 0x79aa, 0x79ab, 0x79ac, - 0x79ad, 0x79ae, 0x79af, 0x79b0, 0x79b1, 0x79b2, 0x79b4, 0x79b5, - 0x79b6, 0x79b7, 0x79b8, 0x79bc, 0x79bf, 0x79c2, 0x79c4, 0x79c5, - 0x79c7, 0x79c8, 0x79ca, 0x79cc, 0x79ce, 0x79cf, 0x79d0, 0x79d3, - 0x79d4, 0x79d6, 0x79d7, 0x79d9, 0x79da, 0x79db, 0x79dc, 0x79dd, - 0x79de, 0x79e0, 0x79e1, 0x79e2, 0x79e5, 0x79e8, 0x79ea, 0x79ec, - 0x79ee, 0x79f1, 0x79f2, 0x79f3, 0x79f4, 0x79f5, 0x79f6, 0x79f7, - 0x79f9, 0x79fa, 0x79fc, 0x79fe, 0x79ff, 0x7a01, 0x7a04, 0x7a05, - 0x7a07, 0x7a08, 0x7a09, 0x7a0a, 0x7a0c, 0x7a0f, 0x7a10, 0x7a11, - 0x7a12, 0x7a13, 0x7a15, 0x7a16, 0x7a18, 0x7a19, 0x7a1b, 0x7a1c, - /* 0xb7 */ - 0x7a1d, 0x7a1f, 0x7a21, 0x7a22, 0x7a24, 0x7a25, 0x7a26, 0x7a27, - 0x7a28, 0x7a29, 0x7a2a, 0x7a2b, 0x7a2c, 0x7a2d, 0x7a2e, 0x7a2f, - 0x7a30, 0x7a31, 0x7a32, 0x7a34, 0x7a35, 0x7a36, 0x7a38, 0x7a3a, - 0x7a3e, 0x7a40, 0x7a41, 0x7a42, 0x7a43, 0x7a44, 0x7a45, 0x7a47, - 0x7a48, 0x7a49, 0x7a4a, 0x7a4b, 0x7a4c, 0x7a4d, 0x7a4e, 0x7a4f, - 0x7a50, 0x7a52, 0x7a53, 0x7a54, 0x7a55, 0x7a56, 0x7a58, 0x7a59, - 0x7a5a, 0x7a5b, 0x7a5c, 0x7a5d, 0x7a5e, 0x7a5f, 0x7a60, 0x7a61, - 0x7a62, 0x7a63, 0x7a64, 0x7a65, 0x7a66, 0x7a67, 0x7a68, 0x7a69, - 0x7a6a, 0x7a6b, 0x7a6c, 0x7a6d, 0x7a6e, 0x7a6f, 0x7a71, 0x7a72, - 0x7a73, 0x7a75, 0x7a7b, 0x7a7c, 0x7a7d, 0x7a7e, 0x7a82, 0x7a85, - 0x7a87, 0x7a89, 0x7a8a, 0x7a8b, 0x7a8c, 0x7a8e, 0x7a8f, 0x7a90, - 0x7a93, 0x7a94, 0x7a99, 0x7a9a, 0x7a9b, 0x7a9e, 0x7aa1, 0x7aa2, - /* 0xb8 */ - 0x7aa3, 0x7aa4, 0x7aa7, 0x7aa9, 0x7aaa, 0x7aab, 0x7aae, 0x7aaf, - 0x7ab0, 0x7ab1, 0x7ab2, 0x7ab4, 0x7ab5, 0x7ab6, 0x7ab7, 0x7ab8, - 0x7ab9, 0x7aba, 0x7abb, 0x7abc, 0x7abd, 0x7abe, 0x7ac0, 0x7ac1, - 0x7ac2, 0x7ac3, 0x7ac4, 0x7ac5, 0x7ac6, 0x7ac7, 0x7ac8, 0x7ac9, - 0x7aca, 0x7acc, 0x7acd, 0x7ace, 0x7acf, 0x7ad0, 0x7ad1, 0x7ad2, - 0x7ad3, 0x7ad4, 0x7ad5, 0x7ad7, 0x7ad8, 0x7ada, 0x7adb, 0x7adc, - 0x7add, 0x7ae1, 0x7ae2, 0x7ae4, 0x7ae7, 0x7ae8, 0x7ae9, 0x7aea, - 0x7aeb, 0x7aec, 0x7aee, 0x7af0, 0x7af1, 0x7af2, 0x7af3, 0x7af4, - 0x7af5, 0x7af6, 0x7af7, 0x7af8, 0x7afb, 0x7afc, 0x7afe, 0x7b00, - 0x7b01, 0x7b02, 0x7b05, 0x7b07, 0x7b09, 0x7b0c, 0x7b0d, 0x7b0e, - 0x7b10, 0x7b12, 0x7b13, 0x7b16, 0x7b17, 0x7b18, 0x7b1a, 0x7b1c, - 0x7b1d, 0x7b1f, 0x7b21, 0x7b22, 0x7b23, 0x7b27, 0x7b29, 0x7b2d, - /* 0xb9 */ - 0x7b2f, 0x7b30, 0x7b32, 0x7b34, 0x7b35, 0x7b36, 0x7b37, 0x7b39, - 0x7b3b, 0x7b3d, 0x7b3f, 0x7b40, 0x7b41, 0x7b42, 0x7b43, 0x7b44, - 0x7b46, 0x7b48, 0x7b4a, 0x7b4d, 0x7b4e, 0x7b53, 0x7b55, 0x7b57, - 0x7b59, 0x7b5c, 0x7b5e, 0x7b5f, 0x7b61, 0x7b63, 0x7b64, 0x7b65, - 0x7b66, 0x7b67, 0x7b68, 0x7b69, 0x7b6a, 0x7b6b, 0x7b6c, 0x7b6d, - 0x7b6f, 0x7b70, 0x7b73, 0x7b74, 0x7b76, 0x7b78, 0x7b7a, 0x7b7c, - 0x7b7d, 0x7b7f, 0x7b81, 0x7b82, 0x7b83, 0x7b84, 0x7b86, 0x7b87, - 0x7b88, 0x7b89, 0x7b8a, 0x7b8b, 0x7b8c, 0x7b8e, 0x7b8f, 0x7b91, - 0x7b92, 0x7b93, 0x7b96, 0x7b98, 0x7b99, 0x7b9a, 0x7b9b, 0x7b9e, - 0x7b9f, 0x7ba0, 0x7ba3, 0x7ba4, 0x7ba5, 0x7bae, 0x7baf, 0x7bb0, - 0x7bb2, 0x7bb3, 0x7bb5, 0x7bb6, 0x7bb7, 0x7bb9, 0x7bba, 0x7bbb, - 0x7bbc, 0x7bbd, 0x7bbe, 0x7bbf, 0x7bc0, 0x7bc2, 0x7bc3, 0x7bc4, - /* 0xba */ - 0x7bc5, 0x7bc8, 0x7bc9, 0x7bca, 0x7bcb, 0x7bcd, 0x7bce, 0x7bcf, - 0x7bd0, 0x7bd2, 0x7bd4, 0x7bd5, 0x7bd6, 0x7bd7, 0x7bd8, 0x7bdb, - 0x7bdc, 0x7bde, 0x7bdf, 0x7be0, 0x7be2, 0x7be3, 0x7be4, 0x7be7, - 0x7be8, 0x7be9, 0x7beb, 0x7bec, 0x7bed, 0x7bef, 0x7bf0, 0x7bf2, - 0x7bf3, 0x7bf4, 0x7bf5, 0x7bf6, 0x7bf8, 0x7bf9, 0x7bfa, 0x7bfb, - 0x7bfd, 0x7bff, 0x7c00, 0x7c01, 0x7c02, 0x7c03, 0x7c04, 0x7c05, - 0x7c06, 0x7c08, 0x7c09, 0x7c0a, 0x7c0d, 0x7c0e, 0x7c10, 0x7c11, - 0x7c12, 0x7c13, 0x7c14, 0x7c15, 0x7c17, 0x7c18, 0x7c19, 0x7c1a, - 0x7c1b, 0x7c1c, 0x7c1d, 0x7c1e, 0x7c20, 0x7c21, 0x7c22, 0x7c23, - 0x7c24, 0x7c25, 0x7c28, 0x7c29, 0x7c2b, 0x7c2c, 0x7c2d, 0x7c2e, - 0x7c2f, 0x7c30, 0x7c31, 0x7c32, 0x7c33, 0x7c34, 0x7c35, 0x7c36, - 0x7c37, 0x7c39, 0x7c3a, 0x7c3b, 0x7c3c, 0x7c3d, 0x7c3e, 0x7c42, - /* 0xbb */ - 0x7c43, 0x7c44, 0x7c45, 0x7c46, 0x7c47, 0x7c48, 0x7c49, 0x7c4a, - 0x7c4b, 0x7c4c, 0x7c4e, 0x7c4f, 0x7c50, 0x7c51, 0x7c52, 0x7c53, - 0x7c54, 0x7c55, 0x7c56, 0x7c57, 0x7c58, 0x7c59, 0x7c5a, 0x7c5b, - 0x7c5c, 0x7c5d, 0x7c5e, 0x7c5f, 0x7c60, 0x7c61, 0x7c62, 0x7c63, - 0x7c64, 0x7c65, 0x7c66, 0x7c67, 0x7c68, 0x7c69, 0x7c6a, 0x7c6b, - 0x7c6c, 0x7c6d, 0x7c6e, 0x7c6f, 0x7c70, 0x7c71, 0x7c72, 0x7c75, - 0x7c76, 0x7c77, 0x7c78, 0x7c79, 0x7c7a, 0x7c7e, 0x7c7f, 0x7c80, - 0x7c81, 0x7c82, 0x7c83, 0x7c84, 0x7c85, 0x7c86, 0x7c87, 0x7c88, - 0x7c8a, 0x7c8b, 0x7c8c, 0x7c8d, 0x7c8e, 0x7c8f, 0x7c90, 0x7c93, - 0x7c94, 0x7c96, 0x7c99, 0x7c9a, 0x7c9b, 0x7ca0, 0x7ca1, 0x7ca3, - 0x7ca6, 0x7ca7, 0x7ca8, 0x7ca9, 0x7cab, 0x7cac, 0x7cad, 0x7caf, - 0x7cb0, 0x7cb4, 0x7cb5, 0x7cb6, 0x7cb7, 0x7cb8, 0x7cba, 0x7cbb, - /* 0xbc */ - 0x7cbf, 0x7cc0, 0x7cc2, 0x7cc3, 0x7cc4, 0x7cc6, 0x7cc9, 0x7ccb, - 0x7cce, 0x7ccf, 0x7cd0, 0x7cd1, 0x7cd2, 0x7cd3, 0x7cd4, 0x7cd8, - 0x7cda, 0x7cdb, 0x7cdd, 0x7cde, 0x7ce1, 0x7ce2, 0x7ce3, 0x7ce4, - 0x7ce5, 0x7ce6, 0x7ce7, 0x7ce9, 0x7cea, 0x7ceb, 0x7cec, 0x7ced, - 0x7cee, 0x7cf0, 0x7cf1, 0x7cf2, 0x7cf3, 0x7cf4, 0x7cf5, 0x7cf6, - 0x7cf7, 0x7cf9, 0x7cfa, 0x7cfc, 0x7cfd, 0x7cfe, 0x7cff, 0x7d00, - 0x7d01, 0x7d02, 0x7d03, 0x7d04, 0x7d05, 0x7d06, 0x7d07, 0x7d08, - 0x7d09, 0x7d0b, 0x7d0c, 0x7d0d, 0x7d0e, 0x7d0f, 0x7d10, 0x7d11, - 0x7d12, 0x7d13, 0x7d14, 0x7d15, 0x7d16, 0x7d17, 0x7d18, 0x7d19, - 0x7d1a, 0x7d1b, 0x7d1c, 0x7d1d, 0x7d1e, 0x7d1f, 0x7d21, 0x7d23, - 0x7d24, 0x7d25, 0x7d26, 0x7d28, 0x7d29, 0x7d2a, 0x7d2c, 0x7d2d, - 0x7d2e, 0x7d30, 0x7d31, 0x7d32, 0x7d33, 0x7d34, 0x7d35, 0x7d36, - /* 0xbd */ - 0x7d37, 0x7d38, 0x7d39, 0x7d3a, 0x7d3b, 0x7d3c, 0x7d3d, 0x7d3e, - 0x7d3f, 0x7d40, 0x7d41, 0x7d42, 0x7d43, 0x7d44, 0x7d45, 0x7d46, - 0x7d47, 0x7d48, 0x7d49, 0x7d4a, 0x7d4b, 0x7d4c, 0x7d4d, 0x7d4e, - 0x7d4f, 0x7d50, 0x7d51, 0x7d52, 0x7d53, 0x7d54, 0x7d55, 0x7d56, - 0x7d57, 0x7d58, 0x7d59, 0x7d5a, 0x7d5b, 0x7d5c, 0x7d5d, 0x7d5e, - 0x7d5f, 0x7d60, 0x7d61, 0x7d62, 0x7d63, 0x7d64, 0x7d65, 0x7d66, - 0x7d67, 0x7d68, 0x7d69, 0x7d6a, 0x7d6b, 0x7d6c, 0x7d6d, 0x7d6f, - 0x7d70, 0x7d71, 0x7d72, 0x7d73, 0x7d74, 0x7d75, 0x7d76, 0x7d78, - 0x7d79, 0x7d7a, 0x7d7b, 0x7d7c, 0x7d7d, 0x7d7e, 0x7d7f, 0x7d80, - 0x7d81, 0x7d82, 0x7d83, 0x7d84, 0x7d85, 0x7d86, 0x7d87, 0x7d88, - 0x7d89, 0x7d8a, 0x7d8b, 0x7d8c, 0x7d8d, 0x7d8e, 0x7d8f, 0x7d90, - 0x7d91, 0x7d92, 0x7d93, 0x7d94, 0x7d95, 0x7d96, 0x7d97, 0x7d98, - /* 0xbe */ - 0x7d99, 0x7d9a, 0x7d9b, 0x7d9c, 0x7d9d, 0x7d9e, 0x7d9f, 0x7da0, - 0x7da1, 0x7da2, 0x7da3, 0x7da4, 0x7da5, 0x7da7, 0x7da8, 0x7da9, - 0x7daa, 0x7dab, 0x7dac, 0x7dad, 0x7daf, 0x7db0, 0x7db1, 0x7db2, - 0x7db3, 0x7db4, 0x7db5, 0x7db6, 0x7db7, 0x7db8, 0x7db9, 0x7dba, - 0x7dbb, 0x7dbc, 0x7dbd, 0x7dbe, 0x7dbf, 0x7dc0, 0x7dc1, 0x7dc2, - 0x7dc3, 0x7dc4, 0x7dc5, 0x7dc6, 0x7dc7, 0x7dc8, 0x7dc9, 0x7dca, - 0x7dcb, 0x7dcc, 0x7dcd, 0x7dce, 0x7dcf, 0x7dd0, 0x7dd1, 0x7dd2, - 0x7dd3, 0x7dd4, 0x7dd5, 0x7dd6, 0x7dd7, 0x7dd8, 0x7dd9, 0x7dda, - 0x7ddb, 0x7ddc, 0x7ddd, 0x7dde, 0x7ddf, 0x7de0, 0x7de1, 0x7de2, - 0x7de3, 0x7de4, 0x7de5, 0x7de6, 0x7de7, 0x7de8, 0x7de9, 0x7dea, - 0x7deb, 0x7dec, 0x7ded, 0x7dee, 0x7def, 0x7df0, 0x7df1, 0x7df2, - 0x7df3, 0x7df4, 0x7df5, 0x7df6, 0x7df7, 0x7df8, 0x7df9, 0x7dfa, - /* 0xbf */ - 0x7dfb, 0x7dfc, 0x7dfd, 0x7dfe, 0x7dff, 0x7e00, 0x7e01, 0x7e02, - 0x7e03, 0x7e04, 0x7e05, 0x7e06, 0x7e07, 0x7e08, 0x7e09, 0x7e0a, - 0x7e0b, 0x7e0c, 0x7e0d, 0x7e0e, 0x7e0f, 0x7e10, 0x7e11, 0x7e12, - 0x7e13, 0x7e14, 0x7e15, 0x7e16, 0x7e17, 0x7e18, 0x7e19, 0x7e1a, - 0x7e1b, 0x7e1c, 0x7e1d, 0x7e1e, 0x7e1f, 0x7e20, 0x7e21, 0x7e22, - 0x7e23, 0x7e24, 0x7e25, 0x7e26, 0x7e27, 0x7e28, 0x7e29, 0x7e2a, - 0x7e2b, 0x7e2c, 0x7e2d, 0x7e2e, 0x7e2f, 0x7e30, 0x7e31, 0x7e32, - 0x7e33, 0x7e34, 0x7e35, 0x7e36, 0x7e37, 0x7e38, 0x7e39, 0x7e3a, - 0x7e3c, 0x7e3d, 0x7e3e, 0x7e3f, 0x7e40, 0x7e42, 0x7e43, 0x7e44, - 0x7e45, 0x7e46, 0x7e48, 0x7e49, 0x7e4a, 0x7e4b, 0x7e4c, 0x7e4d, - 0x7e4e, 0x7e4f, 0x7e50, 0x7e51, 0x7e52, 0x7e53, 0x7e54, 0x7e55, - 0x7e56, 0x7e57, 0x7e58, 0x7e59, 0x7e5a, 0x7e5b, 0x7e5c, 0x7e5d, - /* 0xc0 */ - 0x7e5e, 0x7e5f, 0x7e60, 0x7e61, 0x7e62, 0x7e63, 0x7e64, 0x7e65, - 0x7e66, 0x7e67, 0x7e68, 0x7e69, 0x7e6a, 0x7e6b, 0x7e6c, 0x7e6d, - 0x7e6e, 0x7e6f, 0x7e70, 0x7e71, 0x7e72, 0x7e73, 0x7e74, 0x7e75, - 0x7e76, 0x7e77, 0x7e78, 0x7e79, 0x7e7a, 0x7e7b, 0x7e7c, 0x7e7d, - 0x7e7e, 0x7e7f, 0x7e80, 0x7e81, 0x7e83, 0x7e84, 0x7e85, 0x7e86, - 0x7e87, 0x7e88, 0x7e89, 0x7e8a, 0x7e8b, 0x7e8c, 0x7e8d, 0x7e8e, - 0x7e8f, 0x7e90, 0x7e91, 0x7e92, 0x7e93, 0x7e94, 0x7e95, 0x7e96, - 0x7e97, 0x7e98, 0x7e99, 0x7e9a, 0x7e9c, 0x7e9d, 0x7e9e, 0x7eae, - 0x7eb4, 0x7ebb, 0x7ebc, 0x7ed6, 0x7ee4, 0x7eec, 0x7ef9, 0x7f0a, - 0x7f10, 0x7f1e, 0x7f37, 0x7f39, 0x7f3b, 0x7f3c, 0x7f3d, 0x7f3e, - 0x7f3f, 0x7f40, 0x7f41, 0x7f43, 0x7f46, 0x7f47, 0x7f48, 0x7f49, - 0x7f4a, 0x7f4b, 0x7f4c, 0x7f4d, 0x7f4e, 0x7f4f, 0x7f52, 0x7f53, - /* 0xc1 */ - 0x7f56, 0x7f59, 0x7f5b, 0x7f5c, 0x7f5d, 0x7f5e, 0x7f60, 0x7f63, - 0x7f64, 0x7f65, 0x7f66, 0x7f67, 0x7f6b, 0x7f6c, 0x7f6d, 0x7f6f, - 0x7f70, 0x7f73, 0x7f75, 0x7f76, 0x7f77, 0x7f78, 0x7f7a, 0x7f7b, - 0x7f7c, 0x7f7d, 0x7f7f, 0x7f80, 0x7f82, 0x7f83, 0x7f84, 0x7f85, - 0x7f86, 0x7f87, 0x7f88, 0x7f89, 0x7f8b, 0x7f8d, 0x7f8f, 0x7f90, - 0x7f91, 0x7f92, 0x7f93, 0x7f95, 0x7f96, 0x7f97, 0x7f98, 0x7f99, - 0x7f9b, 0x7f9c, 0x7fa0, 0x7fa2, 0x7fa3, 0x7fa5, 0x7fa6, 0x7fa8, - 0x7fa9, 0x7faa, 0x7fab, 0x7fac, 0x7fad, 0x7fae, 0x7fb1, 0x7fb3, - 0x7fb4, 0x7fb5, 0x7fb6, 0x7fb7, 0x7fba, 0x7fbb, 0x7fbe, 0x7fc0, - 0x7fc2, 0x7fc3, 0x7fc4, 0x7fc6, 0x7fc7, 0x7fc8, 0x7fc9, 0x7fcb, - 0x7fcd, 0x7fcf, 0x7fd0, 0x7fd1, 0x7fd2, 0x7fd3, 0x7fd6, 0x7fd7, - 0x7fd9, 0x7fda, 0x7fdb, 0x7fdc, 0x7fdd, 0x7fde, 0x7fe2, 0x7fe3, - /* 0xc2 */ - 0x7fe4, 0x7fe7, 0x7fe8, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fef, - 0x7ff2, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7, 0x7ff8, 0x7ff9, 0x7ffa, - 0x7ffd, 0x7ffe, 0x7fff, 0x8002, 0x8007, 0x8008, 0x8009, 0x800a, - 0x800e, 0x800f, 0x8011, 0x8013, 0x801a, 0x801b, 0x801d, 0x801e, - 0x801f, 0x8021, 0x8023, 0x8024, 0x802b, 0x802c, 0x802d, 0x802e, - 0x802f, 0x8030, 0x8032, 0x8034, 0x8039, 0x803a, 0x803c, 0x803e, - 0x8040, 0x8041, 0x8044, 0x8045, 0x8047, 0x8048, 0x8049, 0x804e, - 0x804f, 0x8050, 0x8051, 0x8053, 0x8055, 0x8056, 0x8057, 0x8059, - 0x805b, 0x805c, 0x805d, 0x805e, 0x805f, 0x8060, 0x8061, 0x8062, - 0x8063, 0x8064, 0x8065, 0x8066, 0x8067, 0x8068, 0x806b, 0x806c, - 0x806d, 0x806e, 0x806f, 0x8070, 0x8072, 0x8073, 0x8074, 0x8075, - 0x8076, 0x8077, 0x8078, 0x8079, 0x807a, 0x807b, 0x807c, 0x807d, - /* 0xc3 */ - 0x807e, 0x8081, 0x8082, 0x8085, 0x8088, 0x808a, 0x808d, 0x808e, - 0x808f, 0x8090, 0x8091, 0x8092, 0x8094, 0x8095, 0x8097, 0x8099, - 0x809e, 0x80a3, 0x80a6, 0x80a7, 0x80a8, 0x80ac, 0x80b0, 0x80b3, - 0x80b5, 0x80b6, 0x80b8, 0x80b9, 0x80bb, 0x80c5, 0x80c7, 0x80c8, - 0x80c9, 0x80ca, 0x80cb, 0x80cf, 0x80d0, 0x80d1, 0x80d2, 0x80d3, - 0x80d4, 0x80d5, 0x80d8, 0x80df, 0x80e0, 0x80e2, 0x80e3, 0x80e6, - 0x80ee, 0x80f5, 0x80f7, 0x80f9, 0x80fb, 0x80fe, 0x80ff, 0x8100, - 0x8101, 0x8103, 0x8104, 0x8105, 0x8107, 0x8108, 0x810b, 0x810c, - 0x8115, 0x8117, 0x8119, 0x811b, 0x811c, 0x811d, 0x811f, 0x8120, - 0x8121, 0x8122, 0x8123, 0x8124, 0x8125, 0x8126, 0x8127, 0x8128, - 0x8129, 0x812a, 0x812b, 0x812d, 0x812e, 0x8130, 0x8133, 0x8134, - 0x8135, 0x8137, 0x8139, 0x813a, 0x813b, 0x813c, 0x813d, 0x813f, - /* 0xc4 */ - 0x8140, 0x8141, 0x8142, 0x8143, 0x8144, 0x8145, 0x8147, 0x8149, - 0x814d, 0x814e, 0x814f, 0x8152, 0x8156, 0x8157, 0x8158, 0x815b, - 0x815c, 0x815d, 0x815e, 0x815f, 0x8161, 0x8162, 0x8163, 0x8164, - 0x8166, 0x8168, 0x816a, 0x816b, 0x816c, 0x816f, 0x8172, 0x8173, - 0x8175, 0x8176, 0x8177, 0x8178, 0x8181, 0x8183, 0x8184, 0x8185, - 0x8186, 0x8187, 0x8189, 0x818b, 0x818c, 0x818d, 0x818e, 0x8190, - 0x8192, 0x8193, 0x8194, 0x8195, 0x8196, 0x8197, 0x8199, 0x819a, - 0x819e, 0x819f, 0x81a0, 0x81a1, 0x81a2, 0x81a4, 0x81a5, 0x81a7, - 0x81a9, 0x81ab, 0x81ac, 0x81ad, 0x81ae, 0x81af, 0x81b0, 0x81b1, - 0x81b2, 0x81b4, 0x81b5, 0x81b6, 0x81b7, 0x81b8, 0x81b9, 0x81bc, - 0x81bd, 0x81be, 0x81bf, 0x81c4, 0x81c5, 0x81c7, 0x81c8, 0x81c9, - 0x81cb, 0x81cd, 0x81ce, 0x81cf, 0x81d0, 0x81d1, 0x81d2, 0x81d3, - /* 0xc5 */ - 0x81d4, 0x81d5, 0x81d6, 0x81d7, 0x81d8, 0x81d9, 0x81da, 0x81db, - 0x81dc, 0x81dd, 0x81de, 0x81df, 0x81e0, 0x81e1, 0x81e2, 0x81e4, - 0x81e5, 0x81e6, 0x81e8, 0x81e9, 0x81eb, 0x81ee, 0x81ef, 0x81f0, - 0x81f1, 0x81f2, 0x81f5, 0x81f6, 0x81f7, 0x81f8, 0x81f9, 0x81fa, - 0x81fd, 0x81ff, 0x8203, 0x8207, 0x8208, 0x8209, 0x820a, 0x820b, - 0x820e, 0x820f, 0x8211, 0x8213, 0x8215, 0x8216, 0x8217, 0x8218, - 0x8219, 0x821a, 0x821d, 0x8220, 0x8224, 0x8225, 0x8226, 0x8227, - 0x8229, 0x822e, 0x8232, 0x823a, 0x823c, 0x823d, 0x823f, 0x8240, - 0x8241, 0x8242, 0x8243, 0x8245, 0x8246, 0x8248, 0x824a, 0x824c, - 0x824d, 0x824e, 0x8250, 0x8251, 0x8252, 0x8253, 0x8254, 0x8255, - 0x8256, 0x8257, 0x8259, 0x825b, 0x825c, 0x825d, 0x825e, 0x8260, - 0x8261, 0x8262, 0x8263, 0x8264, 0x8265, 0x8266, 0x8267, 0x8269, - /* 0xc6 */ - 0x826a, 0x826b, 0x826c, 0x826d, 0x8271, 0x8275, 0x8276, 0x8277, - 0x8278, 0x827b, 0x827c, 0x8280, 0x8281, 0x8283, 0x8285, 0x8286, - 0x8287, 0x8289, 0x828c, 0x8290, 0x8293, 0x8294, 0x8295, 0x8296, - 0x829a, 0x829b, 0x829e, 0x82a0, 0x82a2, 0x82a3, 0x82a7, 0x82b2, - 0x82b5, 0x82b6, 0x82ba, 0x82bb, 0x82bc, 0x82bf, 0x82c0, 0x82c2, - 0x82c3, 0x82c5, 0x82c6, 0x82c9, 0x82d0, 0x82d6, 0x82d9, 0x82da, - 0x82dd, 0x82e2, 0x82e7, 0x82e8, 0x82e9, 0x82ea, 0x82ec, 0x82ed, - 0x82ee, 0x82f0, 0x82f2, 0x82f3, 0x82f5, 0x82f6, 0x82f8, 0x82fa, - 0x82fc, 0x82fd, 0x82fe, 0x82ff, 0x8300, 0x830a, 0x830b, 0x830d, - 0x8310, 0x8312, 0x8313, 0x8316, 0x8318, 0x8319, 0x831d, 0x831e, - 0x831f, 0x8320, 0x8321, 0x8322, 0x8323, 0x8324, 0x8325, 0x8326, - 0x8329, 0x832a, 0x832e, 0x8330, 0x8332, 0x8337, 0x833b, 0x833d, - /* 0xc7 */ - 0x833e, 0x833f, 0x8341, 0x8342, 0x8344, 0x8345, 0x8348, 0x834a, - 0x834b, 0x834c, 0x834d, 0x834e, 0x8353, 0x8355, 0x8356, 0x8357, - 0x8358, 0x8359, 0x835d, 0x8362, 0x8370, 0x8371, 0x8372, 0x8373, - 0x8374, 0x8375, 0x8376, 0x8379, 0x837a, 0x837e, 0x837f, 0x8380, - 0x8381, 0x8382, 0x8383, 0x8384, 0x8387, 0x8388, 0x838a, 0x838b, - 0x838c, 0x838d, 0x838f, 0x8390, 0x8391, 0x8394, 0x8395, 0x8396, - 0x8397, 0x8399, 0x839a, 0x839d, 0x839f, 0x83a1, 0x83a2, 0x83a3, - 0x83a4, 0x83a5, 0x83a6, 0x83a7, 0x83ac, 0x83ad, 0x83ae, 0x83af, - 0x83b5, 0x83bb, 0x83be, 0x83bf, 0x83c2, 0x83c3, 0x83c4, 0x83c6, - 0x83c8, 0x83c9, 0x83cb, 0x83cd, 0x83ce, 0x83d0, 0x83d1, 0x83d2, - 0x83d3, 0x83d5, 0x83d7, 0x83d9, 0x83da, 0x83db, 0x83de, 0x83e2, - 0x83e3, 0x83e4, 0x83e6, 0x83e7, 0x83e8, 0x83eb, 0x83ec, 0x83ed, - /* 0xc8 */ - 0x83ee, 0x83ef, 0x83f3, 0x83f4, 0x83f5, 0x83f6, 0x83f7, 0x83fa, - 0x83fb, 0x83fc, 0x83fe, 0x83ff, 0x8400, 0x8402, 0x8405, 0x8407, - 0x8408, 0x8409, 0x840a, 0x8410, 0x8412, 0x8413, 0x8414, 0x8415, - 0x8416, 0x8417, 0x8419, 0x841a, 0x841b, 0x841e, 0x841f, 0x8420, - 0x8421, 0x8422, 0x8423, 0x8429, 0x842a, 0x842b, 0x842c, 0x842d, - 0x842e, 0x842f, 0x8430, 0x8432, 0x8433, 0x8434, 0x8435, 0x8436, - 0x8437, 0x8439, 0x843a, 0x843b, 0x843e, 0x843f, 0x8440, 0x8441, - 0x8442, 0x8443, 0x8444, 0x8445, 0x8447, 0x8448, 0x8449, 0x844a, - 0x844b, 0x844c, 0x844d, 0x844e, 0x844f, 0x8450, 0x8452, 0x8453, - 0x8454, 0x8455, 0x8456, 0x8458, 0x845d, 0x845e, 0x845f, 0x8460, - 0x8462, 0x8464, 0x8465, 0x8466, 0x8467, 0x8468, 0x846a, 0x846e, - 0x846f, 0x8470, 0x8472, 0x8474, 0x8477, 0x8479, 0x847b, 0x847c, - /* 0xc9 */ - 0x847d, 0x847e, 0x847f, 0x8480, 0x8481, 0x8483, 0x8484, 0x8485, - 0x8486, 0x848a, 0x848d, 0x848f, 0x8490, 0x8491, 0x8492, 0x8493, - 0x8494, 0x8495, 0x8496, 0x8498, 0x849a, 0x849b, 0x849d, 0x849e, - 0x849f, 0x84a0, 0x84a2, 0x84a3, 0x84a4, 0x84a5, 0x84a6, 0x84a7, - 0x84a8, 0x84a9, 0x84aa, 0x84ab, 0x84ac, 0x84ad, 0x84ae, 0x84b0, - 0x84b1, 0x84b3, 0x84b5, 0x84b6, 0x84b7, 0x84bb, 0x84bc, 0x84be, - 0x84c0, 0x84c2, 0x84c3, 0x84c5, 0x84c6, 0x84c7, 0x84c8, 0x84cb, - 0x84cc, 0x84ce, 0x84cf, 0x84d2, 0x84d4, 0x84d5, 0x84d7, 0x84d8, - 0x84d9, 0x84da, 0x84db, 0x84dc, 0x84de, 0x84e1, 0x84e2, 0x84e4, - 0x84e7, 0x84e8, 0x84e9, 0x84ea, 0x84eb, 0x84ed, 0x84ee, 0x84ef, - 0x84f1, 0x84f2, 0x84f3, 0x84f4, 0x84f5, 0x84f6, 0x84f7, 0x84f8, - 0x84f9, 0x84fa, 0x84fb, 0x84fd, 0x84fe, 0x8500, 0x8501, 0x8502, - /* 0xca */ - 0x8503, 0x8504, 0x8505, 0x8506, 0x8507, 0x8508, 0x8509, 0x850a, - 0x850b, 0x850d, 0x850e, 0x850f, 0x8510, 0x8512, 0x8514, 0x8515, - 0x8516, 0x8518, 0x8519, 0x851b, 0x851c, 0x851d, 0x851e, 0x8520, - 0x8522, 0x8523, 0x8524, 0x8525, 0x8526, 0x8527, 0x8528, 0x8529, - 0x852a, 0x852d, 0x852e, 0x852f, 0x8530, 0x8531, 0x8532, 0x8533, - 0x8534, 0x8535, 0x8536, 0x853e, 0x853f, 0x8540, 0x8541, 0x8542, - 0x8544, 0x8545, 0x8546, 0x8547, 0x854b, 0x854c, 0x854d, 0x854e, - 0x854f, 0x8550, 0x8551, 0x8552, 0x8553, 0x8554, 0x8555, 0x8557, - 0x8558, 0x855a, 0x855b, 0x855c, 0x855d, 0x855f, 0x8560, 0x8561, - 0x8562, 0x8563, 0x8565, 0x8566, 0x8567, 0x8569, 0x856a, 0x856b, - 0x856c, 0x856d, 0x856e, 0x856f, 0x8570, 0x8571, 0x8573, 0x8575, - 0x8576, 0x8577, 0x8578, 0x857c, 0x857d, 0x857f, 0x8580, 0x8581, - /* 0xcb */ - 0x8582, 0x8583, 0x8586, 0x8588, 0x8589, 0x858a, 0x858b, 0x858c, - 0x858d, 0x858e, 0x8590, 0x8591, 0x8592, 0x8593, 0x8594, 0x8595, - 0x8596, 0x8597, 0x8598, 0x8599, 0x859a, 0x859d, 0x859e, 0x859f, - 0x85a0, 0x85a1, 0x85a2, 0x85a3, 0x85a5, 0x85a6, 0x85a7, 0x85a9, - 0x85ab, 0x85ac, 0x85ad, 0x85b1, 0x85b2, 0x85b3, 0x85b4, 0x85b5, - 0x85b6, 0x85b8, 0x85ba, 0x85bb, 0x85bc, 0x85bd, 0x85be, 0x85bf, - 0x85c0, 0x85c2, 0x85c3, 0x85c4, 0x85c5, 0x85c6, 0x85c7, 0x85c8, - 0x85ca, 0x85cb, 0x85cc, 0x85cd, 0x85ce, 0x85d1, 0x85d2, 0x85d4, - 0x85d6, 0x85d7, 0x85d8, 0x85d9, 0x85da, 0x85db, 0x85dd, 0x85de, - 0x85df, 0x85e0, 0x85e1, 0x85e2, 0x85e3, 0x85e5, 0x85e6, 0x85e7, - 0x85e8, 0x85ea, 0x85eb, 0x85ec, 0x85ed, 0x85ee, 0x85ef, 0x85f0, - 0x85f1, 0x85f2, 0x85f3, 0x85f4, 0x85f5, 0x85f6, 0x85f7, 0x85f8, - /* 0xcc */ - 0x85f9, 0x85fa, 0x85fc, 0x85fd, 0x85fe, 0x8600, 0x8601, 0x8602, - 0x8603, 0x8604, 0x8606, 0x8607, 0x8608, 0x8609, 0x860a, 0x860b, - 0x860c, 0x860d, 0x860e, 0x860f, 0x8610, 0x8612, 0x8613, 0x8614, - 0x8615, 0x8617, 0x8618, 0x8619, 0x861a, 0x861b, 0x861c, 0x861d, - 0x861e, 0x861f, 0x8620, 0x8621, 0x8622, 0x8623, 0x8624, 0x8625, - 0x8626, 0x8628, 0x862a, 0x862b, 0x862c, 0x862d, 0x862e, 0x862f, - 0x8630, 0x8631, 0x8632, 0x8633, 0x8634, 0x8635, 0x8636, 0x8637, - 0x8639, 0x863a, 0x863b, 0x863d, 0x863e, 0x863f, 0x8640, 0x8641, - 0x8642, 0x8643, 0x8644, 0x8645, 0x8646, 0x8647, 0x8648, 0x8649, - 0x864a, 0x864b, 0x864c, 0x8652, 0x8653, 0x8655, 0x8656, 0x8657, - 0x8658, 0x8659, 0x865b, 0x865c, 0x865d, 0x865f, 0x8660, 0x8661, - 0x8663, 0x8664, 0x8665, 0x8666, 0x8667, 0x8668, 0x8669, 0x866a, - /* 0xcd */ - 0x866d, 0x866f, 0x8670, 0x8672, 0x8673, 0x8674, 0x8675, 0x8676, - 0x8677, 0x8678, 0x8683, 0x8684, 0x8685, 0x8686, 0x8687, 0x8688, - 0x8689, 0x868e, 0x868f, 0x8690, 0x8691, 0x8692, 0x8694, 0x8696, - 0x8697, 0x8698, 0x8699, 0x869a, 0x869b, 0x869e, 0x869f, 0x86a0, - 0x86a1, 0x86a2, 0x86a5, 0x86a6, 0x86ab, 0x86ad, 0x86ae, 0x86b2, - 0x86b3, 0x86b7, 0x86b8, 0x86b9, 0x86bb, 0x86bc, 0x86bd, 0x86be, - 0x86bf, 0x86c1, 0x86c2, 0x86c3, 0x86c5, 0x86c8, 0x86cc, 0x86cd, - 0x86d2, 0x86d3, 0x86d5, 0x86d6, 0x86d7, 0x86da, 0x86dc, 0x86dd, - 0x86e0, 0x86e1, 0x86e2, 0x86e3, 0x86e5, 0x86e6, 0x86e7, 0x86e8, - 0x86ea, 0x86eb, 0x86ec, 0x86ef, 0x86f5, 0x86f6, 0x86f7, 0x86fa, - 0x86fb, 0x86fc, 0x86fd, 0x86ff, 0x8701, 0x8704, 0x8705, 0x8706, - 0x870b, 0x870c, 0x870e, 0x870f, 0x8710, 0x8711, 0x8714, 0x8716, - /* 0xce */ - 0x8719, 0x871b, 0x871d, 0x871f, 0x8720, 0x8724, 0x8726, 0x8727, - 0x8728, 0x872a, 0x872b, 0x872c, 0x872d, 0x872f, 0x8730, 0x8732, - 0x8733, 0x8735, 0x8736, 0x8738, 0x8739, 0x873a, 0x873c, 0x873d, - 0x8740, 0x8741, 0x8742, 0x8743, 0x8744, 0x8745, 0x8746, 0x874a, - 0x874b, 0x874d, 0x874f, 0x8750, 0x8751, 0x8752, 0x8754, 0x8755, - 0x8756, 0x8758, 0x875a, 0x875b, 0x875c, 0x875d, 0x875e, 0x875f, - 0x8761, 0x8762, 0x8766, 0x8767, 0x8768, 0x8769, 0x876a, 0x876b, - 0x876c, 0x876d, 0x876f, 0x8771, 0x8772, 0x8773, 0x8775, 0x8777, - 0x8778, 0x8779, 0x877a, 0x877f, 0x8780, 0x8781, 0x8784, 0x8786, - 0x8787, 0x8789, 0x878a, 0x878c, 0x878e, 0x878f, 0x8790, 0x8791, - 0x8792, 0x8794, 0x8795, 0x8796, 0x8798, 0x8799, 0x879a, 0x879b, - 0x879c, 0x879d, 0x879e, 0x87a0, 0x87a1, 0x87a2, 0x87a3, 0x87a4, - /* 0xcf */ - 0x87a5, 0x87a6, 0x87a7, 0x87a9, 0x87aa, 0x87ae, 0x87b0, 0x87b1, - 0x87b2, 0x87b4, 0x87b6, 0x87b7, 0x87b8, 0x87b9, 0x87bb, 0x87bc, - 0x87be, 0x87bf, 0x87c1, 0x87c2, 0x87c3, 0x87c4, 0x87c5, 0x87c7, - 0x87c8, 0x87c9, 0x87cc, 0x87cd, 0x87ce, 0x87cf, 0x87d0, 0x87d4, - 0x87d5, 0x87d6, 0x87d7, 0x87d8, 0x87d9, 0x87da, 0x87dc, 0x87dd, - 0x87de, 0x87df, 0x87e1, 0x87e2, 0x87e3, 0x87e4, 0x87e6, 0x87e7, - 0x87e8, 0x87e9, 0x87eb, 0x87ec, 0x87ed, 0x87ef, 0x87f0, 0x87f1, - 0x87f2, 0x87f3, 0x87f4, 0x87f5, 0x87f6, 0x87f7, 0x87f8, 0x87fa, - 0x87fb, 0x87fc, 0x87fd, 0x87ff, 0x8800, 0x8801, 0x8802, 0x8804, - 0x8805, 0x8806, 0x8807, 0x8808, 0x8809, 0x880b, 0x880c, 0x880d, - 0x880e, 0x880f, 0x8810, 0x8811, 0x8812, 0x8814, 0x8817, 0x8818, - 0x8819, 0x881a, 0x881c, 0x881d, 0x881e, 0x881f, 0x8820, 0x8823, - /* 0xd0 */ - 0x8824, 0x8825, 0x8826, 0x8827, 0x8828, 0x8829, 0x882a, 0x882b, - 0x882c, 0x882d, 0x882e, 0x882f, 0x8830, 0x8831, 0x8833, 0x8834, - 0x8835, 0x8836, 0x8837, 0x8838, 0x883a, 0x883b, 0x883d, 0x883e, - 0x883f, 0x8841, 0x8842, 0x8843, 0x8846, 0x8847, 0x8848, 0x8849, - 0x884a, 0x884b, 0x884e, 0x884f, 0x8850, 0x8851, 0x8852, 0x8853, - 0x8855, 0x8856, 0x8858, 0x885a, 0x885b, 0x885c, 0x885d, 0x885e, - 0x885f, 0x8860, 0x8866, 0x8867, 0x886a, 0x886d, 0x886f, 0x8871, - 0x8873, 0x8874, 0x8875, 0x8876, 0x8878, 0x8879, 0x887a, 0x887b, - 0x887c, 0x8880, 0x8883, 0x8886, 0x8887, 0x8889, 0x888a, 0x888c, - 0x888e, 0x888f, 0x8890, 0x8891, 0x8893, 0x8894, 0x8895, 0x8897, - 0x8898, 0x8899, 0x889a, 0x889b, 0x889d, 0x889e, 0x889f, 0x88a0, - 0x88a1, 0x88a3, 0x88a5, 0x88a6, 0x88a7, 0x88a8, 0x88a9, 0x88aa, - /* 0xd1 */ - 0x88ac, 0x88ae, 0x88af, 0x88b0, 0x88b2, 0x88b3, 0x88b4, 0x88b5, - 0x88b6, 0x88b8, 0x88b9, 0x88ba, 0x88bb, 0x88bd, 0x88be, 0x88bf, - 0x88c0, 0x88c3, 0x88c4, 0x88c7, 0x88c8, 0x88ca, 0x88cb, 0x88cc, - 0x88cd, 0x88cf, 0x88d0, 0x88d1, 0x88d3, 0x88d6, 0x88d7, 0x88da, - 0x88db, 0x88dc, 0x88dd, 0x88de, 0x88e0, 0x88e1, 0x88e6, 0x88e7, - 0x88e9, 0x88ea, 0x88eb, 0x88ec, 0x88ed, 0x88ee, 0x88ef, 0x88f2, - 0x88f5, 0x88f6, 0x88f7, 0x88fa, 0x88fb, 0x88fd, 0x88ff, 0x8900, - 0x8901, 0x8903, 0x8904, 0x8905, 0x8906, 0x8907, 0x8908, 0x8909, - 0x890b, 0x890c, 0x890d, 0x890e, 0x890f, 0x8911, 0x8914, 0x8915, - 0x8916, 0x8917, 0x8918, 0x891c, 0x891d, 0x891e, 0x891f, 0x8920, - 0x8922, 0x8923, 0x8924, 0x8926, 0x8927, 0x8928, 0x8929, 0x892c, - 0x892d, 0x892e, 0x892f, 0x8931, 0x8932, 0x8933, 0x8935, 0x8937, - /* 0xd2 */ - 0x8938, 0x8939, 0x893a, 0x893b, 0x893c, 0x893d, 0x893e, 0x893f, - 0x8940, 0x8942, 0x8943, 0x8945, 0x8946, 0x8947, 0x8948, 0x8949, - 0x894a, 0x894b, 0x894c, 0x894d, 0x894e, 0x894f, 0x8950, 0x8951, - 0x8952, 0x8953, 0x8954, 0x8955, 0x8956, 0x8957, 0x8958, 0x8959, - 0x895a, 0x895b, 0x895c, 0x895d, 0x8960, 0x8961, 0x8962, 0x8963, - 0x8964, 0x8965, 0x8967, 0x8968, 0x8969, 0x896a, 0x896b, 0x896c, - 0x896d, 0x896e, 0x896f, 0x8970, 0x8971, 0x8972, 0x8973, 0x8974, - 0x8975, 0x8976, 0x8977, 0x8978, 0x8979, 0x897a, 0x897c, 0x897d, - 0x897e, 0x8980, 0x8982, 0x8984, 0x8985, 0x8987, 0x8988, 0x8989, - 0x898a, 0x898b, 0x898c, 0x898d, 0x898e, 0x898f, 0x8990, 0x8991, - 0x8992, 0x8993, 0x8994, 0x8995, 0x8996, 0x8997, 0x8998, 0x8999, - 0x899a, 0x899b, 0x899c, 0x899d, 0x899e, 0x899f, 0x89a0, 0x89a1, - /* 0xd3 */ - 0x89a2, 0x89a3, 0x89a4, 0x89a5, 0x89a6, 0x89a7, 0x89a8, 0x89a9, - 0x89aa, 0x89ab, 0x89ac, 0x89ad, 0x89ae, 0x89af, 0x89b0, 0x89b1, - 0x89b2, 0x89b3, 0x89b4, 0x89b5, 0x89b6, 0x89b7, 0x89b8, 0x89b9, - 0x89ba, 0x89bb, 0x89bc, 0x89bd, 0x89be, 0x89bf, 0x89c0, 0x89c3, - 0x89cd, 0x89d3, 0x89d4, 0x89d5, 0x89d7, 0x89d8, 0x89d9, 0x89db, - 0x89dd, 0x89df, 0x89e0, 0x89e1, 0x89e2, 0x89e4, 0x89e7, 0x89e8, - 0x89e9, 0x89ea, 0x89ec, 0x89ed, 0x89ee, 0x89f0, 0x89f1, 0x89f2, - 0x89f4, 0x89f5, 0x89f6, 0x89f7, 0x89f8, 0x89f9, 0x89fa, 0x89fb, - 0x89fc, 0x89fd, 0x89fe, 0x89ff, 0x8a01, 0x8a02, 0x8a03, 0x8a04, - 0x8a05, 0x8a06, 0x8a08, 0x8a09, 0x8a0a, 0x8a0b, 0x8a0c, 0x8a0d, - 0x8a0e, 0x8a0f, 0x8a10, 0x8a11, 0x8a12, 0x8a13, 0x8a14, 0x8a15, - 0x8a16, 0x8a17, 0x8a18, 0x8a19, 0x8a1a, 0x8a1b, 0x8a1c, 0x8a1d, - /* 0xd4 */ - 0x8a1e, 0x8a1f, 0x8a20, 0x8a21, 0x8a22, 0x8a23, 0x8a24, 0x8a25, - 0x8a26, 0x8a27, 0x8a28, 0x8a29, 0x8a2a, 0x8a2b, 0x8a2c, 0x8a2d, - 0x8a2e, 0x8a2f, 0x8a30, 0x8a31, 0x8a32, 0x8a33, 0x8a34, 0x8a35, - 0x8a36, 0x8a37, 0x8a38, 0x8a39, 0x8a3a, 0x8a3b, 0x8a3c, 0x8a3d, - 0x8a3f, 0x8a40, 0x8a41, 0x8a42, 0x8a43, 0x8a44, 0x8a45, 0x8a46, - 0x8a47, 0x8a49, 0x8a4a, 0x8a4b, 0x8a4c, 0x8a4d, 0x8a4e, 0x8a4f, - 0x8a50, 0x8a51, 0x8a52, 0x8a53, 0x8a54, 0x8a55, 0x8a56, 0x8a57, - 0x8a58, 0x8a59, 0x8a5a, 0x8a5b, 0x8a5c, 0x8a5d, 0x8a5e, 0x8a5f, - 0x8a60, 0x8a61, 0x8a62, 0x8a63, 0x8a64, 0x8a65, 0x8a66, 0x8a67, - 0x8a68, 0x8a69, 0x8a6a, 0x8a6b, 0x8a6c, 0x8a6d, 0x8a6e, 0x8a6f, - 0x8a70, 0x8a71, 0x8a72, 0x8a73, 0x8a74, 0x8a75, 0x8a76, 0x8a77, - 0x8a78, 0x8a7a, 0x8a7b, 0x8a7c, 0x8a7d, 0x8a7e, 0x8a7f, 0x8a80, - /* 0xd5 */ - 0x8a81, 0x8a82, 0x8a83, 0x8a84, 0x8a85, 0x8a86, 0x8a87, 0x8a88, - 0x8a8b, 0x8a8c, 0x8a8d, 0x8a8e, 0x8a8f, 0x8a90, 0x8a91, 0x8a92, - 0x8a94, 0x8a95, 0x8a96, 0x8a97, 0x8a98, 0x8a99, 0x8a9a, 0x8a9b, - 0x8a9c, 0x8a9d, 0x8a9e, 0x8a9f, 0x8aa0, 0x8aa1, 0x8aa2, 0x8aa3, - 0x8aa4, 0x8aa5, 0x8aa6, 0x8aa7, 0x8aa8, 0x8aa9, 0x8aaa, 0x8aab, - 0x8aac, 0x8aad, 0x8aae, 0x8aaf, 0x8ab0, 0x8ab1, 0x8ab2, 0x8ab3, - 0x8ab4, 0x8ab5, 0x8ab6, 0x8ab7, 0x8ab8, 0x8ab9, 0x8aba, 0x8abb, - 0x8abc, 0x8abd, 0x8abe, 0x8abf, 0x8ac0, 0x8ac1, 0x8ac2, 0x8ac3, - 0x8ac4, 0x8ac5, 0x8ac6, 0x8ac7, 0x8ac8, 0x8ac9, 0x8aca, 0x8acb, - 0x8acc, 0x8acd, 0x8ace, 0x8acf, 0x8ad0, 0x8ad1, 0x8ad2, 0x8ad3, - 0x8ad4, 0x8ad5, 0x8ad6, 0x8ad7, 0x8ad8, 0x8ad9, 0x8ada, 0x8adb, - 0x8adc, 0x8add, 0x8ade, 0x8adf, 0x8ae0, 0x8ae1, 0x8ae2, 0x8ae3, - /* 0xd6 */ - 0x8ae4, 0x8ae5, 0x8ae6, 0x8ae7, 0x8ae8, 0x8ae9, 0x8aea, 0x8aeb, - 0x8aec, 0x8aed, 0x8aee, 0x8aef, 0x8af0, 0x8af1, 0x8af2, 0x8af3, - 0x8af4, 0x8af5, 0x8af6, 0x8af7, 0x8af8, 0x8af9, 0x8afa, 0x8afb, - 0x8afc, 0x8afd, 0x8afe, 0x8aff, 0x8b00, 0x8b01, 0x8b02, 0x8b03, - 0x8b04, 0x8b05, 0x8b06, 0x8b08, 0x8b09, 0x8b0a, 0x8b0b, 0x8b0c, - 0x8b0d, 0x8b0e, 0x8b0f, 0x8b10, 0x8b11, 0x8b12, 0x8b13, 0x8b14, - 0x8b15, 0x8b16, 0x8b17, 0x8b18, 0x8b19, 0x8b1a, 0x8b1b, 0x8b1c, - 0x8b1d, 0x8b1e, 0x8b1f, 0x8b20, 0x8b21, 0x8b22, 0x8b23, 0x8b24, - 0x8b25, 0x8b27, 0x8b28, 0x8b29, 0x8b2a, 0x8b2b, 0x8b2c, 0x8b2d, - 0x8b2e, 0x8b2f, 0x8b30, 0x8b31, 0x8b32, 0x8b33, 0x8b34, 0x8b35, - 0x8b36, 0x8b37, 0x8b38, 0x8b39, 0x8b3a, 0x8b3b, 0x8b3c, 0x8b3d, - 0x8b3e, 0x8b3f, 0x8b40, 0x8b41, 0x8b42, 0x8b43, 0x8b44, 0x8b45, - /* 0xd7 */ - 0x8b46, 0x8b47, 0x8b48, 0x8b49, 0x8b4a, 0x8b4b, 0x8b4c, 0x8b4d, - 0x8b4e, 0x8b4f, 0x8b50, 0x8b51, 0x8b52, 0x8b53, 0x8b54, 0x8b55, - 0x8b56, 0x8b57, 0x8b58, 0x8b59, 0x8b5a, 0x8b5b, 0x8b5c, 0x8b5d, - 0x8b5e, 0x8b5f, 0x8b60, 0x8b61, 0x8b62, 0x8b63, 0x8b64, 0x8b65, - 0x8b67, 0x8b68, 0x8b69, 0x8b6a, 0x8b6b, 0x8b6d, 0x8b6e, 0x8b6f, - 0x8b70, 0x8b71, 0x8b72, 0x8b73, 0x8b74, 0x8b75, 0x8b76, 0x8b77, - 0x8b78, 0x8b79, 0x8b7a, 0x8b7b, 0x8b7c, 0x8b7d, 0x8b7e, 0x8b7f, - 0x8b80, 0x8b81, 0x8b82, 0x8b83, 0x8b84, 0x8b85, 0x8b86, 0x8b87, - 0x8b88, 0x8b89, 0x8b8a, 0x8b8b, 0x8b8c, 0x8b8d, 0x8b8e, 0x8b8f, - 0x8b90, 0x8b91, 0x8b92, 0x8b93, 0x8b94, 0x8b95, 0x8b96, 0x8b97, - 0x8b98, 0x8b99, 0x8b9a, 0x8b9b, 0x8b9c, 0x8b9d, 0x8b9e, 0x8b9f, - 0x8bac, 0x8bb1, 0x8bbb, 0x8bc7, 0x8bd0, 0x8bea, 0x8c09, 0x8c1e, - /* 0xd8 */ - 0x8c38, 0x8c39, 0x8c3a, 0x8c3b, 0x8c3c, 0x8c3d, 0x8c3e, 0x8c3f, - 0x8c40, 0x8c42, 0x8c43, 0x8c44, 0x8c45, 0x8c48, 0x8c4a, 0x8c4b, - 0x8c4d, 0x8c4e, 0x8c4f, 0x8c50, 0x8c51, 0x8c52, 0x8c53, 0x8c54, - 0x8c56, 0x8c57, 0x8c58, 0x8c59, 0x8c5b, 0x8c5c, 0x8c5d, 0x8c5e, - 0x8c5f, 0x8c60, 0x8c63, 0x8c64, 0x8c65, 0x8c66, 0x8c67, 0x8c68, - 0x8c69, 0x8c6c, 0x8c6d, 0x8c6e, 0x8c6f, 0x8c70, 0x8c71, 0x8c72, - 0x8c74, 0x8c75, 0x8c76, 0x8c77, 0x8c7b, 0x8c7c, 0x8c7d, 0x8c7e, - 0x8c7f, 0x8c80, 0x8c81, 0x8c83, 0x8c84, 0x8c86, 0x8c87, 0x8c88, - 0x8c8b, 0x8c8d, 0x8c8e, 0x8c8f, 0x8c90, 0x8c91, 0x8c92, 0x8c93, - 0x8c95, 0x8c96, 0x8c97, 0x8c99, 0x8c9a, 0x8c9b, 0x8c9c, 0x8c9d, - 0x8c9e, 0x8c9f, 0x8ca0, 0x8ca1, 0x8ca2, 0x8ca3, 0x8ca4, 0x8ca5, - 0x8ca6, 0x8ca7, 0x8ca8, 0x8ca9, 0x8caa, 0x8cab, 0x8cac, 0x8cad, - /* 0xd9 */ - 0x8cae, 0x8caf, 0x8cb0, 0x8cb1, 0x8cb2, 0x8cb3, 0x8cb4, 0x8cb5, - 0x8cb6, 0x8cb7, 0x8cb8, 0x8cb9, 0x8cba, 0x8cbb, 0x8cbc, 0x8cbd, - 0x8cbe, 0x8cbf, 0x8cc0, 0x8cc1, 0x8cc2, 0x8cc3, 0x8cc4, 0x8cc5, - 0x8cc6, 0x8cc7, 0x8cc8, 0x8cc9, 0x8cca, 0x8ccb, 0x8ccc, 0x8ccd, - 0x8cce, 0x8ccf, 0x8cd0, 0x8cd1, 0x8cd2, 0x8cd3, 0x8cd4, 0x8cd5, - 0x8cd6, 0x8cd7, 0x8cd8, 0x8cd9, 0x8cda, 0x8cdb, 0x8cdc, 0x8cdd, - 0x8cde, 0x8cdf, 0x8ce0, 0x8ce1, 0x8ce2, 0x8ce3, 0x8ce4, 0x8ce5, - 0x8ce6, 0x8ce7, 0x8ce8, 0x8ce9, 0x8cea, 0x8ceb, 0x8cec, 0x8ced, - 0x8cee, 0x8cef, 0x8cf0, 0x8cf1, 0x8cf2, 0x8cf3, 0x8cf4, 0x8cf5, - 0x8cf6, 0x8cf7, 0x8cf8, 0x8cf9, 0x8cfa, 0x8cfb, 0x8cfc, 0x8cfd, - 0x8cfe, 0x8cff, 0x8d00, 0x8d01, 0x8d02, 0x8d03, 0x8d04, 0x8d05, - 0x8d06, 0x8d07, 0x8d08, 0x8d09, 0x8d0a, 0x8d0b, 0x8d0c, 0x8d0d, - /* 0xda */ - 0x8d0e, 0x8d0f, 0x8d10, 0x8d11, 0x8d12, 0x8d13, 0x8d14, 0x8d15, - 0x8d16, 0x8d17, 0x8d18, 0x8d19, 0x8d1a, 0x8d1b, 0x8d1c, 0x8d20, - 0x8d51, 0x8d52, 0x8d57, 0x8d5f, 0x8d65, 0x8d68, 0x8d69, 0x8d6a, - 0x8d6c, 0x8d6e, 0x8d6f, 0x8d71, 0x8d72, 0x8d78, 0x8d79, 0x8d7a, - 0x8d7b, 0x8d7c, 0x8d7d, 0x8d7e, 0x8d7f, 0x8d80, 0x8d82, 0x8d83, - 0x8d86, 0x8d87, 0x8d88, 0x8d89, 0x8d8c, 0x8d8d, 0x8d8e, 0x8d8f, - 0x8d90, 0x8d92, 0x8d93, 0x8d95, 0x8d96, 0x8d97, 0x8d98, 0x8d99, - 0x8d9a, 0x8d9b, 0x8d9c, 0x8d9d, 0x8d9e, 0x8da0, 0x8da1, 0x8da2, - 0x8da4, 0x8da5, 0x8da6, 0x8da7, 0x8da8, 0x8da9, 0x8daa, 0x8dab, - 0x8dac, 0x8dad, 0x8dae, 0x8daf, 0x8db0, 0x8db2, 0x8db6, 0x8db7, - 0x8db9, 0x8dbb, 0x8dbd, 0x8dc0, 0x8dc1, 0x8dc2, 0x8dc5, 0x8dc7, - 0x8dc8, 0x8dc9, 0x8dca, 0x8dcd, 0x8dd0, 0x8dd2, 0x8dd3, 0x8dd4, - /* 0xdb */ - 0x8dd5, 0x8dd8, 0x8dd9, 0x8ddc, 0x8de0, 0x8de1, 0x8de2, 0x8de5, - 0x8de6, 0x8de7, 0x8de9, 0x8ded, 0x8dee, 0x8df0, 0x8df1, 0x8df2, - 0x8df4, 0x8df6, 0x8dfc, 0x8dfe, 0x8dff, 0x8e00, 0x8e01, 0x8e02, - 0x8e03, 0x8e04, 0x8e06, 0x8e07, 0x8e08, 0x8e0b, 0x8e0d, 0x8e0e, - 0x8e10, 0x8e11, 0x8e12, 0x8e13, 0x8e15, 0x8e16, 0x8e17, 0x8e18, - 0x8e19, 0x8e1a, 0x8e1b, 0x8e1c, 0x8e20, 0x8e21, 0x8e24, 0x8e25, - 0x8e26, 0x8e27, 0x8e28, 0x8e2b, 0x8e2d, 0x8e30, 0x8e32, 0x8e33, - 0x8e34, 0x8e36, 0x8e37, 0x8e38, 0x8e3b, 0x8e3c, 0x8e3e, 0x8e3f, - 0x8e43, 0x8e45, 0x8e46, 0x8e4c, 0x8e4d, 0x8e4e, 0x8e4f, 0x8e50, - 0x8e53, 0x8e54, 0x8e55, 0x8e56, 0x8e57, 0x8e58, 0x8e5a, 0x8e5b, - 0x8e5c, 0x8e5d, 0x8e5e, 0x8e5f, 0x8e60, 0x8e61, 0x8e62, 0x8e63, - 0x8e64, 0x8e65, 0x8e67, 0x8e68, 0x8e6a, 0x8e6b, 0x8e6e, 0x8e71, - /* 0xdc */ - 0x8e73, 0x8e75, 0x8e77, 0x8e78, 0x8e79, 0x8e7a, 0x8e7b, 0x8e7d, - 0x8e7e, 0x8e80, 0x8e82, 0x8e83, 0x8e84, 0x8e86, 0x8e88, 0x8e89, - 0x8e8a, 0x8e8b, 0x8e8c, 0x8e8d, 0x8e8e, 0x8e91, 0x8e92, 0x8e93, - 0x8e95, 0x8e96, 0x8e97, 0x8e98, 0x8e99, 0x8e9a, 0x8e9b, 0x8e9d, - 0x8e9f, 0x8ea0, 0x8ea1, 0x8ea2, 0x8ea3, 0x8ea4, 0x8ea5, 0x8ea6, - 0x8ea7, 0x8ea8, 0x8ea9, 0x8eaa, 0x8ead, 0x8eae, 0x8eb0, 0x8eb1, - 0x8eb3, 0x8eb4, 0x8eb5, 0x8eb6, 0x8eb7, 0x8eb8, 0x8eb9, 0x8ebb, - 0x8ebc, 0x8ebd, 0x8ebe, 0x8ebf, 0x8ec0, 0x8ec1, 0x8ec2, 0x8ec3, - 0x8ec4, 0x8ec5, 0x8ec6, 0x8ec7, 0x8ec8, 0x8ec9, 0x8eca, 0x8ecb, - 0x8ecc, 0x8ecd, 0x8ecf, 0x8ed0, 0x8ed1, 0x8ed2, 0x8ed3, 0x8ed4, - 0x8ed5, 0x8ed6, 0x8ed7, 0x8ed8, 0x8ed9, 0x8eda, 0x8edb, 0x8edc, - 0x8edd, 0x8ede, 0x8edf, 0x8ee0, 0x8ee1, 0x8ee2, 0x8ee3, 0x8ee4, - /* 0xdd */ - 0x8ee5, 0x8ee6, 0x8ee7, 0x8ee8, 0x8ee9, 0x8eea, 0x8eeb, 0x8eec, - 0x8eed, 0x8eee, 0x8eef, 0x8ef0, 0x8ef1, 0x8ef2, 0x8ef3, 0x8ef4, - 0x8ef5, 0x8ef6, 0x8ef7, 0x8ef8, 0x8ef9, 0x8efa, 0x8efb, 0x8efc, - 0x8efd, 0x8efe, 0x8eff, 0x8f00, 0x8f01, 0x8f02, 0x8f03, 0x8f04, - 0x8f05, 0x8f06, 0x8f07, 0x8f08, 0x8f09, 0x8f0a, 0x8f0b, 0x8f0c, - 0x8f0d, 0x8f0e, 0x8f0f, 0x8f10, 0x8f11, 0x8f12, 0x8f13, 0x8f14, - 0x8f15, 0x8f16, 0x8f17, 0x8f18, 0x8f19, 0x8f1a, 0x8f1b, 0x8f1c, - 0x8f1d, 0x8f1e, 0x8f1f, 0x8f20, 0x8f21, 0x8f22, 0x8f23, 0x8f24, - 0x8f25, 0x8f26, 0x8f27, 0x8f28, 0x8f29, 0x8f2a, 0x8f2b, 0x8f2c, - 0x8f2d, 0x8f2e, 0x8f2f, 0x8f30, 0x8f31, 0x8f32, 0x8f33, 0x8f34, - 0x8f35, 0x8f36, 0x8f37, 0x8f38, 0x8f39, 0x8f3a, 0x8f3b, 0x8f3c, - 0x8f3d, 0x8f3e, 0x8f3f, 0x8f40, 0x8f41, 0x8f42, 0x8f43, 0x8f44, - /* 0xde */ - 0x8f45, 0x8f46, 0x8f47, 0x8f48, 0x8f49, 0x8f4a, 0x8f4b, 0x8f4c, - 0x8f4d, 0x8f4e, 0x8f4f, 0x8f50, 0x8f51, 0x8f52, 0x8f53, 0x8f54, - 0x8f55, 0x8f56, 0x8f57, 0x8f58, 0x8f59, 0x8f5a, 0x8f5b, 0x8f5c, - 0x8f5d, 0x8f5e, 0x8f5f, 0x8f60, 0x8f61, 0x8f62, 0x8f63, 0x8f64, - 0x8f65, 0x8f6a, 0x8f80, 0x8f8c, 0x8f92, 0x8f9d, 0x8fa0, 0x8fa1, - 0x8fa2, 0x8fa4, 0x8fa5, 0x8fa6, 0x8fa7, 0x8faa, 0x8fac, 0x8fad, - 0x8fae, 0x8faf, 0x8fb2, 0x8fb3, 0x8fb4, 0x8fb5, 0x8fb7, 0x8fb8, - 0x8fba, 0x8fbb, 0x8fbc, 0x8fbf, 0x8fc0, 0x8fc3, 0x8fc6, 0x8fc9, - 0x8fca, 0x8fcb, 0x8fcc, 0x8fcd, 0x8fcf, 0x8fd2, 0x8fd6, 0x8fd7, - 0x8fda, 0x8fe0, 0x8fe1, 0x8fe3, 0x8fe7, 0x8fec, 0x8fef, 0x8ff1, - 0x8ff2, 0x8ff4, 0x8ff5, 0x8ff6, 0x8ffa, 0x8ffb, 0x8ffc, 0x8ffe, - 0x8fff, 0x9007, 0x9008, 0x900c, 0x900e, 0x9013, 0x9015, 0x9018, - /* 0xdf */ - 0x9019, 0x901c, 0x9023, 0x9024, 0x9025, 0x9027, 0x9028, 0x9029, - 0x902a, 0x902b, 0x902c, 0x9030, 0x9031, 0x9032, 0x9033, 0x9034, - 0x9037, 0x9039, 0x903a, 0x903d, 0x903f, 0x9040, 0x9043, 0x9045, - 0x9046, 0x9048, 0x9049, 0x904a, 0x904b, 0x904c, 0x904e, 0x9054, - 0x9055, 0x9056, 0x9059, 0x905a, 0x905c, 0x905d, 0x905e, 0x905f, - 0x9060, 0x9061, 0x9064, 0x9066, 0x9067, 0x9069, 0x906a, 0x906b, - 0x906c, 0x906f, 0x9070, 0x9071, 0x9072, 0x9073, 0x9076, 0x9077, - 0x9078, 0x9079, 0x907a, 0x907b, 0x907c, 0x907e, 0x9081, 0x9084, - 0x9085, 0x9086, 0x9087, 0x9089, 0x908a, 0x908c, 0x908d, 0x908e, - 0x908f, 0x9090, 0x9092, 0x9094, 0x9096, 0x9098, 0x909a, 0x909c, - 0x909e, 0x909f, 0x90a0, 0x90a4, 0x90a5, 0x90a7, 0x90a8, 0x90a9, - 0x90ab, 0x90ad, 0x90b2, 0x90b7, 0x90bc, 0x90bd, 0x90bf, 0x90c0, - /* 0xe0 */ - 0x90c2, 0x90c3, 0x90c6, 0x90c8, 0x90c9, 0x90cb, 0x90cc, 0x90cd, - 0x90d2, 0x90d4, 0x90d5, 0x90d6, 0x90d8, 0x90d9, 0x90da, 0x90de, - 0x90df, 0x90e0, 0x90e3, 0x90e4, 0x90e5, 0x90e9, 0x90ea, 0x90ec, - 0x90ee, 0x90f0, 0x90f1, 0x90f2, 0x90f3, 0x90f5, 0x90f6, 0x90f7, - 0x90f9, 0x90fa, 0x90fb, 0x90fc, 0x90ff, 0x9100, 0x9101, 0x9103, - 0x9105, 0x9106, 0x9107, 0x9108, 0x9109, 0x910a, 0x910b, 0x910c, - 0x910d, 0x910e, 0x910f, 0x9110, 0x9111, 0x9112, 0x9113, 0x9114, - 0x9115, 0x9116, 0x9117, 0x9118, 0x911a, 0x911b, 0x911c, 0x911d, - 0x911f, 0x9120, 0x9121, 0x9124, 0x9125, 0x9126, 0x9127, 0x9128, - 0x9129, 0x912a, 0x912b, 0x912c, 0x912d, 0x912e, 0x9130, 0x9132, - 0x9133, 0x9134, 0x9135, 0x9136, 0x9137, 0x9138, 0x913a, 0x913b, - 0x913c, 0x913d, 0x913e, 0x913f, 0x9140, 0x9141, 0x9142, 0x9144, - /* 0xe1 */ - 0x9145, 0x9147, 0x9148, 0x9151, 0x9153, 0x9154, 0x9155, 0x9156, - 0x9158, 0x9159, 0x915b, 0x915c, 0x915f, 0x9160, 0x9166, 0x9167, - 0x9168, 0x916b, 0x916d, 0x9173, 0x917a, 0x917b, 0x917c, 0x9180, - 0x9181, 0x9182, 0x9183, 0x9184, 0x9186, 0x9188, 0x918a, 0x918e, - 0x918f, 0x9193, 0x9194, 0x9195, 0x9196, 0x9197, 0x9198, 0x9199, - 0x919c, 0x919d, 0x919e, 0x919f, 0x91a0, 0x91a1, 0x91a4, 0x91a5, - 0x91a6, 0x91a7, 0x91a8, 0x91a9, 0x91ab, 0x91ac, 0x91b0, 0x91b1, - 0x91b2, 0x91b3, 0x91b6, 0x91b7, 0x91b8, 0x91b9, 0x91bb, 0x91bc, - 0x91bd, 0x91be, 0x91bf, 0x91c0, 0x91c1, 0x91c2, 0x91c3, 0x91c4, - 0x91c5, 0x91c6, 0x91c8, 0x91cb, 0x91d0, 0x91d2, 0x91d3, 0x91d4, - 0x91d5, 0x91d6, 0x91d7, 0x91d8, 0x91d9, 0x91da, 0x91db, 0x91dd, - 0x91de, 0x91df, 0x91e0, 0x91e1, 0x91e2, 0x91e3, 0x91e4, 0x91e5, - /* 0xe2 */ - 0x91e6, 0x91e7, 0x91e8, 0x91e9, 0x91ea, 0x91eb, 0x91ec, 0x91ed, - 0x91ee, 0x91ef, 0x91f0, 0x91f1, 0x91f2, 0x91f3, 0x91f4, 0x91f5, - 0x91f6, 0x91f7, 0x91f8, 0x91f9, 0x91fa, 0x91fb, 0x91fc, 0x91fd, - 0x91fe, 0x91ff, 0x9200, 0x9201, 0x9202, 0x9203, 0x9204, 0x9205, - 0x9206, 0x9207, 0x9208, 0x9209, 0x920a, 0x920b, 0x920c, 0x920d, - 0x920e, 0x920f, 0x9210, 0x9211, 0x9212, 0x9213, 0x9214, 0x9215, - 0x9216, 0x9217, 0x9218, 0x9219, 0x921a, 0x921b, 0x921c, 0x921d, - 0x921e, 0x921f, 0x9220, 0x9221, 0x9222, 0x9223, 0x9224, 0x9225, - 0x9226, 0x9227, 0x9228, 0x9229, 0x922a, 0x922b, 0x922c, 0x922d, - 0x922e, 0x922f, 0x9230, 0x9231, 0x9232, 0x9233, 0x9234, 0x9235, - 0x9236, 0x9237, 0x9238, 0x9239, 0x923a, 0x923b, 0x923c, 0x923d, - 0x923e, 0x923f, 0x9240, 0x9241, 0x9242, 0x9243, 0x9244, 0x9245, - /* 0xe3 */ - 0x9246, 0x9247, 0x9248, 0x9249, 0x924a, 0x924b, 0x924c, 0x924d, - 0x924e, 0x924f, 0x9250, 0x9251, 0x9252, 0x9253, 0x9254, 0x9255, - 0x9256, 0x9257, 0x9258, 0x9259, 0x925a, 0x925b, 0x925c, 0x925d, - 0x925e, 0x925f, 0x9260, 0x9261, 0x9262, 0x9263, 0x9264, 0x9265, - 0x9266, 0x9267, 0x9268, 0x9269, 0x926a, 0x926b, 0x926c, 0x926d, - 0x926e, 0x926f, 0x9270, 0x9271, 0x9272, 0x9273, 0x9275, 0x9276, - 0x9277, 0x9278, 0x9279, 0x927a, 0x927b, 0x927c, 0x927d, 0x927e, - 0x927f, 0x9280, 0x9281, 0x9282, 0x9283, 0x9284, 0x9285, 0x9286, - 0x9287, 0x9288, 0x9289, 0x928a, 0x928b, 0x928c, 0x928d, 0x928f, - 0x9290, 0x9291, 0x9292, 0x9293, 0x9294, 0x9295, 0x9296, 0x9297, - 0x9298, 0x9299, 0x929a, 0x929b, 0x929c, 0x929d, 0x929e, 0x929f, - 0x92a0, 0x92a1, 0x92a2, 0x92a3, 0x92a4, 0x92a5, 0x92a6, 0x92a7, - /* 0xe4 */ - 0x92a8, 0x92a9, 0x92aa, 0x92ab, 0x92ac, 0x92ad, 0x92af, 0x92b0, - 0x92b1, 0x92b2, 0x92b3, 0x92b4, 0x92b5, 0x92b6, 0x92b7, 0x92b8, - 0x92b9, 0x92ba, 0x92bb, 0x92bc, 0x92bd, 0x92be, 0x92bf, 0x92c0, - 0x92c1, 0x92c2, 0x92c3, 0x92c4, 0x92c5, 0x92c6, 0x92c7, 0x92c9, - 0x92ca, 0x92cb, 0x92cc, 0x92cd, 0x92ce, 0x92cf, 0x92d0, 0x92d1, - 0x92d2, 0x92d3, 0x92d4, 0x92d5, 0x92d6, 0x92d7, 0x92d8, 0x92d9, - 0x92da, 0x92db, 0x92dc, 0x92dd, 0x92de, 0x92df, 0x92e0, 0x92e1, - 0x92e2, 0x92e3, 0x92e4, 0x92e5, 0x92e6, 0x92e7, 0x92e8, 0x92e9, - 0x92ea, 0x92eb, 0x92ec, 0x92ed, 0x92ee, 0x92ef, 0x92f0, 0x92f1, - 0x92f2, 0x92f3, 0x92f4, 0x92f5, 0x92f6, 0x92f7, 0x92f8, 0x92f9, - 0x92fa, 0x92fb, 0x92fc, 0x92fd, 0x92fe, 0x92ff, 0x9300, 0x9301, - 0x9302, 0x9303, 0x9304, 0x9305, 0x9306, 0x9307, 0x9308, 0x9309, - /* 0xe5 */ - 0x930a, 0x930b, 0x930c, 0x930d, 0x930e, 0x930f, 0x9310, 0x9311, - 0x9312, 0x9313, 0x9314, 0x9315, 0x9316, 0x9317, 0x9318, 0x9319, - 0x931a, 0x931b, 0x931c, 0x931d, 0x931e, 0x931f, 0x9320, 0x9321, - 0x9322, 0x9323, 0x9324, 0x9325, 0x9326, 0x9327, 0x9328, 0x9329, - 0x932a, 0x932b, 0x932c, 0x932d, 0x932e, 0x932f, 0x9330, 0x9331, - 0x9332, 0x9333, 0x9334, 0x9335, 0x9336, 0x9337, 0x9338, 0x9339, - 0x933a, 0x933b, 0x933c, 0x933d, 0x933f, 0x9340, 0x9341, 0x9342, - 0x9343, 0x9344, 0x9345, 0x9346, 0x9347, 0x9348, 0x9349, 0x934a, - 0x934b, 0x934c, 0x934d, 0x934e, 0x934f, 0x9350, 0x9351, 0x9352, - 0x9353, 0x9354, 0x9355, 0x9356, 0x9357, 0x9358, 0x9359, 0x935a, - 0x935b, 0x935c, 0x935d, 0x935e, 0x935f, 0x9360, 0x9361, 0x9362, - 0x9363, 0x9364, 0x9365, 0x9366, 0x9367, 0x9368, 0x9369, 0x936b, - /* 0xe6 */ - 0x936c, 0x936d, 0x936e, 0x936f, 0x9370, 0x9371, 0x9372, 0x9373, - 0x9374, 0x9375, 0x9376, 0x9377, 0x9378, 0x9379, 0x937a, 0x937b, - 0x937c, 0x937d, 0x937e, 0x937f, 0x9380, 0x9381, 0x9382, 0x9383, - 0x9384, 0x9385, 0x9386, 0x9387, 0x9388, 0x9389, 0x938a, 0x938b, - 0x938c, 0x938d, 0x938e, 0x9390, 0x9391, 0x9392, 0x9393, 0x9394, - 0x9395, 0x9396, 0x9397, 0x9398, 0x9399, 0x939a, 0x939b, 0x939c, - 0x939d, 0x939e, 0x939f, 0x93a0, 0x93a1, 0x93a2, 0x93a3, 0x93a4, - 0x93a5, 0x93a6, 0x93a7, 0x93a8, 0x93a9, 0x93aa, 0x93ab, 0x93ac, - 0x93ad, 0x93ae, 0x93af, 0x93b0, 0x93b1, 0x93b2, 0x93b3, 0x93b4, - 0x93b5, 0x93b6, 0x93b7, 0x93b8, 0x93b9, 0x93ba, 0x93bb, 0x93bc, - 0x93bd, 0x93be, 0x93bf, 0x93c0, 0x93c1, 0x93c2, 0x93c3, 0x93c4, - 0x93c5, 0x93c6, 0x93c7, 0x93c8, 0x93c9, 0x93cb, 0x93cc, 0x93cd, - /* 0xe7 */ - 0x93ce, 0x93cf, 0x93d0, 0x93d1, 0x93d2, 0x93d3, 0x93d4, 0x93d5, - 0x93d7, 0x93d8, 0x93d9, 0x93da, 0x93db, 0x93dc, 0x93dd, 0x93de, - 0x93df, 0x93e0, 0x93e1, 0x93e2, 0x93e3, 0x93e4, 0x93e5, 0x93e6, - 0x93e7, 0x93e8, 0x93e9, 0x93ea, 0x93eb, 0x93ec, 0x93ed, 0x93ee, - 0x93ef, 0x93f0, 0x93f1, 0x93f2, 0x93f3, 0x93f4, 0x93f5, 0x93f6, - 0x93f7, 0x93f8, 0x93f9, 0x93fa, 0x93fb, 0x93fc, 0x93fd, 0x93fe, - 0x93ff, 0x9400, 0x9401, 0x9402, 0x9403, 0x9404, 0x9405, 0x9406, - 0x9407, 0x9408, 0x9409, 0x940a, 0x940b, 0x940c, 0x940d, 0x940e, - 0x940f, 0x9410, 0x9411, 0x9412, 0x9413, 0x9414, 0x9415, 0x9416, - 0x9417, 0x9418, 0x9419, 0x941a, 0x941b, 0x941c, 0x941d, 0x941e, - 0x941f, 0x9420, 0x9421, 0x9422, 0x9423, 0x9424, 0x9425, 0x9426, - 0x9427, 0x9428, 0x9429, 0x942a, 0x942b, 0x942c, 0x942d, 0x942e, - /* 0xe8 */ - 0x942f, 0x9430, 0x9431, 0x9432, 0x9433, 0x9434, 0x9435, 0x9436, - 0x9437, 0x9438, 0x9439, 0x943a, 0x943b, 0x943c, 0x943d, 0x943f, - 0x9440, 0x9441, 0x9442, 0x9443, 0x9444, 0x9445, 0x9446, 0x9447, - 0x9448, 0x9449, 0x944a, 0x944b, 0x944c, 0x944d, 0x944e, 0x944f, - 0x9450, 0x9451, 0x9452, 0x9453, 0x9454, 0x9455, 0x9456, 0x9457, - 0x9458, 0x9459, 0x945a, 0x945b, 0x945c, 0x945d, 0x945e, 0x945f, - 0x9460, 0x9461, 0x9462, 0x9463, 0x9464, 0x9465, 0x9466, 0x9467, - 0x9468, 0x9469, 0x946a, 0x946c, 0x946d, 0x946e, 0x946f, 0x9470, - 0x9471, 0x9472, 0x9473, 0x9474, 0x9475, 0x9476, 0x9477, 0x9478, - 0x9479, 0x947a, 0x947b, 0x947c, 0x947d, 0x947e, 0x947f, 0x9480, - 0x9481, 0x9482, 0x9483, 0x9484, 0x9491, 0x9496, 0x9498, 0x94c7, - 0x94cf, 0x94d3, 0x94d4, 0x94da, 0x94e6, 0x94fb, 0x951c, 0x9520, - /* 0xe9 */ - 0x9527, 0x9533, 0x953d, 0x9543, 0x9548, 0x954b, 0x9555, 0x955a, - 0x9560, 0x956e, 0x9574, 0x9575, 0x9577, 0x9578, 0x9579, 0x957a, - 0x957b, 0x957c, 0x957d, 0x957e, 0x9580, 0x9581, 0x9582, 0x9583, - 0x9584, 0x9585, 0x9586, 0x9587, 0x9588, 0x9589, 0x958a, 0x958b, - 0x958c, 0x958d, 0x958e, 0x958f, 0x9590, 0x9591, 0x9592, 0x9593, - 0x9594, 0x9595, 0x9596, 0x9597, 0x9598, 0x9599, 0x959a, 0x959b, - 0x959c, 0x959d, 0x959e, 0x959f, 0x95a0, 0x95a1, 0x95a2, 0x95a3, - 0x95a4, 0x95a5, 0x95a6, 0x95a7, 0x95a8, 0x95a9, 0x95aa, 0x95ab, - 0x95ac, 0x95ad, 0x95ae, 0x95af, 0x95b0, 0x95b1, 0x95b2, 0x95b3, - 0x95b4, 0x95b5, 0x95b6, 0x95b7, 0x95b8, 0x95b9, 0x95ba, 0x95bb, - 0x95bc, 0x95bd, 0x95be, 0x95bf, 0x95c0, 0x95c1, 0x95c2, 0x95c3, - 0x95c4, 0x95c5, 0x95c6, 0x95c7, 0x95c8, 0x95c9, 0x95ca, 0x95cb, - /* 0xea */ - 0x95cc, 0x95cd, 0x95ce, 0x95cf, 0x95d0, 0x95d1, 0x95d2, 0x95d3, - 0x95d4, 0x95d5, 0x95d6, 0x95d7, 0x95d8, 0x95d9, 0x95da, 0x95db, - 0x95dc, 0x95dd, 0x95de, 0x95df, 0x95e0, 0x95e1, 0x95e2, 0x95e3, - 0x95e4, 0x95e5, 0x95e6, 0x95e7, 0x95ec, 0x95ff, 0x9607, 0x9613, - 0x9618, 0x961b, 0x961e, 0x9620, 0x9623, 0x9624, 0x9625, 0x9626, - 0x9627, 0x9628, 0x9629, 0x962b, 0x962c, 0x962d, 0x962f, 0x9630, - 0x9637, 0x9638, 0x9639, 0x963a, 0x963e, 0x9641, 0x9643, 0x964a, - 0x964e, 0x964f, 0x9651, 0x9652, 0x9653, 0x9656, 0x9657, 0x9658, - 0x9659, 0x965a, 0x965c, 0x965d, 0x965e, 0x9660, 0x9663, 0x9665, - 0x9666, 0x966b, 0x966d, 0x966e, 0x966f, 0x9670, 0x9671, 0x9673, - 0x9678, 0x9679, 0x967a, 0x967b, 0x967c, 0x967d, 0x967e, 0x967f, - 0x9680, 0x9681, 0x9682, 0x9683, 0x9684, 0x9687, 0x9689, 0x968a, - /* 0xeb */ - 0x968c, 0x968e, 0x9691, 0x9692, 0x9693, 0x9695, 0x9696, 0x969a, - 0x969b, 0x969d, 0x969e, 0x969f, 0x96a0, 0x96a1, 0x96a2, 0x96a3, - 0x96a4, 0x96a5, 0x96a6, 0x96a8, 0x96a9, 0x96aa, 0x96ab, 0x96ac, - 0x96ad, 0x96ae, 0x96af, 0x96b1, 0x96b2, 0x96b4, 0x96b5, 0x96b7, - 0x96b8, 0x96ba, 0x96bb, 0x96bf, 0x96c2, 0x96c3, 0x96c8, 0x96ca, - 0x96cb, 0x96d0, 0x96d1, 0x96d3, 0x96d4, 0x96d6, 0x96d7, 0x96d8, - 0x96d9, 0x96da, 0x96db, 0x96dc, 0x96dd, 0x96de, 0x96df, 0x96e1, - 0x96e2, 0x96e3, 0x96e4, 0x96e5, 0x96e6, 0x96e7, 0x96eb, 0x96ec, - 0x96ed, 0x96ee, 0x96f0, 0x96f1, 0x96f2, 0x96f4, 0x96f5, 0x96f8, - 0x96fa, 0x96fb, 0x96fc, 0x96fd, 0x96ff, 0x9702, 0x9703, 0x9705, - 0x970a, 0x970b, 0x970c, 0x9710, 0x9711, 0x9712, 0x9714, 0x9715, - 0x9717, 0x9718, 0x9719, 0x971a, 0x971b, 0x971d, 0x971f, 0x9720, - /* 0xec */ - 0x9721, 0x9722, 0x9723, 0x9724, 0x9725, 0x9726, 0x9727, 0x9728, - 0x9729, 0x972b, 0x972c, 0x972e, 0x972f, 0x9731, 0x9733, 0x9734, - 0x9735, 0x9736, 0x9737, 0x973a, 0x973b, 0x973c, 0x973d, 0x973f, - 0x9740, 0x9741, 0x9742, 0x9743, 0x9744, 0x9745, 0x9746, 0x9747, - 0x9748, 0x9749, 0x974a, 0x974b, 0x974c, 0x974d, 0x974e, 0x974f, - 0x9750, 0x9751, 0x9754, 0x9755, 0x9757, 0x9758, 0x975a, 0x975c, - 0x975d, 0x975f, 0x9763, 0x9764, 0x9766, 0x9767, 0x9768, 0x976a, - 0x976b, 0x976c, 0x976d, 0x976e, 0x976f, 0x9770, 0x9771, 0x9772, - 0x9775, 0x9777, 0x9778, 0x9779, 0x977a, 0x977b, 0x977d, 0x977e, - 0x977f, 0x9780, 0x9781, 0x9782, 0x9783, 0x9784, 0x9786, 0x9787, - 0x9788, 0x9789, 0x978a, 0x978c, 0x978e, 0x978f, 0x9790, 0x9793, - 0x9795, 0x9796, 0x9797, 0x9799, 0x979a, 0x979b, 0x979c, 0x979d, - /* 0xed */ - 0x979e, 0x979f, 0x97a1, 0x97a2, 0x97a4, 0x97a5, 0x97a6, 0x97a7, - 0x97a8, 0x97a9, 0x97aa, 0x97ac, 0x97ae, 0x97b0, 0x97b1, 0x97b3, - 0x97b5, 0x97b6, 0x97b7, 0x97b8, 0x97b9, 0x97ba, 0x97bb, 0x97bc, - 0x97bd, 0x97be, 0x97bf, 0x97c0, 0x97c1, 0x97c2, 0x97c3, 0x97c4, - 0x97c5, 0x97c6, 0x97c7, 0x97c8, 0x97c9, 0x97ca, 0x97cb, 0x97cc, - 0x97cd, 0x97ce, 0x97cf, 0x97d0, 0x97d1, 0x97d2, 0x97d3, 0x97d4, - 0x97d5, 0x97d6, 0x97d7, 0x97d8, 0x97d9, 0x97da, 0x97db, 0x97dc, - 0x97dd, 0x97de, 0x97df, 0x97e0, 0x97e1, 0x97e2, 0x97e3, 0x97e4, - 0x97e5, 0x97e8, 0x97ee, 0x97ef, 0x97f0, 0x97f1, 0x97f2, 0x97f4, - 0x97f7, 0x97f8, 0x97f9, 0x97fa, 0x97fb, 0x97fc, 0x97fd, 0x97fe, - 0x97ff, 0x9800, 0x9801, 0x9802, 0x9803, 0x9804, 0x9805, 0x9806, - 0x9807, 0x9808, 0x9809, 0x980a, 0x980b, 0x980c, 0x980d, 0x980e, - /* 0xee */ - 0x980f, 0x9810, 0x9811, 0x9812, 0x9813, 0x9814, 0x9815, 0x9816, - 0x9817, 0x9818, 0x9819, 0x981a, 0x981b, 0x981c, 0x981d, 0x981e, - 0x981f, 0x9820, 0x9821, 0x9822, 0x9823, 0x9824, 0x9825, 0x9826, - 0x9827, 0x9828, 0x9829, 0x982a, 0x982b, 0x982c, 0x982d, 0x982e, - 0x982f, 0x9830, 0x9831, 0x9832, 0x9833, 0x9834, 0x9835, 0x9836, - 0x9837, 0x9838, 0x9839, 0x983a, 0x983b, 0x983c, 0x983d, 0x983e, - 0x983f, 0x9840, 0x9841, 0x9842, 0x9843, 0x9844, 0x9845, 0x9846, - 0x9847, 0x9848, 0x9849, 0x984a, 0x984b, 0x984c, 0x984d, 0x984e, - 0x984f, 0x9850, 0x9851, 0x9852, 0x9853, 0x9854, 0x9855, 0x9856, - 0x9857, 0x9858, 0x9859, 0x985a, 0x985b, 0x985c, 0x985d, 0x985e, - 0x985f, 0x9860, 0x9861, 0x9862, 0x9863, 0x9864, 0x9865, 0x9866, - 0x9867, 0x9868, 0x9869, 0x986a, 0x986b, 0x986c, 0x986d, 0x986e, - /* 0xef */ - 0x986f, 0x9870, 0x9871, 0x9872, 0x9873, 0x9874, 0x988b, 0x988e, - 0x9892, 0x9895, 0x9899, 0x98a3, 0x98a8, 0x98a9, 0x98aa, 0x98ab, - 0x98ac, 0x98ad, 0x98ae, 0x98af, 0x98b0, 0x98b1, 0x98b2, 0x98b3, - 0x98b4, 0x98b5, 0x98b6, 0x98b7, 0x98b8, 0x98b9, 0x98ba, 0x98bb, - 0x98bc, 0x98bd, 0x98be, 0x98bf, 0x98c0, 0x98c1, 0x98c2, 0x98c3, - 0x98c4, 0x98c5, 0x98c6, 0x98c7, 0x98c8, 0x98c9, 0x98ca, 0x98cb, - 0x98cc, 0x98cd, 0x98cf, 0x98d0, 0x98d4, 0x98d6, 0x98d7, 0x98db, - 0x98dc, 0x98dd, 0x98e0, 0x98e1, 0x98e2, 0x98e3, 0x98e4, 0x98e5, - 0x98e6, 0x98e9, 0x98ea, 0x98eb, 0x98ec, 0x98ed, 0x98ee, 0x98ef, - 0x98f0, 0x98f1, 0x98f2, 0x98f3, 0x98f4, 0x98f5, 0x98f6, 0x98f7, - 0x98f8, 0x98f9, 0x98fa, 0x98fb, 0x98fc, 0x98fd, 0x98fe, 0x98ff, - 0x9900, 0x9901, 0x9902, 0x9903, 0x9904, 0x9905, 0x9906, 0x9907, - /* 0xf0 */ - 0x9908, 0x9909, 0x990a, 0x990b, 0x990c, 0x990e, 0x990f, 0x9911, - 0x9912, 0x9913, 0x9914, 0x9915, 0x9916, 0x9917, 0x9918, 0x9919, - 0x991a, 0x991b, 0x991c, 0x991d, 0x991e, 0x991f, 0x9920, 0x9921, - 0x9922, 0x9923, 0x9924, 0x9925, 0x9926, 0x9927, 0x9928, 0x9929, - 0x992a, 0x992b, 0x992c, 0x992d, 0x992f, 0x9930, 0x9931, 0x9932, - 0x9933, 0x9934, 0x9935, 0x9936, 0x9937, 0x9938, 0x9939, 0x993a, - 0x993b, 0x993c, 0x993d, 0x993e, 0x993f, 0x9940, 0x9941, 0x9942, - 0x9943, 0x9944, 0x9945, 0x9946, 0x9947, 0x9948, 0x9949, 0x994a, - 0x994b, 0x994c, 0x994d, 0x994e, 0x994f, 0x9950, 0x9951, 0x9952, - 0x9953, 0x9956, 0x9957, 0x9958, 0x9959, 0x995a, 0x995b, 0x995c, - 0x995d, 0x995e, 0x995f, 0x9960, 0x9961, 0x9962, 0x9964, 0x9966, - 0x9973, 0x9978, 0x9979, 0x997b, 0x997e, 0x9982, 0x9983, 0x9989, - /* 0xf1 */ - 0x998c, 0x998e, 0x999a, 0x999b, 0x999c, 0x999d, 0x999e, 0x999f, - 0x99a0, 0x99a1, 0x99a2, 0x99a3, 0x99a4, 0x99a6, 0x99a7, 0x99a9, - 0x99aa, 0x99ab, 0x99ac, 0x99ad, 0x99ae, 0x99af, 0x99b0, 0x99b1, - 0x99b2, 0x99b3, 0x99b4, 0x99b5, 0x99b6, 0x99b7, 0x99b8, 0x99b9, - 0x99ba, 0x99bb, 0x99bc, 0x99bd, 0x99be, 0x99bf, 0x99c0, 0x99c1, - 0x99c2, 0x99c3, 0x99c4, 0x99c5, 0x99c6, 0x99c7, 0x99c8, 0x99c9, - 0x99ca, 0x99cb, 0x99cc, 0x99cd, 0x99ce, 0x99cf, 0x99d0, 0x99d1, - 0x99d2, 0x99d3, 0x99d4, 0x99d5, 0x99d6, 0x99d7, 0x99d8, 0x99d9, - 0x99da, 0x99db, 0x99dc, 0x99dd, 0x99de, 0x99df, 0x99e0, 0x99e1, - 0x99e2, 0x99e3, 0x99e4, 0x99e5, 0x99e6, 0x99e7, 0x99e8, 0x99e9, - 0x99ea, 0x99eb, 0x99ec, 0x99ed, 0x99ee, 0x99ef, 0x99f0, 0x99f1, - 0x99f2, 0x99f3, 0x99f4, 0x99f5, 0x99f6, 0x99f7, 0x99f8, 0x99f9, - /* 0xf2 */ - 0x99fa, 0x99fb, 0x99fc, 0x99fd, 0x99fe, 0x99ff, 0x9a00, 0x9a01, - 0x9a02, 0x9a03, 0x9a04, 0x9a05, 0x9a06, 0x9a07, 0x9a08, 0x9a09, - 0x9a0a, 0x9a0b, 0x9a0c, 0x9a0d, 0x9a0e, 0x9a0f, 0x9a10, 0x9a11, - 0x9a12, 0x9a13, 0x9a14, 0x9a15, 0x9a16, 0x9a17, 0x9a18, 0x9a19, - 0x9a1a, 0x9a1b, 0x9a1c, 0x9a1d, 0x9a1e, 0x9a1f, 0x9a20, 0x9a21, - 0x9a22, 0x9a23, 0x9a24, 0x9a25, 0x9a26, 0x9a27, 0x9a28, 0x9a29, - 0x9a2a, 0x9a2b, 0x9a2c, 0x9a2d, 0x9a2e, 0x9a2f, 0x9a30, 0x9a31, - 0x9a32, 0x9a33, 0x9a34, 0x9a35, 0x9a36, 0x9a37, 0x9a38, 0x9a39, - 0x9a3a, 0x9a3b, 0x9a3c, 0x9a3d, 0x9a3e, 0x9a3f, 0x9a40, 0x9a41, - 0x9a42, 0x9a43, 0x9a44, 0x9a45, 0x9a46, 0x9a47, 0x9a48, 0x9a49, - 0x9a4a, 0x9a4b, 0x9a4c, 0x9a4d, 0x9a4e, 0x9a4f, 0x9a50, 0x9a51, - 0x9a52, 0x9a53, 0x9a54, 0x9a55, 0x9a56, 0x9a57, 0x9a58, 0x9a59, - /* 0xf3 */ - 0x9a5a, 0x9a5b, 0x9a5c, 0x9a5d, 0x9a5e, 0x9a5f, 0x9a60, 0x9a61, - 0x9a62, 0x9a63, 0x9a64, 0x9a65, 0x9a66, 0x9a67, 0x9a68, 0x9a69, - 0x9a6a, 0x9a6b, 0x9a72, 0x9a83, 0x9a89, 0x9a8d, 0x9a8e, 0x9a94, - 0x9a95, 0x9a99, 0x9aa6, 0x9aa9, 0x9aaa, 0x9aab, 0x9aac, 0x9aad, - 0x9aae, 0x9aaf, 0x9ab2, 0x9ab3, 0x9ab4, 0x9ab5, 0x9ab9, 0x9abb, - 0x9abd, 0x9abe, 0x9abf, 0x9ac3, 0x9ac4, 0x9ac6, 0x9ac7, 0x9ac8, - 0x9ac9, 0x9aca, 0x9acd, 0x9ace, 0x9acf, 0x9ad0, 0x9ad2, 0x9ad4, - 0x9ad5, 0x9ad6, 0x9ad7, 0x9ad9, 0x9ada, 0x9adb, 0x9adc, 0x9add, - 0x9ade, 0x9ae0, 0x9ae2, 0x9ae3, 0x9ae4, 0x9ae5, 0x9ae7, 0x9ae8, - 0x9ae9, 0x9aea, 0x9aec, 0x9aee, 0x9af0, 0x9af1, 0x9af2, 0x9af3, - 0x9af4, 0x9af5, 0x9af6, 0x9af7, 0x9af8, 0x9afa, 0x9afc, 0x9afd, - 0x9afe, 0x9aff, 0x9b00, 0x9b01, 0x9b02, 0x9b04, 0x9b05, 0x9b06, - /* 0xf4 */ - 0x9b07, 0x9b09, 0x9b0a, 0x9b0b, 0x9b0c, 0x9b0d, 0x9b0e, 0x9b10, - 0x9b11, 0x9b12, 0x9b14, 0x9b15, 0x9b16, 0x9b17, 0x9b18, 0x9b19, - 0x9b1a, 0x9b1b, 0x9b1c, 0x9b1d, 0x9b1e, 0x9b20, 0x9b21, 0x9b22, - 0x9b24, 0x9b25, 0x9b26, 0x9b27, 0x9b28, 0x9b29, 0x9b2a, 0x9b2b, - 0x9b2c, 0x9b2d, 0x9b2e, 0x9b30, 0x9b31, 0x9b33, 0x9b34, 0x9b35, - 0x9b36, 0x9b37, 0x9b38, 0x9b39, 0x9b3a, 0x9b3d, 0x9b3e, 0x9b3f, - 0x9b40, 0x9b46, 0x9b4a, 0x9b4b, 0x9b4c, 0x9b4e, 0x9b50, 0x9b52, - 0x9b53, 0x9b55, 0x9b56, 0x9b57, 0x9b58, 0x9b59, 0x9b5a, 0x9b5b, - 0x9b5c, 0x9b5d, 0x9b5e, 0x9b5f, 0x9b60, 0x9b61, 0x9b62, 0x9b63, - 0x9b64, 0x9b65, 0x9b66, 0x9b67, 0x9b68, 0x9b69, 0x9b6a, 0x9b6b, - 0x9b6c, 0x9b6d, 0x9b6e, 0x9b6f, 0x9b70, 0x9b71, 0x9b72, 0x9b73, - 0x9b74, 0x9b75, 0x9b76, 0x9b77, 0x9b78, 0x9b79, 0x9b7a, 0x9b7b, - /* 0xf5 */ - 0x9b7c, 0x9b7d, 0x9b7e, 0x9b7f, 0x9b80, 0x9b81, 0x9b82, 0x9b83, - 0x9b84, 0x9b85, 0x9b86, 0x9b87, 0x9b88, 0x9b89, 0x9b8a, 0x9b8b, - 0x9b8c, 0x9b8d, 0x9b8e, 0x9b8f, 0x9b90, 0x9b91, 0x9b92, 0x9b93, - 0x9b94, 0x9b95, 0x9b96, 0x9b97, 0x9b98, 0x9b99, 0x9b9a, 0x9b9b, - 0x9b9c, 0x9b9d, 0x9b9e, 0x9b9f, 0x9ba0, 0x9ba1, 0x9ba2, 0x9ba3, - 0x9ba4, 0x9ba5, 0x9ba6, 0x9ba7, 0x9ba8, 0x9ba9, 0x9baa, 0x9bab, - 0x9bac, 0x9bad, 0x9bae, 0x9baf, 0x9bb0, 0x9bb1, 0x9bb2, 0x9bb3, - 0x9bb4, 0x9bb5, 0x9bb6, 0x9bb7, 0x9bb8, 0x9bb9, 0x9bba, 0x9bbb, - 0x9bbc, 0x9bbd, 0x9bbe, 0x9bbf, 0x9bc0, 0x9bc1, 0x9bc2, 0x9bc3, - 0x9bc4, 0x9bc5, 0x9bc6, 0x9bc7, 0x9bc8, 0x9bc9, 0x9bca, 0x9bcb, - 0x9bcc, 0x9bcd, 0x9bce, 0x9bcf, 0x9bd0, 0x9bd1, 0x9bd2, 0x9bd3, - 0x9bd4, 0x9bd5, 0x9bd6, 0x9bd7, 0x9bd8, 0x9bd9, 0x9bda, 0x9bdb, - /* 0xf6 */ - 0x9bdc, 0x9bdd, 0x9bde, 0x9bdf, 0x9be0, 0x9be1, 0x9be2, 0x9be3, - 0x9be4, 0x9be5, 0x9be6, 0x9be7, 0x9be8, 0x9be9, 0x9bea, 0x9beb, - 0x9bec, 0x9bed, 0x9bee, 0x9bef, 0x9bf0, 0x9bf1, 0x9bf2, 0x9bf3, - 0x9bf4, 0x9bf5, 0x9bf6, 0x9bf7, 0x9bf8, 0x9bf9, 0x9bfa, 0x9bfb, - 0x9bfc, 0x9bfd, 0x9bfe, 0x9bff, 0x9c00, 0x9c01, 0x9c02, 0x9c03, - 0x9c04, 0x9c05, 0x9c06, 0x9c07, 0x9c08, 0x9c09, 0x9c0a, 0x9c0b, - 0x9c0c, 0x9c0d, 0x9c0e, 0x9c0f, 0x9c10, 0x9c11, 0x9c12, 0x9c13, - 0x9c14, 0x9c15, 0x9c16, 0x9c17, 0x9c18, 0x9c19, 0x9c1a, 0x9c1b, - 0x9c1c, 0x9c1d, 0x9c1e, 0x9c1f, 0x9c20, 0x9c21, 0x9c22, 0x9c23, - 0x9c24, 0x9c25, 0x9c26, 0x9c27, 0x9c28, 0x9c29, 0x9c2a, 0x9c2b, - 0x9c2c, 0x9c2d, 0x9c2e, 0x9c2f, 0x9c30, 0x9c31, 0x9c32, 0x9c33, - 0x9c34, 0x9c35, 0x9c36, 0x9c37, 0x9c38, 0x9c39, 0x9c3a, 0x9c3b, - /* 0xf7 */ - 0x9c3c, 0x9c3d, 0x9c3e, 0x9c3f, 0x9c40, 0x9c41, 0x9c42, 0x9c43, - 0x9c44, 0x9c45, 0x9c46, 0x9c47, 0x9c48, 0x9c49, 0x9c4a, 0x9c4b, - 0x9c4c, 0x9c4d, 0x9c4e, 0x9c4f, 0x9c50, 0x9c51, 0x9c52, 0x9c53, - 0x9c54, 0x9c55, 0x9c56, 0x9c57, 0x9c58, 0x9c59, 0x9c5a, 0x9c5b, - 0x9c5c, 0x9c5d, 0x9c5e, 0x9c5f, 0x9c60, 0x9c61, 0x9c62, 0x9c63, - 0x9c64, 0x9c65, 0x9c66, 0x9c67, 0x9c68, 0x9c69, 0x9c6a, 0x9c6b, - 0x9c6c, 0x9c6d, 0x9c6e, 0x9c6f, 0x9c70, 0x9c71, 0x9c72, 0x9c73, - 0x9c74, 0x9c75, 0x9c76, 0x9c77, 0x9c78, 0x9c79, 0x9c7a, 0x9c7b, - 0x9c7d, 0x9c7e, 0x9c80, 0x9c83, 0x9c84, 0x9c89, 0x9c8a, 0x9c8c, - 0x9c8f, 0x9c93, 0x9c96, 0x9c97, 0x9c98, 0x9c99, 0x9c9d, 0x9caa, - 0x9cac, 0x9caf, 0x9cb9, 0x9cbe, 0x9cbf, 0x9cc0, 0x9cc1, 0x9cc2, - 0x9cc8, 0x9cc9, 0x9cd1, 0x9cd2, 0x9cda, 0x9cdb, 0x9ce0, 0x9ce1, - /* 0xf8 */ - 0x9ce3, 0x9ce4, 0x9ce5, 0x9ce6, 0x9ce7, 0x9ce8, 0x9ce9, 0x9cea, - 0x9ceb, 0x9cec, 0x9ced, 0x9cee, 0x9cef, 0x9cf0, 0x9cf1, 0x9cf2, - 0x9cf3, 0x9cf4, 0x9cf5, 0x9cf6, 0x9cf7, 0x9cf8, 0x9cf9, 0x9cfa, - 0x9cfb, 0x9cfc, 0x9cfd, 0x9cfe, 0x9cff, 0x9d00, 0x9d01, 0x9d02, - 0x9d03, 0x9d04, 0x9d05, 0x9d06, 0x9d07, 0x9d08, 0x9d09, 0x9d0a, - 0x9d0b, 0x9d0c, 0x9d0d, 0x9d0e, 0x9d0f, 0x9d10, 0x9d11, 0x9d12, - 0x9d13, 0x9d14, 0x9d15, 0x9d16, 0x9d17, 0x9d18, 0x9d19, 0x9d1a, - 0x9d1b, 0x9d1c, 0x9d1d, 0x9d1e, 0x9d1f, 0x9d20, 0x9d21, 0x9d22, - 0x9d23, 0x9d24, 0x9d25, 0x9d26, 0x9d27, 0x9d28, 0x9d29, 0x9d2a, - 0x9d2b, 0x9d2c, 0x9d2d, 0x9d2e, 0x9d2f, 0x9d30, 0x9d31, 0x9d32, - 0x9d33, 0x9d34, 0x9d35, 0x9d36, 0x9d37, 0x9d38, 0x9d39, 0x9d3a, - 0x9d3b, 0x9d3c, 0x9d3d, 0x9d3e, 0x9d3f, 0x9d40, 0x9d41, 0x9d42, - /* 0xf9 */ - 0x9d43, 0x9d44, 0x9d45, 0x9d46, 0x9d47, 0x9d48, 0x9d49, 0x9d4a, - 0x9d4b, 0x9d4c, 0x9d4d, 0x9d4e, 0x9d4f, 0x9d50, 0x9d51, 0x9d52, - 0x9d53, 0x9d54, 0x9d55, 0x9d56, 0x9d57, 0x9d58, 0x9d59, 0x9d5a, - 0x9d5b, 0x9d5c, 0x9d5d, 0x9d5e, 0x9d5f, 0x9d60, 0x9d61, 0x9d62, - 0x9d63, 0x9d64, 0x9d65, 0x9d66, 0x9d67, 0x9d68, 0x9d69, 0x9d6a, - 0x9d6b, 0x9d6c, 0x9d6d, 0x9d6e, 0x9d6f, 0x9d70, 0x9d71, 0x9d72, - 0x9d73, 0x9d74, 0x9d75, 0x9d76, 0x9d77, 0x9d78, 0x9d79, 0x9d7a, - 0x9d7b, 0x9d7c, 0x9d7d, 0x9d7e, 0x9d7f, 0x9d80, 0x9d81, 0x9d82, - 0x9d83, 0x9d84, 0x9d85, 0x9d86, 0x9d87, 0x9d88, 0x9d89, 0x9d8a, - 0x9d8b, 0x9d8c, 0x9d8d, 0x9d8e, 0x9d8f, 0x9d90, 0x9d91, 0x9d92, - 0x9d93, 0x9d94, 0x9d95, 0x9d96, 0x9d97, 0x9d98, 0x9d99, 0x9d9a, - 0x9d9b, 0x9d9c, 0x9d9d, 0x9d9e, 0x9d9f, 0x9da0, 0x9da1, 0x9da2, - /* 0xfa */ - 0x9da3, 0x9da4, 0x9da5, 0x9da6, 0x9da7, 0x9da8, 0x9da9, 0x9daa, - 0x9dab, 0x9dac, 0x9dad, 0x9dae, 0x9daf, 0x9db0, 0x9db1, 0x9db2, - 0x9db3, 0x9db4, 0x9db5, 0x9db6, 0x9db7, 0x9db8, 0x9db9, 0x9dba, - 0x9dbb, 0x9dbc, 0x9dbd, 0x9dbe, 0x9dbf, 0x9dc0, 0x9dc1, 0x9dc2, - 0x9dc3, 0x9dc4, 0x9dc5, 0x9dc6, 0x9dc7, 0x9dc8, 0x9dc9, 0x9dca, - 0x9dcb, 0x9dcc, 0x9dcd, 0x9dce, 0x9dcf, 0x9dd0, 0x9dd1, 0x9dd2, - 0x9dd3, 0x9dd4, 0x9dd5, 0x9dd6, 0x9dd7, 0x9dd8, 0x9dd9, 0x9dda, - 0x9ddb, 0x9ddc, 0x9ddd, 0x9dde, 0x9ddf, 0x9de0, 0x9de1, 0x9de2, - 0x9de3, 0x9de4, 0x9de5, 0x9de6, 0x9de7, 0x9de8, 0x9de9, 0x9dea, - 0x9deb, 0x9dec, 0x9ded, 0x9dee, 0x9def, 0x9df0, 0x9df1, 0x9df2, - 0x9df3, 0x9df4, 0x9df5, 0x9df6, 0x9df7, 0x9df8, 0x9df9, 0x9dfa, - 0x9dfb, 0x9dfc, 0x9dfd, 0x9dfe, 0x9dff, 0x9e00, 0x9e01, 0x9e02, - /* 0xfb */ - 0x9e03, 0x9e04, 0x9e05, 0x9e06, 0x9e07, 0x9e08, 0x9e09, 0x9e0a, - 0x9e0b, 0x9e0c, 0x9e0d, 0x9e0e, 0x9e0f, 0x9e10, 0x9e11, 0x9e12, - 0x9e13, 0x9e14, 0x9e15, 0x9e16, 0x9e17, 0x9e18, 0x9e19, 0x9e1a, - 0x9e1b, 0x9e1c, 0x9e1d, 0x9e1e, 0x9e24, 0x9e27, 0x9e2e, 0x9e30, - 0x9e34, 0x9e3b, 0x9e3c, 0x9e40, 0x9e4d, 0x9e50, 0x9e52, 0x9e53, - 0x9e54, 0x9e56, 0x9e59, 0x9e5d, 0x9e5f, 0x9e60, 0x9e61, 0x9e62, - 0x9e65, 0x9e6e, 0x9e6f, 0x9e72, 0x9e74, 0x9e75, 0x9e76, 0x9e77, - 0x9e78, 0x9e79, 0x9e7a, 0x9e7b, 0x9e7c, 0x9e7d, 0x9e80, 0x9e81, - 0x9e83, 0x9e84, 0x9e85, 0x9e86, 0x9e89, 0x9e8a, 0x9e8c, 0x9e8d, - 0x9e8e, 0x9e8f, 0x9e90, 0x9e91, 0x9e94, 0x9e95, 0x9e96, 0x9e97, - 0x9e98, 0x9e99, 0x9e9a, 0x9e9b, 0x9e9c, 0x9e9e, 0x9ea0, 0x9ea1, - 0x9ea2, 0x9ea3, 0x9ea4, 0x9ea5, 0x9ea7, 0x9ea8, 0x9ea9, 0x9eaa, - /* 0xfc */ - 0x9eab, 0x9eac, 0x9ead, 0x9eae, 0x9eaf, 0x9eb0, 0x9eb1, 0x9eb2, - 0x9eb3, 0x9eb5, 0x9eb6, 0x9eb7, 0x9eb9, 0x9eba, 0x9ebc, 0x9ebf, - 0x9ec0, 0x9ec1, 0x9ec2, 0x9ec3, 0x9ec5, 0x9ec6, 0x9ec7, 0x9ec8, - 0x9eca, 0x9ecb, 0x9ecc, 0x9ed0, 0x9ed2, 0x9ed3, 0x9ed5, 0x9ed6, - 0x9ed7, 0x9ed9, 0x9eda, 0x9ede, 0x9ee1, 0x9ee3, 0x9ee4, 0x9ee6, - 0x9ee8, 0x9eeb, 0x9eec, 0x9eed, 0x9eee, 0x9ef0, 0x9ef1, 0x9ef2, - 0x9ef3, 0x9ef4, 0x9ef5, 0x9ef6, 0x9ef7, 0x9ef8, 0x9efa, 0x9efd, - 0x9eff, 0x9f00, 0x9f01, 0x9f02, 0x9f03, 0x9f04, 0x9f05, 0x9f06, - 0x9f07, 0x9f08, 0x9f09, 0x9f0a, 0x9f0c, 0x9f0f, 0x9f11, 0x9f12, - 0x9f14, 0x9f15, 0x9f16, 0x9f18, 0x9f1a, 0x9f1b, 0x9f1c, 0x9f1d, - 0x9f1e, 0x9f1f, 0x9f21, 0x9f23, 0x9f24, 0x9f25, 0x9f26, 0x9f27, - 0x9f28, 0x9f29, 0x9f2a, 0x9f2b, 0x9f2d, 0x9f2e, 0x9f30, 0x9f31, - /* 0xfd */ - 0x9f32, 0x9f33, 0x9f34, 0x9f35, 0x9f36, 0x9f38, 0x9f3a, 0x9f3c, - 0x9f3f, 0x9f40, 0x9f41, 0x9f42, 0x9f43, 0x9f45, 0x9f46, 0x9f47, - 0x9f48, 0x9f49, 0x9f4a, 0x9f4b, 0x9f4c, 0x9f4d, 0x9f4e, 0x9f4f, - 0x9f52, 0x9f53, 0x9f54, 0x9f55, 0x9f56, 0x9f57, 0x9f58, 0x9f59, - 0x9f5a, 0x9f5b, 0x9f5c, 0x9f5d, 0x9f5e, 0x9f5f, 0x9f60, 0x9f61, - 0x9f62, 0x9f63, 0x9f64, 0x9f65, 0x9f66, 0x9f67, 0x9f68, 0x9f69, - 0x9f6a, 0x9f6b, 0x9f6c, 0x9f6d, 0x9f6e, 0x9f6f, 0x9f70, 0x9f71, - 0x9f72, 0x9f73, 0x9f74, 0x9f75, 0x9f76, 0x9f77, 0x9f78, 0x9f79, - 0x9f7a, 0x9f7b, 0x9f7c, 0x9f7d, 0x9f7e, 0x9f81, 0x9f82, 0x9f8d, - 0x9f8e, 0x9f8f, 0x9f90, 0x9f91, 0x9f92, 0x9f93, 0x9f94, 0x9f95, - 0x9f96, 0x9f97, 0x9f98, 0x9f9c, 0x9f9d, 0x9f9e, 0x9fa1, 0x9fa2, - 0x9fa3, 0x9fa4, 0x9fa5, 0xf92c, 0xf979, 0xf995, 0xf9e7, 0xf9f1, - /* 0xfe */ - 0xfa0c, 0xfa0d, 0xfa0e, 0xfa0f, 0xfa11, 0xfa13, 0xfa14, 0xfa18, - 0xfa1f, 0xfa20, 0xfa21, 0xfa23, 0xfa24, 0xfa27, 0xfa28, 0xfa29, -}; - -static const u16 cp936ext_2uni_pagea6[181-159] = { - /* 0xa6 */ - 0xfe35, - 0xfe36, 0xfe39, 0xfe3a, 0xfe3f, 0xfe40, 0xfe3d, 0xfe3e, 0xfe41, - 0xfe42, 0xfe43, 0xfe44, 0xfffd, 0xfffd, 0xfe3b, 0xfe3c, 0xfe37, - 0xfe38, 0xfe31, 0xfffd, 0xfe33, 0xfe34, -}; -static const u16 cp936ext_2uni_pagea8[128-122] = { - /* 0xa8 */ - 0x0251, 0xfffd, 0x0144, 0x0148, 0xfffd, 0x0261, -}; - -static int gb2312_mbtowc(ucs4_t *pwc, const u8 *s, int n) -{ - u8 c1 = s[0]; - if ((c1 >= 0x21 && c1 <= 0x29) || (c1 >= 0x30 && c1 <= 0x77)) { - if (n >= 2) { - u8 c2 = s[1]; - if (c2 >= 0x21 && c2 < 0x7f) { - u32 i = 94 * (c1 - 0x21) + (c2 - 0x21); - u16 wc = 0xfffd; - if (i < 1410) { - if (i < 831) - wc = gb2312_2uni_page21[i]; - } else { - if (i < 8178) - wc = gb2312_2uni_page30[i-1410]; - } - if (wc != 0xfffd) { - *pwc = (ucs4_t) wc; - return 2; - } - } - return RET_ILSEQ; - } - return RET_TOOFEW(0); - } - return RET_ILSEQ; -} - - - -static int cp936ext_mbtowc(ucs4_t *pwc, const u8 *s, int n) -{ - u8 c1 = s[0]; - if ((c1 == 0xa6) || (c1 == 0xa8)) { - if (n >= 2) { - u8 c2 = s[1]; - if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0x80 && c2 < 0xff)) { - u32 i = 190 * (c1 - 0x81) + (c2 - (c2 >= 0x80 ? 0x41 : 0x40)); - u16 wc = 0xfffd; - if (i < 7410) { - if (i >= 7189 && i < 7211) - wc = cp936ext_2uni_pagea6[i-7189]; - } else { - if (i >= 7532 && i < 7538) - wc = cp936ext_2uni_pagea8[i-7532]; - } - if (wc != 0xfffd) { - *pwc = (ucs4_t) wc; - return 2; - } - } - return RET_ILSEQ; - } - return RET_TOOFEW(0); - } - return RET_ILSEQ; -} - -/* unicode <-> cjk */ -static int gbkext1_mbtowc(ucs4_t *pwc, const u8 *s, int n) -{ - u8 c1 = s[0]; - if ((c1 >= 0x81 && c1 <= 0xa0)) { - if (n >= 2) { - u8 c2 = s[1]; - if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0x80 && c2 < 0xff)) { - u32 i = 190 * (c1 - 0x81) + (c2 - (c2 >= 0x80 ? 0x41 : 0x40)); - u16 wc = 0xfffd; - { - if (i < 6080) - wc = gbkext1_2uni_page81[i]; - } - if (wc != 0xfffd) { - *pwc = (ucs4_t) wc; - return 2; - } - } - return RET_ILSEQ; - } - return RET_TOOFEW(0); - } - return RET_ILSEQ; -} - -static int gbkext2_mbtowc(ucs4_t *pwc, const u8 *s, int n) -{ - u8 c1 = s[0]; - if ((c1 >= 0xa8 && c1 <= 0xfe)) { - if (n >= 2) { - u8 c2 = s[1]; - if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0x80 && c2 < 0xa1)) { - u32 i = 96 * (c1 - 0x81) + (c2 - (c2 >= 0x80 ? 0x41 : 0x40)); - u16 wc = 0xfffd; - { - if (i < 12016) - wc = gbkext2_2uni_pagea8[i-3744]; - } - if (wc != 0xfffd) { - *pwc = (ucs4_t) wc; - return 2; - } - } - return RET_ILSEQ; - } - return RET_TOOFEW(0); - } - return RET_ILSEQ; -} - -static int _gbk_mbtowc(ucs4_t *pwc, const u8 *s, int n) -{ - u8 c = *s; - - if (c >= 0x81 && c < 0xff) { - if (n < 2) - return RET_TOOFEW(0); - if (c >= 0xa1 && c <= 0xf7) { - u8 c2 = s[1]; - if (c == 0xa1) { - if (c2 == 0xa4) { - *pwc = 0x00b7; - return 2; - } - if (c2 == 0xaa) { - *pwc = 0x2014; - return 2; - } - } - if (c2 >= 0xa1 && c2 < 0xff) { - u8 buf[2]; - int ret; - buf[0] = c-0x80; buf[1] = c2-0x80; - ret = gb2312_mbtowc(pwc,buf,2); - if (ret != RET_ILSEQ) - return ret; - buf[0] = c; buf[1] = c2; - ret = cp936ext_mbtowc(pwc,buf,2); - if (ret != RET_ILSEQ) - return ret; - } - } - if (c >= 0x81 && c <= 0xa0) - return gbkext1_mbtowc(pwc,s,2); - if (c >= 0xa8 && c <= 0xfe) - return gbkext2_mbtowc(pwc,s,2); - if (c == 0xa2) { - u8 c2 = s[1]; - if (c2 >= 0xa1 && c2 <= 0xaa) { - *pwc = 0x2170+(c2-0xa1); - return 2; - } - } - } - return RET_ILSEQ; -} - -static int ascii_mbtowc ( ucs4_t *pwc, const u8 *s, int n __attribute__((unused))) -{ - u8 c = *s; - if (c < 0x80) { - *pwc = (ucs4_t) c; - return 1; - } - return RET_ILSEQ; -} - - -static int gbk_mbtowc(ucs4_t *pwc, const u8 *s, int n) -{ - u8 c = *s; - - /* Code set 0 (ASCII or GB 1988-89) */ - if (c < 0x80) - return ascii_mbtowc(pwc,s,n); - /* Code set 1 (GBK) */ - if (c >= 0x81 && c < 0xff) { - if (n < 2) - return RET_TOOFEW(0); - return _gbk_mbtowc(pwc,s,2); - } - return RET_ILSEQ; -} - -u16 charsets_gbk_to_ucs(const u8 * cjk) -{ - ucs4_t u; - if(gbk_mbtowc(&u, cjk, 2) < 1) - u = 0x1FFF; - return (u16) u; -} - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- +// +// The encoding conversion functions are taken from the eReader project of aeolusc. +// +//------------------------------------------------------------------------------------- + + + + +#include "../include/Encoding.h" + +////////////////////////////////////////////////////////////////////////// + + +#ifndef INVALID +#define INVALID ((u32)-1) +#endif + +typedef u32 ucs4_t; +#define RET_ILSEQ -1 +#define RET_TOOFEW(n) (-2-(n)) +#define RET_ILUNI -1 +#define RET_TOOSMALL -2 + + + +static const u16 gb2312_2uni_page21[831] = { + /* 0x21 */ + 0x3000, 0x3001, 0x3002, 0x30fb, 0x02c9, 0x02c7, 0x00a8, 0x3003, + 0x3005, 0x2015, 0xff5e, 0x2016, 0x2026, 0x2018, 0x2019, 0x201c, + 0x201d, 0x3014, 0x3015, 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, + 0x300d, 0x300e, 0x300f, 0x3016, 0x3017, 0x3010, 0x3011, 0x00b1, + 0x00d7, 0x00f7, 0x2236, 0x2227, 0x2228, 0x2211, 0x220f, 0x222a, + 0x2229, 0x2208, 0x2237, 0x221a, 0x22a5, 0x2225, 0x2220, 0x2312, + 0x2299, 0x222b, 0x222e, 0x2261, 0x224c, 0x2248, 0x223d, 0x221d, + 0x2260, 0x226e, 0x226f, 0x2264, 0x2265, 0x221e, 0x2235, 0x2234, + 0x2642, 0x2640, 0x00b0, 0x2032, 0x2033, 0x2103, 0xff04, 0x00a4, + 0xffe0, 0xffe1, 0x2030, 0x00a7, 0x2116, 0x2606, 0x2605, 0x25cb, + 0x25cf, 0x25ce, 0x25c7, 0x25c6, 0x25a1, 0x25a0, 0x25b3, 0x25b2, + 0x203b, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, + /* 0x22 */ + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f, + 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497, + 0x2498, 0x2499, 0x249a, 0x249b, 0x2474, 0x2475, 0x2476, 0x2477, + 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f, + 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487, + 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, + 0x2468, 0x2469, 0xfffd, 0xfffd, 0x3220, 0x3221, 0x3222, 0x3223, + 0x3224, 0x3225, 0x3226, 0x3227, 0x3228, 0x3229, 0xfffd, 0xfffd, + 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, + 0x2168, 0x2169, 0x216a, 0x216b, 0xfffd, 0xfffd, + /* 0x23 */ + 0xff01, 0xff02, 0xff03, 0xffe5, 0xff05, 0xff06, 0xff07, 0xff08, + 0xff09, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f, 0xff10, + 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17, 0xff18, + 0xff19, 0xff1a, 0xff1b, 0xff1c, 0xff1d, 0xff1e, 0xff1f, 0xff20, + 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27, 0xff28, + 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f, 0xff30, + 0xff31, 0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37, 0xff38, + 0xff39, 0xff3a, 0xff3b, 0xff3c, 0xff3d, 0xff3e, 0xff3f, 0xff40, + 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47, 0xff48, + 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f, 0xff50, + 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57, 0xff58, + 0xff59, 0xff5a, 0xff5b, 0xff5c, 0xff5d, 0xffe3, + /* 0x24 */ + 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047, 0x3048, + 0x3049, 0x304a, 0x304b, 0x304c, 0x304d, 0x304e, 0x304f, 0x3050, + 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, + 0x3059, 0x305a, 0x305b, 0x305c, 0x305d, 0x305e, 0x305f, 0x3060, + 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, + 0x3069, 0x306a, 0x306b, 0x306c, 0x306d, 0x306e, 0x306f, 0x3070, + 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, + 0x3079, 0x307a, 0x307b, 0x307c, 0x307d, 0x307e, 0x307f, 0x3080, + 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, + 0x3089, 0x308a, 0x308b, 0x308c, 0x308d, 0x308e, 0x308f, 0x3090, + 0x3091, 0x3092, 0x3093, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + /* 0x25 */ + 0x30a1, 0x30a2, 0x30a3, 0x30a4, 0x30a5, 0x30a6, 0x30a7, 0x30a8, + 0x30a9, 0x30aa, 0x30ab, 0x30ac, 0x30ad, 0x30ae, 0x30af, 0x30b0, + 0x30b1, 0x30b2, 0x30b3, 0x30b4, 0x30b5, 0x30b6, 0x30b7, 0x30b8, + 0x30b9, 0x30ba, 0x30bb, 0x30bc, 0x30bd, 0x30be, 0x30bf, 0x30c0, + 0x30c1, 0x30c2, 0x30c3, 0x30c4, 0x30c5, 0x30c6, 0x30c7, 0x30c8, + 0x30c9, 0x30ca, 0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf, 0x30d0, + 0x30d1, 0x30d2, 0x30d3, 0x30d4, 0x30d5, 0x30d6, 0x30d7, 0x30d8, + 0x30d9, 0x30da, 0x30db, 0x30dc, 0x30dd, 0x30de, 0x30df, 0x30e0, + 0x30e1, 0x30e2, 0x30e3, 0x30e4, 0x30e5, 0x30e6, 0x30e7, 0x30e8, + 0x30e9, 0x30ea, 0x30eb, 0x30ec, 0x30ed, 0x30ee, 0x30ef, 0x30f0, + 0x30f1, 0x30f2, 0x30f3, 0x30f4, 0x30f5, 0x30f6, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + /* 0x26 */ + 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, + 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, + 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8, + 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, + 0x03c1, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + /* 0x27 */ + 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0401, 0x0416, + 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, + 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, + 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, + 0x042f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0451, 0x0436, + 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, + 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, + 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, + 0x044f, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + /* 0x28 */ + 0x0101, 0x00e1, 0x01ce, 0x00e0, 0x0113, 0x00e9, 0x011b, 0x00e8, + 0x012b, 0x00ed, 0x01d0, 0x00ec, 0x014d, 0x00f3, 0x01d2, 0x00f2, + 0x016b, 0x00fa, 0x01d4, 0x00f9, 0x01d6, 0x01d8, 0x01da, 0x01dc, + 0x00fc, 0x00ea, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x3105, 0x3106, 0x3107, 0x3108, + 0x3109, 0x310a, 0x310b, 0x310c, 0x310d, 0x310e, 0x310f, 0x3110, + 0x3111, 0x3112, 0x3113, 0x3114, 0x3115, 0x3116, 0x3117, 0x3118, + 0x3119, 0x311a, 0x311b, 0x311c, 0x311d, 0x311e, 0x311f, 0x3120, + 0x3121, 0x3122, 0x3123, 0x3124, 0x3125, 0x3126, 0x3127, 0x3128, + 0x3129, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + /* 0x29 */ + 0xfffd, 0xfffd, 0xfffd, 0x2500, 0x2501, 0x2502, 0x2503, 0x2504, + 0x2505, 0x2506, 0x2507, 0x2508, 0x2509, 0x250a, 0x250b, 0x250c, + 0x250d, 0x250e, 0x250f, 0x2510, 0x2511, 0x2512, 0x2513, 0x2514, + 0x2515, 0x2516, 0x2517, 0x2518, 0x2519, 0x251a, 0x251b, 0x251c, + 0x251d, 0x251e, 0x251f, 0x2520, 0x2521, 0x2522, 0x2523, 0x2524, + 0x2525, 0x2526, 0x2527, 0x2528, 0x2529, 0x252a, 0x252b, 0x252c, + 0x252d, 0x252e, 0x252f, 0x2530, 0x2531, 0x2532, 0x2533, 0x2534, + 0x2535, 0x2536, 0x2537, 0x2538, 0x2539, 0x253a, 0x253b, 0x253c, + 0x253d, 0x253e, 0x253f, 0x2540, 0x2541, 0x2542, 0x2543, 0x2544, + 0x2545, 0x2546, 0x2547, 0x2548, 0x2549, 0x254a, 0x254b, +}; +static const u16 gb2312_2uni_page30[6768] = { + /* 0x30 */ + 0x554a, 0x963f, 0x57c3, 0x6328, 0x54ce, 0x5509, 0x54c0, 0x7691, + 0x764c, 0x853c, 0x77ee, 0x827e, 0x788d, 0x7231, 0x9698, 0x978d, + 0x6c28, 0x5b89, 0x4ffa, 0x6309, 0x6697, 0x5cb8, 0x80fa, 0x6848, + 0x80ae, 0x6602, 0x76ce, 0x51f9, 0x6556, 0x71ac, 0x7ff1, 0x8884, + 0x50b2, 0x5965, 0x61ca, 0x6fb3, 0x82ad, 0x634c, 0x6252, 0x53ed, + 0x5427, 0x7b06, 0x516b, 0x75a4, 0x5df4, 0x62d4, 0x8dcb, 0x9776, + 0x628a, 0x8019, 0x575d, 0x9738, 0x7f62, 0x7238, 0x767d, 0x67cf, + 0x767e, 0x6446, 0x4f70, 0x8d25, 0x62dc, 0x7a17, 0x6591, 0x73ed, + 0x642c, 0x6273, 0x822c, 0x9881, 0x677f, 0x7248, 0x626e, 0x62cc, + 0x4f34, 0x74e3, 0x534a, 0x529e, 0x7eca, 0x90a6, 0x5e2e, 0x6886, + 0x699c, 0x8180, 0x7ed1, 0x68d2, 0x78c5, 0x868c, 0x9551, 0x508d, + 0x8c24, 0x82de, 0x80de, 0x5305, 0x8912, 0x5265, + /* 0x31 */ + 0x8584, 0x96f9, 0x4fdd, 0x5821, 0x9971, 0x5b9d, 0x62b1, 0x62a5, + 0x66b4, 0x8c79, 0x9c8d, 0x7206, 0x676f, 0x7891, 0x60b2, 0x5351, + 0x5317, 0x8f88, 0x80cc, 0x8d1d, 0x94a1, 0x500d, 0x72c8, 0x5907, + 0x60eb, 0x7119, 0x88ab, 0x5954, 0x82ef, 0x672c, 0x7b28, 0x5d29, + 0x7ef7, 0x752d, 0x6cf5, 0x8e66, 0x8ff8, 0x903c, 0x9f3b, 0x6bd4, + 0x9119, 0x7b14, 0x5f7c, 0x78a7, 0x84d6, 0x853d, 0x6bd5, 0x6bd9, + 0x6bd6, 0x5e01, 0x5e87, 0x75f9, 0x95ed, 0x655d, 0x5f0a, 0x5fc5, + 0x8f9f, 0x58c1, 0x81c2, 0x907f, 0x965b, 0x97ad, 0x8fb9, 0x7f16, + 0x8d2c, 0x6241, 0x4fbf, 0x53d8, 0x535e, 0x8fa8, 0x8fa9, 0x8fab, + 0x904d, 0x6807, 0x5f6a, 0x8198, 0x8868, 0x9cd6, 0x618b, 0x522b, + 0x762a, 0x5f6c, 0x658c, 0x6fd2, 0x6ee8, 0x5bbe, 0x6448, 0x5175, + 0x51b0, 0x67c4, 0x4e19, 0x79c9, 0x997c, 0x70b3, + /* 0x32 */ + 0x75c5, 0x5e76, 0x73bb, 0x83e0, 0x64ad, 0x62e8, 0x94b5, 0x6ce2, + 0x535a, 0x52c3, 0x640f, 0x94c2, 0x7b94, 0x4f2f, 0x5e1b, 0x8236, + 0x8116, 0x818a, 0x6e24, 0x6cca, 0x9a73, 0x6355, 0x535c, 0x54fa, + 0x8865, 0x57e0, 0x4e0d, 0x5e03, 0x6b65, 0x7c3f, 0x90e8, 0x6016, + 0x64e6, 0x731c, 0x88c1, 0x6750, 0x624d, 0x8d22, 0x776c, 0x8e29, + 0x91c7, 0x5f69, 0x83dc, 0x8521, 0x9910, 0x53c2, 0x8695, 0x6b8b, + 0x60ed, 0x60e8, 0x707f, 0x82cd, 0x8231, 0x4ed3, 0x6ca7, 0x85cf, + 0x64cd, 0x7cd9, 0x69fd, 0x66f9, 0x8349, 0x5395, 0x7b56, 0x4fa7, + 0x518c, 0x6d4b, 0x5c42, 0x8e6d, 0x63d2, 0x53c9, 0x832c, 0x8336, + 0x67e5, 0x78b4, 0x643d, 0x5bdf, 0x5c94, 0x5dee, 0x8be7, 0x62c6, + 0x67f4, 0x8c7a, 0x6400, 0x63ba, 0x8749, 0x998b, 0x8c17, 0x7f20, + 0x94f2, 0x4ea7, 0x9610, 0x98a4, 0x660c, 0x7316, + /* 0x33 */ + 0x573a, 0x5c1d, 0x5e38, 0x957f, 0x507f, 0x80a0, 0x5382, 0x655e, + 0x7545, 0x5531, 0x5021, 0x8d85, 0x6284, 0x949e, 0x671d, 0x5632, + 0x6f6e, 0x5de2, 0x5435, 0x7092, 0x8f66, 0x626f, 0x64a4, 0x63a3, + 0x5f7b, 0x6f88, 0x90f4, 0x81e3, 0x8fb0, 0x5c18, 0x6668, 0x5ff1, + 0x6c89, 0x9648, 0x8d81, 0x886c, 0x6491, 0x79f0, 0x57ce, 0x6a59, + 0x6210, 0x5448, 0x4e58, 0x7a0b, 0x60e9, 0x6f84, 0x8bda, 0x627f, + 0x901e, 0x9a8b, 0x79e4, 0x5403, 0x75f4, 0x6301, 0x5319, 0x6c60, + 0x8fdf, 0x5f1b, 0x9a70, 0x803b, 0x9f7f, 0x4f88, 0x5c3a, 0x8d64, + 0x7fc5, 0x65a5, 0x70bd, 0x5145, 0x51b2, 0x866b, 0x5d07, 0x5ba0, + 0x62bd, 0x916c, 0x7574, 0x8e0c, 0x7a20, 0x6101, 0x7b79, 0x4ec7, + 0x7ef8, 0x7785, 0x4e11, 0x81ed, 0x521d, 0x51fa, 0x6a71, 0x53a8, + 0x8e87, 0x9504, 0x96cf, 0x6ec1, 0x9664, 0x695a, + /* 0x34 */ + 0x7840, 0x50a8, 0x77d7, 0x6410, 0x89e6, 0x5904, 0x63e3, 0x5ddd, + 0x7a7f, 0x693d, 0x4f20, 0x8239, 0x5598, 0x4e32, 0x75ae, 0x7a97, + 0x5e62, 0x5e8a, 0x95ef, 0x521b, 0x5439, 0x708a, 0x6376, 0x9524, + 0x5782, 0x6625, 0x693f, 0x9187, 0x5507, 0x6df3, 0x7eaf, 0x8822, + 0x6233, 0x7ef0, 0x75b5, 0x8328, 0x78c1, 0x96cc, 0x8f9e, 0x6148, + 0x74f7, 0x8bcd, 0x6b64, 0x523a, 0x8d50, 0x6b21, 0x806a, 0x8471, + 0x56f1, 0x5306, 0x4ece, 0x4e1b, 0x51d1, 0x7c97, 0x918b, 0x7c07, + 0x4fc3, 0x8e7f, 0x7be1, 0x7a9c, 0x6467, 0x5d14, 0x50ac, 0x8106, + 0x7601, 0x7cb9, 0x6dec, 0x7fe0, 0x6751, 0x5b58, 0x5bf8, 0x78cb, + 0x64ae, 0x6413, 0x63aa, 0x632b, 0x9519, 0x642d, 0x8fbe, 0x7b54, + 0x7629, 0x6253, 0x5927, 0x5446, 0x6b79, 0x50a3, 0x6234, 0x5e26, + 0x6b86, 0x4ee3, 0x8d37, 0x888b, 0x5f85, 0x902e, + /* 0x35 */ + 0x6020, 0x803d, 0x62c5, 0x4e39, 0x5355, 0x90f8, 0x63b8, 0x80c6, + 0x65e6, 0x6c2e, 0x4f46, 0x60ee, 0x6de1, 0x8bde, 0x5f39, 0x86cb, + 0x5f53, 0x6321, 0x515a, 0x8361, 0x6863, 0x5200, 0x6363, 0x8e48, + 0x5012, 0x5c9b, 0x7977, 0x5bfc, 0x5230, 0x7a3b, 0x60bc, 0x9053, + 0x76d7, 0x5fb7, 0x5f97, 0x7684, 0x8e6c, 0x706f, 0x767b, 0x7b49, + 0x77aa, 0x51f3, 0x9093, 0x5824, 0x4f4e, 0x6ef4, 0x8fea, 0x654c, + 0x7b1b, 0x72c4, 0x6da4, 0x7fdf, 0x5ae1, 0x62b5, 0x5e95, 0x5730, + 0x8482, 0x7b2c, 0x5e1d, 0x5f1f, 0x9012, 0x7f14, 0x98a0, 0x6382, + 0x6ec7, 0x7898, 0x70b9, 0x5178, 0x975b, 0x57ab, 0x7535, 0x4f43, + 0x7538, 0x5e97, 0x60e6, 0x5960, 0x6dc0, 0x6bbf, 0x7889, 0x53fc, + 0x96d5, 0x51cb, 0x5201, 0x6389, 0x540a, 0x9493, 0x8c03, 0x8dcc, + 0x7239, 0x789f, 0x8776, 0x8fed, 0x8c0d, 0x53e0, + /* 0x36 */ + 0x4e01, 0x76ef, 0x53ee, 0x9489, 0x9876, 0x9f0e, 0x952d, 0x5b9a, + 0x8ba2, 0x4e22, 0x4e1c, 0x51ac, 0x8463, 0x61c2, 0x52a8, 0x680b, + 0x4f97, 0x606b, 0x51bb, 0x6d1e, 0x515c, 0x6296, 0x6597, 0x9661, + 0x8c46, 0x9017, 0x75d8, 0x90fd, 0x7763, 0x6bd2, 0x728a, 0x72ec, + 0x8bfb, 0x5835, 0x7779, 0x8d4c, 0x675c, 0x9540, 0x809a, 0x5ea6, + 0x6e21, 0x5992, 0x7aef, 0x77ed, 0x953b, 0x6bb5, 0x65ad, 0x7f0e, + 0x5806, 0x5151, 0x961f, 0x5bf9, 0x58a9, 0x5428, 0x8e72, 0x6566, + 0x987f, 0x56e4, 0x949d, 0x76fe, 0x9041, 0x6387, 0x54c6, 0x591a, + 0x593a, 0x579b, 0x8eb2, 0x6735, 0x8dfa, 0x8235, 0x5241, 0x60f0, + 0x5815, 0x86fe, 0x5ce8, 0x9e45, 0x4fc4, 0x989d, 0x8bb9, 0x5a25, + 0x6076, 0x5384, 0x627c, 0x904f, 0x9102, 0x997f, 0x6069, 0x800c, + 0x513f, 0x8033, 0x5c14, 0x9975, 0x6d31, 0x4e8c, + /* 0x37 */ + 0x8d30, 0x53d1, 0x7f5a, 0x7b4f, 0x4f10, 0x4e4f, 0x9600, 0x6cd5, + 0x73d0, 0x85e9, 0x5e06, 0x756a, 0x7ffb, 0x6a0a, 0x77fe, 0x9492, + 0x7e41, 0x51e1, 0x70e6, 0x53cd, 0x8fd4, 0x8303, 0x8d29, 0x72af, + 0x996d, 0x6cdb, 0x574a, 0x82b3, 0x65b9, 0x80aa, 0x623f, 0x9632, + 0x59a8, 0x4eff, 0x8bbf, 0x7eba, 0x653e, 0x83f2, 0x975e, 0x5561, + 0x98de, 0x80a5, 0x532a, 0x8bfd, 0x5420, 0x80ba, 0x5e9f, 0x6cb8, + 0x8d39, 0x82ac, 0x915a, 0x5429, 0x6c1b, 0x5206, 0x7eb7, 0x575f, + 0x711a, 0x6c7e, 0x7c89, 0x594b, 0x4efd, 0x5fff, 0x6124, 0x7caa, + 0x4e30, 0x5c01, 0x67ab, 0x8702, 0x5cf0, 0x950b, 0x98ce, 0x75af, + 0x70fd, 0x9022, 0x51af, 0x7f1d, 0x8bbd, 0x5949, 0x51e4, 0x4f5b, + 0x5426, 0x592b, 0x6577, 0x80a4, 0x5b75, 0x6276, 0x62c2, 0x8f90, + 0x5e45, 0x6c1f, 0x7b26, 0x4f0f, 0x4fd8, 0x670d, + /* 0x38 */ + 0x6d6e, 0x6daa, 0x798f, 0x88b1, 0x5f17, 0x752b, 0x629a, 0x8f85, + 0x4fef, 0x91dc, 0x65a7, 0x812f, 0x8151, 0x5e9c, 0x8150, 0x8d74, + 0x526f, 0x8986, 0x8d4b, 0x590d, 0x5085, 0x4ed8, 0x961c, 0x7236, + 0x8179, 0x8d1f, 0x5bcc, 0x8ba3, 0x9644, 0x5987, 0x7f1a, 0x5490, + 0x5676, 0x560e, 0x8be5, 0x6539, 0x6982, 0x9499, 0x76d6, 0x6e89, + 0x5e72, 0x7518, 0x6746, 0x67d1, 0x7aff, 0x809d, 0x8d76, 0x611f, + 0x79c6, 0x6562, 0x8d63, 0x5188, 0x521a, 0x94a2, 0x7f38, 0x809b, + 0x7eb2, 0x5c97, 0x6e2f, 0x6760, 0x7bd9, 0x768b, 0x9ad8, 0x818f, + 0x7f94, 0x7cd5, 0x641e, 0x9550, 0x7a3f, 0x544a, 0x54e5, 0x6b4c, + 0x6401, 0x6208, 0x9e3d, 0x80f3, 0x7599, 0x5272, 0x9769, 0x845b, + 0x683c, 0x86e4, 0x9601, 0x9694, 0x94ec, 0x4e2a, 0x5404, 0x7ed9, + 0x6839, 0x8ddf, 0x8015, 0x66f4, 0x5e9a, 0x7fb9, + /* 0x39 */ + 0x57c2, 0x803f, 0x6897, 0x5de5, 0x653b, 0x529f, 0x606d, 0x9f9a, + 0x4f9b, 0x8eac, 0x516c, 0x5bab, 0x5f13, 0x5de9, 0x6c5e, 0x62f1, + 0x8d21, 0x5171, 0x94a9, 0x52fe, 0x6c9f, 0x82df, 0x72d7, 0x57a2, + 0x6784, 0x8d2d, 0x591f, 0x8f9c, 0x83c7, 0x5495, 0x7b8d, 0x4f30, + 0x6cbd, 0x5b64, 0x59d1, 0x9f13, 0x53e4, 0x86ca, 0x9aa8, 0x8c37, + 0x80a1, 0x6545, 0x987e, 0x56fa, 0x96c7, 0x522e, 0x74dc, 0x5250, + 0x5be1, 0x6302, 0x8902, 0x4e56, 0x62d0, 0x602a, 0x68fa, 0x5173, + 0x5b98, 0x51a0, 0x89c2, 0x7ba1, 0x9986, 0x7f50, 0x60ef, 0x704c, + 0x8d2f, 0x5149, 0x5e7f, 0x901b, 0x7470, 0x89c4, 0x572d, 0x7845, + 0x5f52, 0x9f9f, 0x95fa, 0x8f68, 0x9b3c, 0x8be1, 0x7678, 0x6842, + 0x67dc, 0x8dea, 0x8d35, 0x523d, 0x8f8a, 0x6eda, 0x68cd, 0x9505, + 0x90ed, 0x56fd, 0x679c, 0x88f9, 0x8fc7, 0x54c8, + /* 0x3a */ + 0x9ab8, 0x5b69, 0x6d77, 0x6c26, 0x4ea5, 0x5bb3, 0x9a87, 0x9163, + 0x61a8, 0x90af, 0x97e9, 0x542b, 0x6db5, 0x5bd2, 0x51fd, 0x558a, + 0x7f55, 0x7ff0, 0x64bc, 0x634d, 0x65f1, 0x61be, 0x608d, 0x710a, + 0x6c57, 0x6c49, 0x592f, 0x676d, 0x822a, 0x58d5, 0x568e, 0x8c6a, + 0x6beb, 0x90dd, 0x597d, 0x8017, 0x53f7, 0x6d69, 0x5475, 0x559d, + 0x8377, 0x83cf, 0x6838, 0x79be, 0x548c, 0x4f55, 0x5408, 0x76d2, + 0x8c89, 0x9602, 0x6cb3, 0x6db8, 0x8d6b, 0x8910, 0x9e64, 0x8d3a, + 0x563f, 0x9ed1, 0x75d5, 0x5f88, 0x72e0, 0x6068, 0x54fc, 0x4ea8, + 0x6a2a, 0x8861, 0x6052, 0x8f70, 0x54c4, 0x70d8, 0x8679, 0x9e3f, + 0x6d2a, 0x5b8f, 0x5f18, 0x7ea2, 0x5589, 0x4faf, 0x7334, 0x543c, + 0x539a, 0x5019, 0x540e, 0x547c, 0x4e4e, 0x5ffd, 0x745a, 0x58f6, + 0x846b, 0x80e1, 0x8774, 0x72d0, 0x7cca, 0x6e56, + /* 0x3b */ + 0x5f27, 0x864e, 0x552c, 0x62a4, 0x4e92, 0x6caa, 0x6237, 0x82b1, + 0x54d7, 0x534e, 0x733e, 0x6ed1, 0x753b, 0x5212, 0x5316, 0x8bdd, + 0x69d0, 0x5f8a, 0x6000, 0x6dee, 0x574f, 0x6b22, 0x73af, 0x6853, + 0x8fd8, 0x7f13, 0x6362, 0x60a3, 0x5524, 0x75ea, 0x8c62, 0x7115, + 0x6da3, 0x5ba6, 0x5e7b, 0x8352, 0x614c, 0x9ec4, 0x78fa, 0x8757, + 0x7c27, 0x7687, 0x51f0, 0x60f6, 0x714c, 0x6643, 0x5e4c, 0x604d, + 0x8c0e, 0x7070, 0x6325, 0x8f89, 0x5fbd, 0x6062, 0x86d4, 0x56de, + 0x6bc1, 0x6094, 0x6167, 0x5349, 0x60e0, 0x6666, 0x8d3f, 0x79fd, + 0x4f1a, 0x70e9, 0x6c47, 0x8bb3, 0x8bf2, 0x7ed8, 0x8364, 0x660f, + 0x5a5a, 0x9b42, 0x6d51, 0x6df7, 0x8c41, 0x6d3b, 0x4f19, 0x706b, + 0x83b7, 0x6216, 0x60d1, 0x970d, 0x8d27, 0x7978, 0x51fb, 0x573e, + 0x57fa, 0x673a, 0x7578, 0x7a3d, 0x79ef, 0x7b95, + /* 0x3c */ + 0x808c, 0x9965, 0x8ff9, 0x6fc0, 0x8ba5, 0x9e21, 0x59ec, 0x7ee9, + 0x7f09, 0x5409, 0x6781, 0x68d8, 0x8f91, 0x7c4d, 0x96c6, 0x53ca, + 0x6025, 0x75be, 0x6c72, 0x5373, 0x5ac9, 0x7ea7, 0x6324, 0x51e0, + 0x810a, 0x5df1, 0x84df, 0x6280, 0x5180, 0x5b63, 0x4f0e, 0x796d, + 0x5242, 0x60b8, 0x6d4e, 0x5bc4, 0x5bc2, 0x8ba1, 0x8bb0, 0x65e2, + 0x5fcc, 0x9645, 0x5993, 0x7ee7, 0x7eaa, 0x5609, 0x67b7, 0x5939, + 0x4f73, 0x5bb6, 0x52a0, 0x835a, 0x988a, 0x8d3e, 0x7532, 0x94be, + 0x5047, 0x7a3c, 0x4ef7, 0x67b6, 0x9a7e, 0x5ac1, 0x6b7c, 0x76d1, + 0x575a, 0x5c16, 0x7b3a, 0x95f4, 0x714e, 0x517c, 0x80a9, 0x8270, + 0x5978, 0x7f04, 0x8327, 0x68c0, 0x67ec, 0x78b1, 0x7877, 0x62e3, + 0x6361, 0x7b80, 0x4fed, 0x526a, 0x51cf, 0x8350, 0x69db, 0x9274, + 0x8df5, 0x8d31, 0x89c1, 0x952e, 0x7bad, 0x4ef6, + /* 0x3d */ + 0x5065, 0x8230, 0x5251, 0x996f, 0x6e10, 0x6e85, 0x6da7, 0x5efa, + 0x50f5, 0x59dc, 0x5c06, 0x6d46, 0x6c5f, 0x7586, 0x848b, 0x6868, + 0x5956, 0x8bb2, 0x5320, 0x9171, 0x964d, 0x8549, 0x6912, 0x7901, + 0x7126, 0x80f6, 0x4ea4, 0x90ca, 0x6d47, 0x9a84, 0x5a07, 0x56bc, + 0x6405, 0x94f0, 0x77eb, 0x4fa5, 0x811a, 0x72e1, 0x89d2, 0x997a, + 0x7f34, 0x7ede, 0x527f, 0x6559, 0x9175, 0x8f7f, 0x8f83, 0x53eb, + 0x7a96, 0x63ed, 0x63a5, 0x7686, 0x79f8, 0x8857, 0x9636, 0x622a, + 0x52ab, 0x8282, 0x6854, 0x6770, 0x6377, 0x776b, 0x7aed, 0x6d01, + 0x7ed3, 0x89e3, 0x59d0, 0x6212, 0x85c9, 0x82a5, 0x754c, 0x501f, + 0x4ecb, 0x75a5, 0x8beb, 0x5c4a, 0x5dfe, 0x7b4b, 0x65a4, 0x91d1, + 0x4eca, 0x6d25, 0x895f, 0x7d27, 0x9526, 0x4ec5, 0x8c28, 0x8fdb, + 0x9773, 0x664b, 0x7981, 0x8fd1, 0x70ec, 0x6d78, + /* 0x3e */ + 0x5c3d, 0x52b2, 0x8346, 0x5162, 0x830e, 0x775b, 0x6676, 0x9cb8, + 0x4eac, 0x60ca, 0x7cbe, 0x7cb3, 0x7ecf, 0x4e95, 0x8b66, 0x666f, + 0x9888, 0x9759, 0x5883, 0x656c, 0x955c, 0x5f84, 0x75c9, 0x9756, + 0x7adf, 0x7ade, 0x51c0, 0x70af, 0x7a98, 0x63ea, 0x7a76, 0x7ea0, + 0x7396, 0x97ed, 0x4e45, 0x7078, 0x4e5d, 0x9152, 0x53a9, 0x6551, + 0x65e7, 0x81fc, 0x8205, 0x548e, 0x5c31, 0x759a, 0x97a0, 0x62d8, + 0x72d9, 0x75bd, 0x5c45, 0x9a79, 0x83ca, 0x5c40, 0x5480, 0x77e9, + 0x4e3e, 0x6cae, 0x805a, 0x62d2, 0x636e, 0x5de8, 0x5177, 0x8ddd, + 0x8e1e, 0x952f, 0x4ff1, 0x53e5, 0x60e7, 0x70ac, 0x5267, 0x6350, + 0x9e43, 0x5a1f, 0x5026, 0x7737, 0x5377, 0x7ee2, 0x6485, 0x652b, + 0x6289, 0x6398, 0x5014, 0x7235, 0x89c9, 0x51b3, 0x8bc0, 0x7edd, + 0x5747, 0x83cc, 0x94a7, 0x519b, 0x541b, 0x5cfb, + /* 0x3f */ + 0x4fca, 0x7ae3, 0x6d5a, 0x90e1, 0x9a8f, 0x5580, 0x5496, 0x5361, + 0x54af, 0x5f00, 0x63e9, 0x6977, 0x51ef, 0x6168, 0x520a, 0x582a, + 0x52d8, 0x574e, 0x780d, 0x770b, 0x5eb7, 0x6177, 0x7ce0, 0x625b, + 0x6297, 0x4ea2, 0x7095, 0x8003, 0x62f7, 0x70e4, 0x9760, 0x5777, + 0x82db, 0x67ef, 0x68f5, 0x78d5, 0x9897, 0x79d1, 0x58f3, 0x54b3, + 0x53ef, 0x6e34, 0x514b, 0x523b, 0x5ba2, 0x8bfe, 0x80af, 0x5543, + 0x57a6, 0x6073, 0x5751, 0x542d, 0x7a7a, 0x6050, 0x5b54, 0x63a7, + 0x62a0, 0x53e3, 0x6263, 0x5bc7, 0x67af, 0x54ed, 0x7a9f, 0x82e6, + 0x9177, 0x5e93, 0x88e4, 0x5938, 0x57ae, 0x630e, 0x8de8, 0x80ef, + 0x5757, 0x7b77, 0x4fa9, 0x5feb, 0x5bbd, 0x6b3e, 0x5321, 0x7b50, + 0x72c2, 0x6846, 0x77ff, 0x7736, 0x65f7, 0x51b5, 0x4e8f, 0x76d4, + 0x5cbf, 0x7aa5, 0x8475, 0x594e, 0x9b41, 0x5080, + /* 0x40 */ + 0x9988, 0x6127, 0x6e83, 0x5764, 0x6606, 0x6346, 0x56f0, 0x62ec, + 0x6269, 0x5ed3, 0x9614, 0x5783, 0x62c9, 0x5587, 0x8721, 0x814a, + 0x8fa3, 0x5566, 0x83b1, 0x6765, 0x8d56, 0x84dd, 0x5a6a, 0x680f, + 0x62e6, 0x7bee, 0x9611, 0x5170, 0x6f9c, 0x8c30, 0x63fd, 0x89c8, + 0x61d2, 0x7f06, 0x70c2, 0x6ee5, 0x7405, 0x6994, 0x72fc, 0x5eca, + 0x90ce, 0x6717, 0x6d6a, 0x635e, 0x52b3, 0x7262, 0x8001, 0x4f6c, + 0x59e5, 0x916a, 0x70d9, 0x6d9d, 0x52d2, 0x4e50, 0x96f7, 0x956d, + 0x857e, 0x78ca, 0x7d2f, 0x5121, 0x5792, 0x64c2, 0x808b, 0x7c7b, + 0x6cea, 0x68f1, 0x695e, 0x51b7, 0x5398, 0x68a8, 0x7281, 0x9ece, + 0x7bf1, 0x72f8, 0x79bb, 0x6f13, 0x7406, 0x674e, 0x91cc, 0x9ca4, + 0x793c, 0x8389, 0x8354, 0x540f, 0x6817, 0x4e3d, 0x5389, 0x52b1, + 0x783e, 0x5386, 0x5229, 0x5088, 0x4f8b, 0x4fd0, + /* 0x41 */ + 0x75e2, 0x7acb, 0x7c92, 0x6ca5, 0x96b6, 0x529b, 0x7483, 0x54e9, + 0x4fe9, 0x8054, 0x83b2, 0x8fde, 0x9570, 0x5ec9, 0x601c, 0x6d9f, + 0x5e18, 0x655b, 0x8138, 0x94fe, 0x604b, 0x70bc, 0x7ec3, 0x7cae, + 0x51c9, 0x6881, 0x7cb1, 0x826f, 0x4e24, 0x8f86, 0x91cf, 0x667e, + 0x4eae, 0x8c05, 0x64a9, 0x804a, 0x50da, 0x7597, 0x71ce, 0x5be5, + 0x8fbd, 0x6f66, 0x4e86, 0x6482, 0x9563, 0x5ed6, 0x6599, 0x5217, + 0x88c2, 0x70c8, 0x52a3, 0x730e, 0x7433, 0x6797, 0x78f7, 0x9716, + 0x4e34, 0x90bb, 0x9cde, 0x6dcb, 0x51db, 0x8d41, 0x541d, 0x62ce, + 0x73b2, 0x83f1, 0x96f6, 0x9f84, 0x94c3, 0x4f36, 0x7f9a, 0x51cc, + 0x7075, 0x9675, 0x5cad, 0x9886, 0x53e6, 0x4ee4, 0x6e9c, 0x7409, + 0x69b4, 0x786b, 0x998f, 0x7559, 0x5218, 0x7624, 0x6d41, 0x67f3, + 0x516d, 0x9f99, 0x804b, 0x5499, 0x7b3c, 0x7abf, + /* 0x42 */ + 0x9686, 0x5784, 0x62e2, 0x9647, 0x697c, 0x5a04, 0x6402, 0x7bd3, + 0x6f0f, 0x964b, 0x82a6, 0x5362, 0x9885, 0x5e90, 0x7089, 0x63b3, + 0x5364, 0x864f, 0x9c81, 0x9e93, 0x788c, 0x9732, 0x8def, 0x8d42, + 0x9e7f, 0x6f5e, 0x7984, 0x5f55, 0x9646, 0x622e, 0x9a74, 0x5415, + 0x94dd, 0x4fa3, 0x65c5, 0x5c65, 0x5c61, 0x7f15, 0x8651, 0x6c2f, + 0x5f8b, 0x7387, 0x6ee4, 0x7eff, 0x5ce6, 0x631b, 0x5b6a, 0x6ee6, + 0x5375, 0x4e71, 0x63a0, 0x7565, 0x62a1, 0x8f6e, 0x4f26, 0x4ed1, + 0x6ca6, 0x7eb6, 0x8bba, 0x841d, 0x87ba, 0x7f57, 0x903b, 0x9523, + 0x7ba9, 0x9aa1, 0x88f8, 0x843d, 0x6d1b, 0x9a86, 0x7edc, 0x5988, + 0x9ebb, 0x739b, 0x7801, 0x8682, 0x9a6c, 0x9a82, 0x561b, 0x5417, + 0x57cb, 0x4e70, 0x9ea6, 0x5356, 0x8fc8, 0x8109, 0x7792, 0x9992, + 0x86ee, 0x6ee1, 0x8513, 0x66fc, 0x6162, 0x6f2b, + /* 0x43 */ + 0x8c29, 0x8292, 0x832b, 0x76f2, 0x6c13, 0x5fd9, 0x83bd, 0x732b, + 0x8305, 0x951a, 0x6bdb, 0x77db, 0x94c6, 0x536f, 0x8302, 0x5192, + 0x5e3d, 0x8c8c, 0x8d38, 0x4e48, 0x73ab, 0x679a, 0x6885, 0x9176, + 0x9709, 0x7164, 0x6ca1, 0x7709, 0x5a92, 0x9541, 0x6bcf, 0x7f8e, + 0x6627, 0x5bd0, 0x59b9, 0x5a9a, 0x95e8, 0x95f7, 0x4eec, 0x840c, + 0x8499, 0x6aac, 0x76df, 0x9530, 0x731b, 0x68a6, 0x5b5f, 0x772f, + 0x919a, 0x9761, 0x7cdc, 0x8ff7, 0x8c1c, 0x5f25, 0x7c73, 0x79d8, + 0x89c5, 0x6ccc, 0x871c, 0x5bc6, 0x5e42, 0x68c9, 0x7720, 0x7ef5, + 0x5195, 0x514d, 0x52c9, 0x5a29, 0x7f05, 0x9762, 0x82d7, 0x63cf, + 0x7784, 0x85d0, 0x79d2, 0x6e3a, 0x5e99, 0x5999, 0x8511, 0x706d, + 0x6c11, 0x62bf, 0x76bf, 0x654f, 0x60af, 0x95fd, 0x660e, 0x879f, + 0x9e23, 0x94ed, 0x540d, 0x547d, 0x8c2c, 0x6478, + /* 0x44 */ + 0x6479, 0x8611, 0x6a21, 0x819c, 0x78e8, 0x6469, 0x9b54, 0x62b9, + 0x672b, 0x83ab, 0x58a8, 0x9ed8, 0x6cab, 0x6f20, 0x5bde, 0x964c, + 0x8c0b, 0x725f, 0x67d0, 0x62c7, 0x7261, 0x4ea9, 0x59c6, 0x6bcd, + 0x5893, 0x66ae, 0x5e55, 0x52df, 0x6155, 0x6728, 0x76ee, 0x7766, + 0x7267, 0x7a46, 0x62ff, 0x54ea, 0x5450, 0x94a0, 0x90a3, 0x5a1c, + 0x7eb3, 0x6c16, 0x4e43, 0x5976, 0x8010, 0x5948, 0x5357, 0x7537, + 0x96be, 0x56ca, 0x6320, 0x8111, 0x607c, 0x95f9, 0x6dd6, 0x5462, + 0x9981, 0x5185, 0x5ae9, 0x80fd, 0x59ae, 0x9713, 0x502a, 0x6ce5, + 0x5c3c, 0x62df, 0x4f60, 0x533f, 0x817b, 0x9006, 0x6eba, 0x852b, + 0x62c8, 0x5e74, 0x78be, 0x64b5, 0x637b, 0x5ff5, 0x5a18, 0x917f, + 0x9e1f, 0x5c3f, 0x634f, 0x8042, 0x5b7d, 0x556e, 0x954a, 0x954d, + 0x6d85, 0x60a8, 0x67e0, 0x72de, 0x51dd, 0x5b81, + /* 0x45 */ + 0x62e7, 0x6cde, 0x725b, 0x626d, 0x94ae, 0x7ebd, 0x8113, 0x6d53, + 0x519c, 0x5f04, 0x5974, 0x52aa, 0x6012, 0x5973, 0x6696, 0x8650, + 0x759f, 0x632a, 0x61e6, 0x7cef, 0x8bfa, 0x54e6, 0x6b27, 0x9e25, + 0x6bb4, 0x85d5, 0x5455, 0x5076, 0x6ca4, 0x556a, 0x8db4, 0x722c, + 0x5e15, 0x6015, 0x7436, 0x62cd, 0x6392, 0x724c, 0x5f98, 0x6e43, + 0x6d3e, 0x6500, 0x6f58, 0x76d8, 0x78d0, 0x76fc, 0x7554, 0x5224, + 0x53db, 0x4e53, 0x5e9e, 0x65c1, 0x802a, 0x80d6, 0x629b, 0x5486, + 0x5228, 0x70ae, 0x888d, 0x8dd1, 0x6ce1, 0x5478, 0x80da, 0x57f9, + 0x88f4, 0x8d54, 0x966a, 0x914d, 0x4f69, 0x6c9b, 0x55b7, 0x76c6, + 0x7830, 0x62a8, 0x70f9, 0x6f8e, 0x5f6d, 0x84ec, 0x68da, 0x787c, + 0x7bf7, 0x81a8, 0x670b, 0x9e4f, 0x6367, 0x78b0, 0x576f, 0x7812, + 0x9739, 0x6279, 0x62ab, 0x5288, 0x7435, 0x6bd7, + /* 0x46 */ + 0x5564, 0x813e, 0x75b2, 0x76ae, 0x5339, 0x75de, 0x50fb, 0x5c41, + 0x8b6c, 0x7bc7, 0x504f, 0x7247, 0x9a97, 0x98d8, 0x6f02, 0x74e2, + 0x7968, 0x6487, 0x77a5, 0x62fc, 0x9891, 0x8d2b, 0x54c1, 0x8058, + 0x4e52, 0x576a, 0x82f9, 0x840d, 0x5e73, 0x51ed, 0x74f6, 0x8bc4, + 0x5c4f, 0x5761, 0x6cfc, 0x9887, 0x5a46, 0x7834, 0x9b44, 0x8feb, + 0x7c95, 0x5256, 0x6251, 0x94fa, 0x4ec6, 0x8386, 0x8461, 0x83e9, + 0x84b2, 0x57d4, 0x6734, 0x5703, 0x666e, 0x6d66, 0x8c31, 0x66dd, + 0x7011, 0x671f, 0x6b3a, 0x6816, 0x621a, 0x59bb, 0x4e03, 0x51c4, + 0x6f06, 0x67d2, 0x6c8f, 0x5176, 0x68cb, 0x5947, 0x6b67, 0x7566, + 0x5d0e, 0x8110, 0x9f50, 0x65d7, 0x7948, 0x7941, 0x9a91, 0x8d77, + 0x5c82, 0x4e5e, 0x4f01, 0x542f, 0x5951, 0x780c, 0x5668, 0x6c14, + 0x8fc4, 0x5f03, 0x6c7d, 0x6ce3, 0x8bab, 0x6390, + /* 0x47 */ + 0x6070, 0x6d3d, 0x7275, 0x6266, 0x948e, 0x94c5, 0x5343, 0x8fc1, + 0x7b7e, 0x4edf, 0x8c26, 0x4e7e, 0x9ed4, 0x94b1, 0x94b3, 0x524d, + 0x6f5c, 0x9063, 0x6d45, 0x8c34, 0x5811, 0x5d4c, 0x6b20, 0x6b49, + 0x67aa, 0x545b, 0x8154, 0x7f8c, 0x5899, 0x8537, 0x5f3a, 0x62a2, + 0x6a47, 0x9539, 0x6572, 0x6084, 0x6865, 0x77a7, 0x4e54, 0x4fa8, + 0x5de7, 0x9798, 0x64ac, 0x7fd8, 0x5ced, 0x4fcf, 0x7a8d, 0x5207, + 0x8304, 0x4e14, 0x602f, 0x7a83, 0x94a6, 0x4fb5, 0x4eb2, 0x79e6, + 0x7434, 0x52e4, 0x82b9, 0x64d2, 0x79bd, 0x5bdd, 0x6c81, 0x9752, + 0x8f7b, 0x6c22, 0x503e, 0x537f, 0x6e05, 0x64ce, 0x6674, 0x6c30, + 0x60c5, 0x9877, 0x8bf7, 0x5e86, 0x743c, 0x7a77, 0x79cb, 0x4e18, + 0x90b1, 0x7403, 0x6c42, 0x56da, 0x914b, 0x6cc5, 0x8d8b, 0x533a, + 0x86c6, 0x66f2, 0x8eaf, 0x5c48, 0x9a71, 0x6e20, + /* 0x48 */ + 0x53d6, 0x5a36, 0x9f8b, 0x8da3, 0x53bb, 0x5708, 0x98a7, 0x6743, + 0x919b, 0x6cc9, 0x5168, 0x75ca, 0x62f3, 0x72ac, 0x5238, 0x529d, + 0x7f3a, 0x7094, 0x7638, 0x5374, 0x9e4a, 0x69b7, 0x786e, 0x96c0, + 0x88d9, 0x7fa4, 0x7136, 0x71c3, 0x5189, 0x67d3, 0x74e4, 0x58e4, + 0x6518, 0x56b7, 0x8ba9, 0x9976, 0x6270, 0x7ed5, 0x60f9, 0x70ed, + 0x58ec, 0x4ec1, 0x4eba, 0x5fcd, 0x97e7, 0x4efb, 0x8ba4, 0x5203, + 0x598a, 0x7eab, 0x6254, 0x4ecd, 0x65e5, 0x620e, 0x8338, 0x84c9, + 0x8363, 0x878d, 0x7194, 0x6eb6, 0x5bb9, 0x7ed2, 0x5197, 0x63c9, + 0x67d4, 0x8089, 0x8339, 0x8815, 0x5112, 0x5b7a, 0x5982, 0x8fb1, + 0x4e73, 0x6c5d, 0x5165, 0x8925, 0x8f6f, 0x962e, 0x854a, 0x745e, + 0x9510, 0x95f0, 0x6da6, 0x82e5, 0x5f31, 0x6492, 0x6d12, 0x8428, + 0x816e, 0x9cc3, 0x585e, 0x8d5b, 0x4e09, 0x53c1, + /* 0x49 */ + 0x4f1e, 0x6563, 0x6851, 0x55d3, 0x4e27, 0x6414, 0x9a9a, 0x626b, + 0x5ac2, 0x745f, 0x8272, 0x6da9, 0x68ee, 0x50e7, 0x838e, 0x7802, + 0x6740, 0x5239, 0x6c99, 0x7eb1, 0x50bb, 0x5565, 0x715e, 0x7b5b, + 0x6652, 0x73ca, 0x82eb, 0x6749, 0x5c71, 0x5220, 0x717d, 0x886b, + 0x95ea, 0x9655, 0x64c5, 0x8d61, 0x81b3, 0x5584, 0x6c55, 0x6247, + 0x7f2e, 0x5892, 0x4f24, 0x5546, 0x8d4f, 0x664c, 0x4e0a, 0x5c1a, + 0x88f3, 0x68a2, 0x634e, 0x7a0d, 0x70e7, 0x828d, 0x52fa, 0x97f6, + 0x5c11, 0x54e8, 0x90b5, 0x7ecd, 0x5962, 0x8d4a, 0x86c7, 0x820c, + 0x820d, 0x8d66, 0x6444, 0x5c04, 0x6151, 0x6d89, 0x793e, 0x8bbe, + 0x7837, 0x7533, 0x547b, 0x4f38, 0x8eab, 0x6df1, 0x5a20, 0x7ec5, + 0x795e, 0x6c88, 0x5ba1, 0x5a76, 0x751a, 0x80be, 0x614e, 0x6e17, + 0x58f0, 0x751f, 0x7525, 0x7272, 0x5347, 0x7ef3, + /* 0x4a */ + 0x7701, 0x76db, 0x5269, 0x80dc, 0x5723, 0x5e08, 0x5931, 0x72ee, + 0x65bd, 0x6e7f, 0x8bd7, 0x5c38, 0x8671, 0x5341, 0x77f3, 0x62fe, + 0x65f6, 0x4ec0, 0x98df, 0x8680, 0x5b9e, 0x8bc6, 0x53f2, 0x77e2, + 0x4f7f, 0x5c4e, 0x9a76, 0x59cb, 0x5f0f, 0x793a, 0x58eb, 0x4e16, + 0x67ff, 0x4e8b, 0x62ed, 0x8a93, 0x901d, 0x52bf, 0x662f, 0x55dc, + 0x566c, 0x9002, 0x4ed5, 0x4f8d, 0x91ca, 0x9970, 0x6c0f, 0x5e02, + 0x6043, 0x5ba4, 0x89c6, 0x8bd5, 0x6536, 0x624b, 0x9996, 0x5b88, + 0x5bff, 0x6388, 0x552e, 0x53d7, 0x7626, 0x517d, 0x852c, 0x67a2, + 0x68b3, 0x6b8a, 0x6292, 0x8f93, 0x53d4, 0x8212, 0x6dd1, 0x758f, + 0x4e66, 0x8d4e, 0x5b70, 0x719f, 0x85af, 0x6691, 0x66d9, 0x7f72, + 0x8700, 0x9ecd, 0x9f20, 0x5c5e, 0x672f, 0x8ff0, 0x6811, 0x675f, + 0x620d, 0x7ad6, 0x5885, 0x5eb6, 0x6570, 0x6f31, + /* 0x4b */ + 0x6055, 0x5237, 0x800d, 0x6454, 0x8870, 0x7529, 0x5e05, 0x6813, + 0x62f4, 0x971c, 0x53cc, 0x723d, 0x8c01, 0x6c34, 0x7761, 0x7a0e, + 0x542e, 0x77ac, 0x987a, 0x821c, 0x8bf4, 0x7855, 0x6714, 0x70c1, + 0x65af, 0x6495, 0x5636, 0x601d, 0x79c1, 0x53f8, 0x4e1d, 0x6b7b, + 0x8086, 0x5bfa, 0x55e3, 0x56db, 0x4f3a, 0x4f3c, 0x9972, 0x5df3, + 0x677e, 0x8038, 0x6002, 0x9882, 0x9001, 0x5b8b, 0x8bbc, 0x8bf5, + 0x641c, 0x8258, 0x64de, 0x55fd, 0x82cf, 0x9165, 0x4fd7, 0x7d20, + 0x901f, 0x7c9f, 0x50f3, 0x5851, 0x6eaf, 0x5bbf, 0x8bc9, 0x8083, + 0x9178, 0x849c, 0x7b97, 0x867d, 0x968b, 0x968f, 0x7ee5, 0x9ad3, + 0x788e, 0x5c81, 0x7a57, 0x9042, 0x96a7, 0x795f, 0x5b59, 0x635f, + 0x7b0b, 0x84d1, 0x68ad, 0x5506, 0x7f29, 0x7410, 0x7d22, 0x9501, + 0x6240, 0x584c, 0x4ed6, 0x5b83, 0x5979, 0x5854, + /* 0x4c */ + 0x736d, 0x631e, 0x8e4b, 0x8e0f, 0x80ce, 0x82d4, 0x62ac, 0x53f0, + 0x6cf0, 0x915e, 0x592a, 0x6001, 0x6c70, 0x574d, 0x644a, 0x8d2a, + 0x762b, 0x6ee9, 0x575b, 0x6a80, 0x75f0, 0x6f6d, 0x8c2d, 0x8c08, + 0x5766, 0x6bef, 0x8892, 0x78b3, 0x63a2, 0x53f9, 0x70ad, 0x6c64, + 0x5858, 0x642a, 0x5802, 0x68e0, 0x819b, 0x5510, 0x7cd6, 0x5018, + 0x8eba, 0x6dcc, 0x8d9f, 0x70eb, 0x638f, 0x6d9b, 0x6ed4, 0x7ee6, + 0x8404, 0x6843, 0x9003, 0x6dd8, 0x9676, 0x8ba8, 0x5957, 0x7279, + 0x85e4, 0x817e, 0x75bc, 0x8a8a, 0x68af, 0x5254, 0x8e22, 0x9511, + 0x63d0, 0x9898, 0x8e44, 0x557c, 0x4f53, 0x66ff, 0x568f, 0x60d5, + 0x6d95, 0x5243, 0x5c49, 0x5929, 0x6dfb, 0x586b, 0x7530, 0x751c, + 0x606c, 0x8214, 0x8146, 0x6311, 0x6761, 0x8fe2, 0x773a, 0x8df3, + 0x8d34, 0x94c1, 0x5e16, 0x5385, 0x542c, 0x70c3, + /* 0x4d */ + 0x6c40, 0x5ef7, 0x505c, 0x4ead, 0x5ead, 0x633a, 0x8247, 0x901a, + 0x6850, 0x916e, 0x77b3, 0x540c, 0x94dc, 0x5f64, 0x7ae5, 0x6876, + 0x6345, 0x7b52, 0x7edf, 0x75db, 0x5077, 0x6295, 0x5934, 0x900f, + 0x51f8, 0x79c3, 0x7a81, 0x56fe, 0x5f92, 0x9014, 0x6d82, 0x5c60, + 0x571f, 0x5410, 0x5154, 0x6e4d, 0x56e2, 0x63a8, 0x9893, 0x817f, + 0x8715, 0x892a, 0x9000, 0x541e, 0x5c6f, 0x81c0, 0x62d6, 0x6258, + 0x8131, 0x9e35, 0x9640, 0x9a6e, 0x9a7c, 0x692d, 0x59a5, 0x62d3, + 0x553e, 0x6316, 0x54c7, 0x86d9, 0x6d3c, 0x5a03, 0x74e6, 0x889c, + 0x6b6a, 0x5916, 0x8c4c, 0x5f2f, 0x6e7e, 0x73a9, 0x987d, 0x4e38, + 0x70f7, 0x5b8c, 0x7897, 0x633d, 0x665a, 0x7696, 0x60cb, 0x5b9b, + 0x5a49, 0x4e07, 0x8155, 0x6c6a, 0x738b, 0x4ea1, 0x6789, 0x7f51, + 0x5f80, 0x65fa, 0x671b, 0x5fd8, 0x5984, 0x5a01, + /* 0x4e */ + 0x5dcd, 0x5fae, 0x5371, 0x97e6, 0x8fdd, 0x6845, 0x56f4, 0x552f, + 0x60df, 0x4e3a, 0x6f4d, 0x7ef4, 0x82c7, 0x840e, 0x59d4, 0x4f1f, + 0x4f2a, 0x5c3e, 0x7eac, 0x672a, 0x851a, 0x5473, 0x754f, 0x80c3, + 0x5582, 0x9b4f, 0x4f4d, 0x6e2d, 0x8c13, 0x5c09, 0x6170, 0x536b, + 0x761f, 0x6e29, 0x868a, 0x6587, 0x95fb, 0x7eb9, 0x543b, 0x7a33, + 0x7d0a, 0x95ee, 0x55e1, 0x7fc1, 0x74ee, 0x631d, 0x8717, 0x6da1, + 0x7a9d, 0x6211, 0x65a1, 0x5367, 0x63e1, 0x6c83, 0x5deb, 0x545c, + 0x94a8, 0x4e4c, 0x6c61, 0x8bec, 0x5c4b, 0x65e0, 0x829c, 0x68a7, + 0x543e, 0x5434, 0x6bcb, 0x6b66, 0x4e94, 0x6342, 0x5348, 0x821e, + 0x4f0d, 0x4fae, 0x575e, 0x620a, 0x96fe, 0x6664, 0x7269, 0x52ff, + 0x52a1, 0x609f, 0x8bef, 0x6614, 0x7199, 0x6790, 0x897f, 0x7852, + 0x77fd, 0x6670, 0x563b, 0x5438, 0x9521, 0x727a, + /* 0x4f */ + 0x7a00, 0x606f, 0x5e0c, 0x6089, 0x819d, 0x5915, 0x60dc, 0x7184, + 0x70ef, 0x6eaa, 0x6c50, 0x7280, 0x6a84, 0x88ad, 0x5e2d, 0x4e60, + 0x5ab3, 0x559c, 0x94e3, 0x6d17, 0x7cfb, 0x9699, 0x620f, 0x7ec6, + 0x778e, 0x867e, 0x5323, 0x971e, 0x8f96, 0x6687, 0x5ce1, 0x4fa0, + 0x72ed, 0x4e0b, 0x53a6, 0x590f, 0x5413, 0x6380, 0x9528, 0x5148, + 0x4ed9, 0x9c9c, 0x7ea4, 0x54b8, 0x8d24, 0x8854, 0x8237, 0x95f2, + 0x6d8e, 0x5f26, 0x5acc, 0x663e, 0x9669, 0x73b0, 0x732e, 0x53bf, + 0x817a, 0x9985, 0x7fa1, 0x5baa, 0x9677, 0x9650, 0x7ebf, 0x76f8, + 0x53a2, 0x9576, 0x9999, 0x7bb1, 0x8944, 0x6e58, 0x4e61, 0x7fd4, + 0x7965, 0x8be6, 0x60f3, 0x54cd, 0x4eab, 0x9879, 0x5df7, 0x6a61, + 0x50cf, 0x5411, 0x8c61, 0x8427, 0x785d, 0x9704, 0x524a, 0x54ee, + 0x56a3, 0x9500, 0x6d88, 0x5bb5, 0x6dc6, 0x6653, + /* 0x50 */ + 0x5c0f, 0x5b5d, 0x6821, 0x8096, 0x5578, 0x7b11, 0x6548, 0x6954, + 0x4e9b, 0x6b47, 0x874e, 0x978b, 0x534f, 0x631f, 0x643a, 0x90aa, + 0x659c, 0x80c1, 0x8c10, 0x5199, 0x68b0, 0x5378, 0x87f9, 0x61c8, + 0x6cc4, 0x6cfb, 0x8c22, 0x5c51, 0x85aa, 0x82af, 0x950c, 0x6b23, + 0x8f9b, 0x65b0, 0x5ffb, 0x5fc3, 0x4fe1, 0x8845, 0x661f, 0x8165, + 0x7329, 0x60fa, 0x5174, 0x5211, 0x578b, 0x5f62, 0x90a2, 0x884c, + 0x9192, 0x5e78, 0x674f, 0x6027, 0x59d3, 0x5144, 0x51f6, 0x80f8, + 0x5308, 0x6c79, 0x96c4, 0x718a, 0x4f11, 0x4fee, 0x7f9e, 0x673d, + 0x55c5, 0x9508, 0x79c0, 0x8896, 0x7ee3, 0x589f, 0x620c, 0x9700, + 0x865a, 0x5618, 0x987b, 0x5f90, 0x8bb8, 0x84c4, 0x9157, 0x53d9, + 0x65ed, 0x5e8f, 0x755c, 0x6064, 0x7d6e, 0x5a7f, 0x7eea, 0x7eed, + 0x8f69, 0x55a7, 0x5ba3, 0x60ac, 0x65cb, 0x7384, + /* 0x51 */ + 0x9009, 0x7663, 0x7729, 0x7eda, 0x9774, 0x859b, 0x5b66, 0x7a74, + 0x96ea, 0x8840, 0x52cb, 0x718f, 0x5faa, 0x65ec, 0x8be2, 0x5bfb, + 0x9a6f, 0x5de1, 0x6b89, 0x6c5b, 0x8bad, 0x8baf, 0x900a, 0x8fc5, + 0x538b, 0x62bc, 0x9e26, 0x9e2d, 0x5440, 0x4e2b, 0x82bd, 0x7259, + 0x869c, 0x5d16, 0x8859, 0x6daf, 0x96c5, 0x54d1, 0x4e9a, 0x8bb6, + 0x7109, 0x54bd, 0x9609, 0x70df, 0x6df9, 0x76d0, 0x4e25, 0x7814, + 0x8712, 0x5ca9, 0x5ef6, 0x8a00, 0x989c, 0x960e, 0x708e, 0x6cbf, + 0x5944, 0x63a9, 0x773c, 0x884d, 0x6f14, 0x8273, 0x5830, 0x71d5, + 0x538c, 0x781a, 0x96c1, 0x5501, 0x5f66, 0x7130, 0x5bb4, 0x8c1a, + 0x9a8c, 0x6b83, 0x592e, 0x9e2f, 0x79e7, 0x6768, 0x626c, 0x4f6f, + 0x75a1, 0x7f8a, 0x6d0b, 0x9633, 0x6c27, 0x4ef0, 0x75d2, 0x517b, + 0x6837, 0x6f3e, 0x9080, 0x8170, 0x5996, 0x7476, + /* 0x52 */ + 0x6447, 0x5c27, 0x9065, 0x7a91, 0x8c23, 0x59da, 0x54ac, 0x8200, + 0x836f, 0x8981, 0x8000, 0x6930, 0x564e, 0x8036, 0x7237, 0x91ce, + 0x51b6, 0x4e5f, 0x9875, 0x6396, 0x4e1a, 0x53f6, 0x66f3, 0x814b, + 0x591c, 0x6db2, 0x4e00, 0x58f9, 0x533b, 0x63d6, 0x94f1, 0x4f9d, + 0x4f0a, 0x8863, 0x9890, 0x5937, 0x9057, 0x79fb, 0x4eea, 0x80f0, + 0x7591, 0x6c82, 0x5b9c, 0x59e8, 0x5f5d, 0x6905, 0x8681, 0x501a, + 0x5df2, 0x4e59, 0x77e3, 0x4ee5, 0x827a, 0x6291, 0x6613, 0x9091, + 0x5c79, 0x4ebf, 0x5f79, 0x81c6, 0x9038, 0x8084, 0x75ab, 0x4ea6, + 0x88d4, 0x610f, 0x6bc5, 0x5fc6, 0x4e49, 0x76ca, 0x6ea2, 0x8be3, + 0x8bae, 0x8c0a, 0x8bd1, 0x5f02, 0x7ffc, 0x7fcc, 0x7ece, 0x8335, + 0x836b, 0x56e0, 0x6bb7, 0x97f3, 0x9634, 0x59fb, 0x541f, 0x94f6, + 0x6deb, 0x5bc5, 0x996e, 0x5c39, 0x5f15, 0x9690, + /* 0x53 */ + 0x5370, 0x82f1, 0x6a31, 0x5a74, 0x9e70, 0x5e94, 0x7f28, 0x83b9, + 0x8424, 0x8425, 0x8367, 0x8747, 0x8fce, 0x8d62, 0x76c8, 0x5f71, + 0x9896, 0x786c, 0x6620, 0x54df, 0x62e5, 0x4f63, 0x81c3, 0x75c8, + 0x5eb8, 0x96cd, 0x8e0a, 0x86f9, 0x548f, 0x6cf3, 0x6d8c, 0x6c38, + 0x607f, 0x52c7, 0x7528, 0x5e7d, 0x4f18, 0x60a0, 0x5fe7, 0x5c24, + 0x7531, 0x90ae, 0x94c0, 0x72b9, 0x6cb9, 0x6e38, 0x9149, 0x6709, + 0x53cb, 0x53f3, 0x4f51, 0x91c9, 0x8bf1, 0x53c8, 0x5e7c, 0x8fc2, + 0x6de4, 0x4e8e, 0x76c2, 0x6986, 0x865e, 0x611a, 0x8206, 0x4f59, + 0x4fde, 0x903e, 0x9c7c, 0x6109, 0x6e1d, 0x6e14, 0x9685, 0x4e88, + 0x5a31, 0x96e8, 0x4e0e, 0x5c7f, 0x79b9, 0x5b87, 0x8bed, 0x7fbd, + 0x7389, 0x57df, 0x828b, 0x90c1, 0x5401, 0x9047, 0x55bb, 0x5cea, + 0x5fa1, 0x6108, 0x6b32, 0x72f1, 0x80b2, 0x8a89, + /* 0x54 */ + 0x6d74, 0x5bd3, 0x88d5, 0x9884, 0x8c6b, 0x9a6d, 0x9e33, 0x6e0a, + 0x51a4, 0x5143, 0x57a3, 0x8881, 0x539f, 0x63f4, 0x8f95, 0x56ed, + 0x5458, 0x5706, 0x733f, 0x6e90, 0x7f18, 0x8fdc, 0x82d1, 0x613f, + 0x6028, 0x9662, 0x66f0, 0x7ea6, 0x8d8a, 0x8dc3, 0x94a5, 0x5cb3, + 0x7ca4, 0x6708, 0x60a6, 0x9605, 0x8018, 0x4e91, 0x90e7, 0x5300, + 0x9668, 0x5141, 0x8fd0, 0x8574, 0x915d, 0x6655, 0x97f5, 0x5b55, + 0x531d, 0x7838, 0x6742, 0x683d, 0x54c9, 0x707e, 0x5bb0, 0x8f7d, + 0x518d, 0x5728, 0x54b1, 0x6512, 0x6682, 0x8d5e, 0x8d43, 0x810f, + 0x846c, 0x906d, 0x7cdf, 0x51ff, 0x85fb, 0x67a3, 0x65e9, 0x6fa1, + 0x86a4, 0x8e81, 0x566a, 0x9020, 0x7682, 0x7076, 0x71e5, 0x8d23, + 0x62e9, 0x5219, 0x6cfd, 0x8d3c, 0x600e, 0x589e, 0x618e, 0x66fe, + 0x8d60, 0x624e, 0x55b3, 0x6e23, 0x672d, 0x8f67, + /* 0x55 */ + 0x94e1, 0x95f8, 0x7728, 0x6805, 0x69a8, 0x548b, 0x4e4d, 0x70b8, + 0x8bc8, 0x6458, 0x658b, 0x5b85, 0x7a84, 0x503a, 0x5be8, 0x77bb, + 0x6be1, 0x8a79, 0x7c98, 0x6cbe, 0x76cf, 0x65a9, 0x8f97, 0x5d2d, + 0x5c55, 0x8638, 0x6808, 0x5360, 0x6218, 0x7ad9, 0x6e5b, 0x7efd, + 0x6a1f, 0x7ae0, 0x5f70, 0x6f33, 0x5f20, 0x638c, 0x6da8, 0x6756, + 0x4e08, 0x5e10, 0x8d26, 0x4ed7, 0x80c0, 0x7634, 0x969c, 0x62db, + 0x662d, 0x627e, 0x6cbc, 0x8d75, 0x7167, 0x7f69, 0x5146, 0x8087, + 0x53ec, 0x906e, 0x6298, 0x54f2, 0x86f0, 0x8f99, 0x8005, 0x9517, + 0x8517, 0x8fd9, 0x6d59, 0x73cd, 0x659f, 0x771f, 0x7504, 0x7827, + 0x81fb, 0x8d1e, 0x9488, 0x4fa6, 0x6795, 0x75b9, 0x8bca, 0x9707, + 0x632f, 0x9547, 0x9635, 0x84b8, 0x6323, 0x7741, 0x5f81, 0x72f0, + 0x4e89, 0x6014, 0x6574, 0x62ef, 0x6b63, 0x653f, + /* 0x56 */ + 0x5e27, 0x75c7, 0x90d1, 0x8bc1, 0x829d, 0x679d, 0x652f, 0x5431, + 0x8718, 0x77e5, 0x80a2, 0x8102, 0x6c41, 0x4e4b, 0x7ec7, 0x804c, + 0x76f4, 0x690d, 0x6b96, 0x6267, 0x503c, 0x4f84, 0x5740, 0x6307, + 0x6b62, 0x8dbe, 0x53ea, 0x65e8, 0x7eb8, 0x5fd7, 0x631a, 0x63b7, + 0x81f3, 0x81f4, 0x7f6e, 0x5e1c, 0x5cd9, 0x5236, 0x667a, 0x79e9, + 0x7a1a, 0x8d28, 0x7099, 0x75d4, 0x6ede, 0x6cbb, 0x7a92, 0x4e2d, + 0x76c5, 0x5fe0, 0x949f, 0x8877, 0x7ec8, 0x79cd, 0x80bf, 0x91cd, + 0x4ef2, 0x4f17, 0x821f, 0x5468, 0x5dde, 0x6d32, 0x8bcc, 0x7ca5, + 0x8f74, 0x8098, 0x5e1a, 0x5492, 0x76b1, 0x5b99, 0x663c, 0x9aa4, + 0x73e0, 0x682a, 0x86db, 0x6731, 0x732a, 0x8bf8, 0x8bdb, 0x9010, + 0x7af9, 0x70db, 0x716e, 0x62c4, 0x77a9, 0x5631, 0x4e3b, 0x8457, + 0x67f1, 0x52a9, 0x86c0, 0x8d2e, 0x94f8, 0x7b51, + /* 0x57 */ + 0x4f4f, 0x6ce8, 0x795d, 0x9a7b, 0x6293, 0x722a, 0x62fd, 0x4e13, + 0x7816, 0x8f6c, 0x64b0, 0x8d5a, 0x7bc6, 0x6869, 0x5e84, 0x88c5, + 0x5986, 0x649e, 0x58ee, 0x72b6, 0x690e, 0x9525, 0x8ffd, 0x8d58, + 0x5760, 0x7f00, 0x8c06, 0x51c6, 0x6349, 0x62d9, 0x5353, 0x684c, + 0x7422, 0x8301, 0x914c, 0x5544, 0x7740, 0x707c, 0x6d4a, 0x5179, + 0x54a8, 0x8d44, 0x59ff, 0x6ecb, 0x6dc4, 0x5b5c, 0x7d2b, 0x4ed4, + 0x7c7d, 0x6ed3, 0x5b50, 0x81ea, 0x6e0d, 0x5b57, 0x9b03, 0x68d5, + 0x8e2a, 0x5b97, 0x7efc, 0x603b, 0x7eb5, 0x90b9, 0x8d70, 0x594f, + 0x63cd, 0x79df, 0x8db3, 0x5352, 0x65cf, 0x7956, 0x8bc5, 0x963b, + 0x7ec4, 0x94bb, 0x7e82, 0x5634, 0x9189, 0x6700, 0x7f6a, 0x5c0a, + 0x9075, 0x6628, 0x5de6, 0x4f50, 0x67de, 0x505a, 0x4f5c, 0x5750, + 0x5ea7, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + /* 0x58 */ + 0x4e8d, 0x4e0c, 0x5140, 0x4e10, 0x5eff, 0x5345, 0x4e15, 0x4e98, + 0x4e1e, 0x9b32, 0x5b6c, 0x5669, 0x4e28, 0x79ba, 0x4e3f, 0x5315, + 0x4e47, 0x592d, 0x723b, 0x536e, 0x6c10, 0x56df, 0x80e4, 0x9997, + 0x6bd3, 0x777e, 0x9f17, 0x4e36, 0x4e9f, 0x9f10, 0x4e5c, 0x4e69, + 0x4e93, 0x8288, 0x5b5b, 0x556c, 0x560f, 0x4ec4, 0x538d, 0x539d, + 0x53a3, 0x53a5, 0x53ae, 0x9765, 0x8d5d, 0x531a, 0x53f5, 0x5326, + 0x532e, 0x533e, 0x8d5c, 0x5366, 0x5363, 0x5202, 0x5208, 0x520e, + 0x522d, 0x5233, 0x523f, 0x5240, 0x524c, 0x525e, 0x5261, 0x525c, + 0x84af, 0x527d, 0x5282, 0x5281, 0x5290, 0x5293, 0x5182, 0x7f54, + 0x4ebb, 0x4ec3, 0x4ec9, 0x4ec2, 0x4ee8, 0x4ee1, 0x4eeb, 0x4ede, + 0x4f1b, 0x4ef3, 0x4f22, 0x4f64, 0x4ef5, 0x4f25, 0x4f27, 0x4f09, + 0x4f2b, 0x4f5e, 0x4f67, 0x6538, 0x4f5a, 0x4f5d, + /* 0x59 */ + 0x4f5f, 0x4f57, 0x4f32, 0x4f3d, 0x4f76, 0x4f74, 0x4f91, 0x4f89, + 0x4f83, 0x4f8f, 0x4f7e, 0x4f7b, 0x4faa, 0x4f7c, 0x4fac, 0x4f94, + 0x4fe6, 0x4fe8, 0x4fea, 0x4fc5, 0x4fda, 0x4fe3, 0x4fdc, 0x4fd1, + 0x4fdf, 0x4ff8, 0x5029, 0x504c, 0x4ff3, 0x502c, 0x500f, 0x502e, + 0x502d, 0x4ffe, 0x501c, 0x500c, 0x5025, 0x5028, 0x507e, 0x5043, + 0x5055, 0x5048, 0x504e, 0x506c, 0x507b, 0x50a5, 0x50a7, 0x50a9, + 0x50ba, 0x50d6, 0x5106, 0x50ed, 0x50ec, 0x50e6, 0x50ee, 0x5107, + 0x510b, 0x4edd, 0x6c3d, 0x4f58, 0x4f65, 0x4fce, 0x9fa0, 0x6c46, + 0x7c74, 0x516e, 0x5dfd, 0x9ec9, 0x9998, 0x5181, 0x5914, 0x52f9, + 0x530d, 0x8a07, 0x5310, 0x51eb, 0x5919, 0x5155, 0x4ea0, 0x5156, + 0x4eb3, 0x886e, 0x88a4, 0x4eb5, 0x8114, 0x88d2, 0x7980, 0x5b34, + 0x8803, 0x7fb8, 0x51ab, 0x51b1, 0x51bd, 0x51bc, + /* 0x5a */ + 0x51c7, 0x5196, 0x51a2, 0x51a5, 0x8ba0, 0x8ba6, 0x8ba7, 0x8baa, + 0x8bb4, 0x8bb5, 0x8bb7, 0x8bc2, 0x8bc3, 0x8bcb, 0x8bcf, 0x8bce, + 0x8bd2, 0x8bd3, 0x8bd4, 0x8bd6, 0x8bd8, 0x8bd9, 0x8bdc, 0x8bdf, + 0x8be0, 0x8be4, 0x8be8, 0x8be9, 0x8bee, 0x8bf0, 0x8bf3, 0x8bf6, + 0x8bf9, 0x8bfc, 0x8bff, 0x8c00, 0x8c02, 0x8c04, 0x8c07, 0x8c0c, + 0x8c0f, 0x8c11, 0x8c12, 0x8c14, 0x8c15, 0x8c16, 0x8c19, 0x8c1b, + 0x8c18, 0x8c1d, 0x8c1f, 0x8c20, 0x8c21, 0x8c25, 0x8c27, 0x8c2a, + 0x8c2b, 0x8c2e, 0x8c2f, 0x8c32, 0x8c33, 0x8c35, 0x8c36, 0x5369, + 0x537a, 0x961d, 0x9622, 0x9621, 0x9631, 0x962a, 0x963d, 0x963c, + 0x9642, 0x9649, 0x9654, 0x965f, 0x9667, 0x966c, 0x9672, 0x9674, + 0x9688, 0x968d, 0x9697, 0x96b0, 0x9097, 0x909b, 0x909d, 0x9099, + 0x90ac, 0x90a1, 0x90b4, 0x90b3, 0x90b6, 0x90ba, + /* 0x5b */ + 0x90b8, 0x90b0, 0x90cf, 0x90c5, 0x90be, 0x90d0, 0x90c4, 0x90c7, + 0x90d3, 0x90e6, 0x90e2, 0x90dc, 0x90d7, 0x90db, 0x90eb, 0x90ef, + 0x90fe, 0x9104, 0x9122, 0x911e, 0x9123, 0x9131, 0x912f, 0x9139, + 0x9143, 0x9146, 0x520d, 0x5942, 0x52a2, 0x52ac, 0x52ad, 0x52be, + 0x54ff, 0x52d0, 0x52d6, 0x52f0, 0x53df, 0x71ee, 0x77cd, 0x5ef4, + 0x51f5, 0x51fc, 0x9b2f, 0x53b6, 0x5f01, 0x755a, 0x5def, 0x574c, + 0x57a9, 0x57a1, 0x587e, 0x58bc, 0x58c5, 0x58d1, 0x5729, 0x572c, + 0x572a, 0x5733, 0x5739, 0x572e, 0x572f, 0x575c, 0x573b, 0x5742, + 0x5769, 0x5785, 0x576b, 0x5786, 0x577c, 0x577b, 0x5768, 0x576d, + 0x5776, 0x5773, 0x57ad, 0x57a4, 0x578c, 0x57b2, 0x57cf, 0x57a7, + 0x57b4, 0x5793, 0x57a0, 0x57d5, 0x57d8, 0x57da, 0x57d9, 0x57d2, + 0x57b8, 0x57f4, 0x57ef, 0x57f8, 0x57e4, 0x57dd, + /* 0x5c */ + 0x580b, 0x580d, 0x57fd, 0x57ed, 0x5800, 0x581e, 0x5819, 0x5844, + 0x5820, 0x5865, 0x586c, 0x5881, 0x5889, 0x589a, 0x5880, 0x99a8, + 0x9f19, 0x61ff, 0x8279, 0x827d, 0x827f, 0x828f, 0x828a, 0x82a8, + 0x8284, 0x828e, 0x8291, 0x8297, 0x8299, 0x82ab, 0x82b8, 0x82be, + 0x82b0, 0x82c8, 0x82ca, 0x82e3, 0x8298, 0x82b7, 0x82ae, 0x82cb, + 0x82cc, 0x82c1, 0x82a9, 0x82b4, 0x82a1, 0x82aa, 0x829f, 0x82c4, + 0x82ce, 0x82a4, 0x82e1, 0x8309, 0x82f7, 0x82e4, 0x830f, 0x8307, + 0x82dc, 0x82f4, 0x82d2, 0x82d8, 0x830c, 0x82fb, 0x82d3, 0x8311, + 0x831a, 0x8306, 0x8314, 0x8315, 0x82e0, 0x82d5, 0x831c, 0x8351, + 0x835b, 0x835c, 0x8308, 0x8392, 0x833c, 0x8334, 0x8331, 0x839b, + 0x835e, 0x832f, 0x834f, 0x8347, 0x8343, 0x835f, 0x8340, 0x8317, + 0x8360, 0x832d, 0x833a, 0x8333, 0x8366, 0x8365, + /* 0x5d */ + 0x8368, 0x831b, 0x8369, 0x836c, 0x836a, 0x836d, 0x836e, 0x83b0, + 0x8378, 0x83b3, 0x83b4, 0x83a0, 0x83aa, 0x8393, 0x839c, 0x8385, + 0x837c, 0x83b6, 0x83a9, 0x837d, 0x83b8, 0x837b, 0x8398, 0x839e, + 0x83a8, 0x83ba, 0x83bc, 0x83c1, 0x8401, 0x83e5, 0x83d8, 0x5807, + 0x8418, 0x840b, 0x83dd, 0x83fd, 0x83d6, 0x841c, 0x8438, 0x8411, + 0x8406, 0x83d4, 0x83df, 0x840f, 0x8403, 0x83f8, 0x83f9, 0x83ea, + 0x83c5, 0x83c0, 0x8426, 0x83f0, 0x83e1, 0x845c, 0x8451, 0x845a, + 0x8459, 0x8473, 0x8487, 0x8488, 0x847a, 0x8489, 0x8478, 0x843c, + 0x8446, 0x8469, 0x8476, 0x848c, 0x848e, 0x8431, 0x846d, 0x84c1, + 0x84cd, 0x84d0, 0x84e6, 0x84bd, 0x84d3, 0x84ca, 0x84bf, 0x84ba, + 0x84e0, 0x84a1, 0x84b9, 0x84b4, 0x8497, 0x84e5, 0x84e3, 0x850c, + 0x750d, 0x8538, 0x84f0, 0x8539, 0x851f, 0x853a, + /* 0x5e */ + 0x8556, 0x853b, 0x84ff, 0x84fc, 0x8559, 0x8548, 0x8568, 0x8564, + 0x855e, 0x857a, 0x77a2, 0x8543, 0x8572, 0x857b, 0x85a4, 0x85a8, + 0x8587, 0x858f, 0x8579, 0x85ae, 0x859c, 0x8585, 0x85b9, 0x85b7, + 0x85b0, 0x85d3, 0x85c1, 0x85dc, 0x85ff, 0x8627, 0x8605, 0x8629, + 0x8616, 0x863c, 0x5efe, 0x5f08, 0x593c, 0x5941, 0x8037, 0x5955, + 0x595a, 0x5958, 0x530f, 0x5c22, 0x5c25, 0x5c2c, 0x5c34, 0x624c, + 0x626a, 0x629f, 0x62bb, 0x62ca, 0x62da, 0x62d7, 0x62ee, 0x6322, + 0x62f6, 0x6339, 0x634b, 0x6343, 0x63ad, 0x63f6, 0x6371, 0x637a, + 0x638e, 0x63b4, 0x636d, 0x63ac, 0x638a, 0x6369, 0x63ae, 0x63bc, + 0x63f2, 0x63f8, 0x63e0, 0x63ff, 0x63c4, 0x63de, 0x63ce, 0x6452, + 0x63c6, 0x63be, 0x6445, 0x6441, 0x640b, 0x641b, 0x6420, 0x640c, + 0x6426, 0x6421, 0x645e, 0x6484, 0x646d, 0x6496, + /* 0x5f */ + 0x647a, 0x64b7, 0x64b8, 0x6499, 0x64ba, 0x64c0, 0x64d0, 0x64d7, + 0x64e4, 0x64e2, 0x6509, 0x6525, 0x652e, 0x5f0b, 0x5fd2, 0x7519, + 0x5f11, 0x535f, 0x53f1, 0x53fd, 0x53e9, 0x53e8, 0x53fb, 0x5412, + 0x5416, 0x5406, 0x544b, 0x5452, 0x5453, 0x5454, 0x5456, 0x5443, + 0x5421, 0x5457, 0x5459, 0x5423, 0x5432, 0x5482, 0x5494, 0x5477, + 0x5471, 0x5464, 0x549a, 0x549b, 0x5484, 0x5476, 0x5466, 0x549d, + 0x54d0, 0x54ad, 0x54c2, 0x54b4, 0x54d2, 0x54a7, 0x54a6, 0x54d3, + 0x54d4, 0x5472, 0x54a3, 0x54d5, 0x54bb, 0x54bf, 0x54cc, 0x54d9, + 0x54da, 0x54dc, 0x54a9, 0x54aa, 0x54a4, 0x54dd, 0x54cf, 0x54de, + 0x551b, 0x54e7, 0x5520, 0x54fd, 0x5514, 0x54f3, 0x5522, 0x5523, + 0x550f, 0x5511, 0x5527, 0x552a, 0x5567, 0x558f, 0x55b5, 0x5549, + 0x556d, 0x5541, 0x5555, 0x553f, 0x5550, 0x553c, + /* 0x60 */ + 0x5537, 0x5556, 0x5575, 0x5576, 0x5577, 0x5533, 0x5530, 0x555c, + 0x558b, 0x55d2, 0x5583, 0x55b1, 0x55b9, 0x5588, 0x5581, 0x559f, + 0x557e, 0x55d6, 0x5591, 0x557b, 0x55df, 0x55bd, 0x55be, 0x5594, + 0x5599, 0x55ea, 0x55f7, 0x55c9, 0x561f, 0x55d1, 0x55eb, 0x55ec, + 0x55d4, 0x55e6, 0x55dd, 0x55c4, 0x55ef, 0x55e5, 0x55f2, 0x55f3, + 0x55cc, 0x55cd, 0x55e8, 0x55f5, 0x55e4, 0x8f94, 0x561e, 0x5608, + 0x560c, 0x5601, 0x5624, 0x5623, 0x55fe, 0x5600, 0x5627, 0x562d, + 0x5658, 0x5639, 0x5657, 0x562c, 0x564d, 0x5662, 0x5659, 0x565c, + 0x564c, 0x5654, 0x5686, 0x5664, 0x5671, 0x566b, 0x567b, 0x567c, + 0x5685, 0x5693, 0x56af, 0x56d4, 0x56d7, 0x56dd, 0x56e1, 0x56f5, + 0x56eb, 0x56f9, 0x56ff, 0x5704, 0x570a, 0x5709, 0x571c, 0x5e0f, + 0x5e19, 0x5e14, 0x5e11, 0x5e31, 0x5e3b, 0x5e3c, + /* 0x61 */ + 0x5e37, 0x5e44, 0x5e54, 0x5e5b, 0x5e5e, 0x5e61, 0x5c8c, 0x5c7a, + 0x5c8d, 0x5c90, 0x5c96, 0x5c88, 0x5c98, 0x5c99, 0x5c91, 0x5c9a, + 0x5c9c, 0x5cb5, 0x5ca2, 0x5cbd, 0x5cac, 0x5cab, 0x5cb1, 0x5ca3, + 0x5cc1, 0x5cb7, 0x5cc4, 0x5cd2, 0x5ce4, 0x5ccb, 0x5ce5, 0x5d02, + 0x5d03, 0x5d27, 0x5d26, 0x5d2e, 0x5d24, 0x5d1e, 0x5d06, 0x5d1b, + 0x5d58, 0x5d3e, 0x5d34, 0x5d3d, 0x5d6c, 0x5d5b, 0x5d6f, 0x5d5d, + 0x5d6b, 0x5d4b, 0x5d4a, 0x5d69, 0x5d74, 0x5d82, 0x5d99, 0x5d9d, + 0x8c73, 0x5db7, 0x5dc5, 0x5f73, 0x5f77, 0x5f82, 0x5f87, 0x5f89, + 0x5f8c, 0x5f95, 0x5f99, 0x5f9c, 0x5fa8, 0x5fad, 0x5fb5, 0x5fbc, + 0x8862, 0x5f61, 0x72ad, 0x72b0, 0x72b4, 0x72b7, 0x72b8, 0x72c3, + 0x72c1, 0x72ce, 0x72cd, 0x72d2, 0x72e8, 0x72ef, 0x72e9, 0x72f2, + 0x72f4, 0x72f7, 0x7301, 0x72f3, 0x7303, 0x72fa, + /* 0x62 */ + 0x72fb, 0x7317, 0x7313, 0x7321, 0x730a, 0x731e, 0x731d, 0x7315, + 0x7322, 0x7339, 0x7325, 0x732c, 0x7338, 0x7331, 0x7350, 0x734d, + 0x7357, 0x7360, 0x736c, 0x736f, 0x737e, 0x821b, 0x5925, 0x98e7, + 0x5924, 0x5902, 0x9963, 0x9967, 0x9968, 0x9969, 0x996a, 0x996b, + 0x996c, 0x9974, 0x9977, 0x997d, 0x9980, 0x9984, 0x9987, 0x998a, + 0x998d, 0x9990, 0x9991, 0x9993, 0x9994, 0x9995, 0x5e80, 0x5e91, + 0x5e8b, 0x5e96, 0x5ea5, 0x5ea0, 0x5eb9, 0x5eb5, 0x5ebe, 0x5eb3, + 0x8d53, 0x5ed2, 0x5ed1, 0x5edb, 0x5ee8, 0x5eea, 0x81ba, 0x5fc4, + 0x5fc9, 0x5fd6, 0x5fcf, 0x6003, 0x5fee, 0x6004, 0x5fe1, 0x5fe4, + 0x5ffe, 0x6005, 0x6006, 0x5fea, 0x5fed, 0x5ff8, 0x6019, 0x6035, + 0x6026, 0x601b, 0x600f, 0x600d, 0x6029, 0x602b, 0x600a, 0x603f, + 0x6021, 0x6078, 0x6079, 0x607b, 0x607a, 0x6042, + /* 0x63 */ + 0x606a, 0x607d, 0x6096, 0x609a, 0x60ad, 0x609d, 0x6083, 0x6092, + 0x608c, 0x609b, 0x60ec, 0x60bb, 0x60b1, 0x60dd, 0x60d8, 0x60c6, + 0x60da, 0x60b4, 0x6120, 0x6126, 0x6115, 0x6123, 0x60f4, 0x6100, + 0x610e, 0x612b, 0x614a, 0x6175, 0x61ac, 0x6194, 0x61a7, 0x61b7, + 0x61d4, 0x61f5, 0x5fdd, 0x96b3, 0x95e9, 0x95eb, 0x95f1, 0x95f3, + 0x95f5, 0x95f6, 0x95fc, 0x95fe, 0x9603, 0x9604, 0x9606, 0x9608, + 0x960a, 0x960b, 0x960c, 0x960d, 0x960f, 0x9612, 0x9615, 0x9616, + 0x9617, 0x9619, 0x961a, 0x4e2c, 0x723f, 0x6215, 0x6c35, 0x6c54, + 0x6c5c, 0x6c4a, 0x6ca3, 0x6c85, 0x6c90, 0x6c94, 0x6c8c, 0x6c68, + 0x6c69, 0x6c74, 0x6c76, 0x6c86, 0x6ca9, 0x6cd0, 0x6cd4, 0x6cad, + 0x6cf7, 0x6cf8, 0x6cf1, 0x6cd7, 0x6cb2, 0x6ce0, 0x6cd6, 0x6cfa, + 0x6ceb, 0x6cee, 0x6cb1, 0x6cd3, 0x6cef, 0x6cfe, + /* 0x64 */ + 0x6d39, 0x6d27, 0x6d0c, 0x6d43, 0x6d48, 0x6d07, 0x6d04, 0x6d19, + 0x6d0e, 0x6d2b, 0x6d4d, 0x6d2e, 0x6d35, 0x6d1a, 0x6d4f, 0x6d52, + 0x6d54, 0x6d33, 0x6d91, 0x6d6f, 0x6d9e, 0x6da0, 0x6d5e, 0x6d93, + 0x6d94, 0x6d5c, 0x6d60, 0x6d7c, 0x6d63, 0x6e1a, 0x6dc7, 0x6dc5, + 0x6dde, 0x6e0e, 0x6dbf, 0x6de0, 0x6e11, 0x6de6, 0x6ddd, 0x6dd9, + 0x6e16, 0x6dab, 0x6e0c, 0x6dae, 0x6e2b, 0x6e6e, 0x6e4e, 0x6e6b, + 0x6eb2, 0x6e5f, 0x6e86, 0x6e53, 0x6e54, 0x6e32, 0x6e25, 0x6e44, + 0x6edf, 0x6eb1, 0x6e98, 0x6ee0, 0x6f2d, 0x6ee2, 0x6ea5, 0x6ea7, + 0x6ebd, 0x6ebb, 0x6eb7, 0x6ed7, 0x6eb4, 0x6ecf, 0x6e8f, 0x6ec2, + 0x6e9f, 0x6f62, 0x6f46, 0x6f47, 0x6f24, 0x6f15, 0x6ef9, 0x6f2f, + 0x6f36, 0x6f4b, 0x6f74, 0x6f2a, 0x6f09, 0x6f29, 0x6f89, 0x6f8d, + 0x6f8c, 0x6f78, 0x6f72, 0x6f7c, 0x6f7a, 0x6fd1, + /* 0x65 */ + 0x6fc9, 0x6fa7, 0x6fb9, 0x6fb6, 0x6fc2, 0x6fe1, 0x6fee, 0x6fde, + 0x6fe0, 0x6fef, 0x701a, 0x7023, 0x701b, 0x7039, 0x7035, 0x704f, + 0x705e, 0x5b80, 0x5b84, 0x5b95, 0x5b93, 0x5ba5, 0x5bb8, 0x752f, + 0x9a9e, 0x6434, 0x5be4, 0x5bee, 0x8930, 0x5bf0, 0x8e47, 0x8b07, + 0x8fb6, 0x8fd3, 0x8fd5, 0x8fe5, 0x8fee, 0x8fe4, 0x8fe9, 0x8fe6, + 0x8ff3, 0x8fe8, 0x9005, 0x9004, 0x900b, 0x9026, 0x9011, 0x900d, + 0x9016, 0x9021, 0x9035, 0x9036, 0x902d, 0x902f, 0x9044, 0x9051, + 0x9052, 0x9050, 0x9068, 0x9058, 0x9062, 0x905b, 0x66b9, 0x9074, + 0x907d, 0x9082, 0x9088, 0x9083, 0x908b, 0x5f50, 0x5f57, 0x5f56, + 0x5f58, 0x5c3b, 0x54ab, 0x5c50, 0x5c59, 0x5b71, 0x5c63, 0x5c66, + 0x7fbc, 0x5f2a, 0x5f29, 0x5f2d, 0x8274, 0x5f3c, 0x9b3b, 0x5c6e, + 0x5981, 0x5983, 0x598d, 0x59a9, 0x59aa, 0x59a3, + /* 0x66 */ + 0x5997, 0x59ca, 0x59ab, 0x599e, 0x59a4, 0x59d2, 0x59b2, 0x59af, + 0x59d7, 0x59be, 0x5a05, 0x5a06, 0x59dd, 0x5a08, 0x59e3, 0x59d8, + 0x59f9, 0x5a0c, 0x5a09, 0x5a32, 0x5a34, 0x5a11, 0x5a23, 0x5a13, + 0x5a40, 0x5a67, 0x5a4a, 0x5a55, 0x5a3c, 0x5a62, 0x5a75, 0x80ec, + 0x5aaa, 0x5a9b, 0x5a77, 0x5a7a, 0x5abe, 0x5aeb, 0x5ab2, 0x5ad2, + 0x5ad4, 0x5ab8, 0x5ae0, 0x5ae3, 0x5af1, 0x5ad6, 0x5ae6, 0x5ad8, + 0x5adc, 0x5b09, 0x5b17, 0x5b16, 0x5b32, 0x5b37, 0x5b40, 0x5c15, + 0x5c1c, 0x5b5a, 0x5b65, 0x5b73, 0x5b51, 0x5b53, 0x5b62, 0x9a75, + 0x9a77, 0x9a78, 0x9a7a, 0x9a7f, 0x9a7d, 0x9a80, 0x9a81, 0x9a85, + 0x9a88, 0x9a8a, 0x9a90, 0x9a92, 0x9a93, 0x9a96, 0x9a98, 0x9a9b, + 0x9a9c, 0x9a9d, 0x9a9f, 0x9aa0, 0x9aa2, 0x9aa3, 0x9aa5, 0x9aa7, + 0x7e9f, 0x7ea1, 0x7ea3, 0x7ea5, 0x7ea8, 0x7ea9, + /* 0x67 */ + 0x7ead, 0x7eb0, 0x7ebe, 0x7ec0, 0x7ec1, 0x7ec2, 0x7ec9, 0x7ecb, + 0x7ecc, 0x7ed0, 0x7ed4, 0x7ed7, 0x7edb, 0x7ee0, 0x7ee1, 0x7ee8, + 0x7eeb, 0x7eee, 0x7eef, 0x7ef1, 0x7ef2, 0x7f0d, 0x7ef6, 0x7efa, + 0x7efb, 0x7efe, 0x7f01, 0x7f02, 0x7f03, 0x7f07, 0x7f08, 0x7f0b, + 0x7f0c, 0x7f0f, 0x7f11, 0x7f12, 0x7f17, 0x7f19, 0x7f1c, 0x7f1b, + 0x7f1f, 0x7f21, 0x7f22, 0x7f23, 0x7f24, 0x7f25, 0x7f26, 0x7f27, + 0x7f2a, 0x7f2b, 0x7f2c, 0x7f2d, 0x7f2f, 0x7f30, 0x7f31, 0x7f32, + 0x7f33, 0x7f35, 0x5e7a, 0x757f, 0x5ddb, 0x753e, 0x9095, 0x738e, + 0x7391, 0x73ae, 0x73a2, 0x739f, 0x73cf, 0x73c2, 0x73d1, 0x73b7, + 0x73b3, 0x73c0, 0x73c9, 0x73c8, 0x73e5, 0x73d9, 0x987c, 0x740a, + 0x73e9, 0x73e7, 0x73de, 0x73ba, 0x73f2, 0x740f, 0x742a, 0x745b, + 0x7426, 0x7425, 0x7428, 0x7430, 0x742e, 0x742c, + /* 0x68 */ + 0x741b, 0x741a, 0x7441, 0x745c, 0x7457, 0x7455, 0x7459, 0x7477, + 0x746d, 0x747e, 0x749c, 0x748e, 0x7480, 0x7481, 0x7487, 0x748b, + 0x749e, 0x74a8, 0x74a9, 0x7490, 0x74a7, 0x74d2, 0x74ba, 0x97ea, + 0x97eb, 0x97ec, 0x674c, 0x6753, 0x675e, 0x6748, 0x6769, 0x67a5, + 0x6787, 0x676a, 0x6773, 0x6798, 0x67a7, 0x6775, 0x67a8, 0x679e, + 0x67ad, 0x678b, 0x6777, 0x677c, 0x67f0, 0x6809, 0x67d8, 0x680a, + 0x67e9, 0x67b0, 0x680c, 0x67d9, 0x67b5, 0x67da, 0x67b3, 0x67dd, + 0x6800, 0x67c3, 0x67b8, 0x67e2, 0x680e, 0x67c1, 0x67fd, 0x6832, + 0x6833, 0x6860, 0x6861, 0x684e, 0x6862, 0x6844, 0x6864, 0x6883, + 0x681d, 0x6855, 0x6866, 0x6841, 0x6867, 0x6840, 0x683e, 0x684a, + 0x6849, 0x6829, 0x68b5, 0x688f, 0x6874, 0x6877, 0x6893, 0x686b, + 0x68c2, 0x696e, 0x68fc, 0x691f, 0x6920, 0x68f9, + /* 0x69 */ + 0x6924, 0x68f0, 0x690b, 0x6901, 0x6957, 0x68e3, 0x6910, 0x6971, + 0x6939, 0x6960, 0x6942, 0x695d, 0x6984, 0x696b, 0x6980, 0x6998, + 0x6978, 0x6934, 0x69cc, 0x6987, 0x6988, 0x69ce, 0x6989, 0x6966, + 0x6963, 0x6979, 0x699b, 0x69a7, 0x69bb, 0x69ab, 0x69ad, 0x69d4, + 0x69b1, 0x69c1, 0x69ca, 0x69df, 0x6995, 0x69e0, 0x698d, 0x69ff, + 0x6a2f, 0x69ed, 0x6a17, 0x6a18, 0x6a65, 0x69f2, 0x6a44, 0x6a3e, + 0x6aa0, 0x6a50, 0x6a5b, 0x6a35, 0x6a8e, 0x6a79, 0x6a3d, 0x6a28, + 0x6a58, 0x6a7c, 0x6a91, 0x6a90, 0x6aa9, 0x6a97, 0x6aab, 0x7337, + 0x7352, 0x6b81, 0x6b82, 0x6b87, 0x6b84, 0x6b92, 0x6b93, 0x6b8d, + 0x6b9a, 0x6b9b, 0x6ba1, 0x6baa, 0x8f6b, 0x8f6d, 0x8f71, 0x8f72, + 0x8f73, 0x8f75, 0x8f76, 0x8f78, 0x8f77, 0x8f79, 0x8f7a, 0x8f7c, + 0x8f7e, 0x8f81, 0x8f82, 0x8f84, 0x8f87, 0x8f8b, + /* 0x6a */ + 0x8f8d, 0x8f8e, 0x8f8f, 0x8f98, 0x8f9a, 0x8ece, 0x620b, 0x6217, + 0x621b, 0x621f, 0x6222, 0x6221, 0x6225, 0x6224, 0x622c, 0x81e7, + 0x74ef, 0x74f4, 0x74ff, 0x750f, 0x7511, 0x7513, 0x6534, 0x65ee, + 0x65ef, 0x65f0, 0x660a, 0x6619, 0x6772, 0x6603, 0x6615, 0x6600, + 0x7085, 0x66f7, 0x661d, 0x6634, 0x6631, 0x6636, 0x6635, 0x8006, + 0x665f, 0x6654, 0x6641, 0x664f, 0x6656, 0x6661, 0x6657, 0x6677, + 0x6684, 0x668c, 0x66a7, 0x669d, 0x66be, 0x66db, 0x66dc, 0x66e6, + 0x66e9, 0x8d32, 0x8d33, 0x8d36, 0x8d3b, 0x8d3d, 0x8d40, 0x8d45, + 0x8d46, 0x8d48, 0x8d49, 0x8d47, 0x8d4d, 0x8d55, 0x8d59, 0x89c7, + 0x89ca, 0x89cb, 0x89cc, 0x89ce, 0x89cf, 0x89d0, 0x89d1, 0x726e, + 0x729f, 0x725d, 0x7266, 0x726f, 0x727e, 0x727f, 0x7284, 0x728b, + 0x728d, 0x728f, 0x7292, 0x6308, 0x6332, 0x63b0, + /* 0x6b */ + 0x643f, 0x64d8, 0x8004, 0x6bea, 0x6bf3, 0x6bfd, 0x6bf5, 0x6bf9, + 0x6c05, 0x6c07, 0x6c06, 0x6c0d, 0x6c15, 0x6c18, 0x6c19, 0x6c1a, + 0x6c21, 0x6c29, 0x6c24, 0x6c2a, 0x6c32, 0x6535, 0x6555, 0x656b, + 0x724d, 0x7252, 0x7256, 0x7230, 0x8662, 0x5216, 0x809f, 0x809c, + 0x8093, 0x80bc, 0x670a, 0x80bd, 0x80b1, 0x80ab, 0x80ad, 0x80b4, + 0x80b7, 0x80e7, 0x80e8, 0x80e9, 0x80ea, 0x80db, 0x80c2, 0x80c4, + 0x80d9, 0x80cd, 0x80d7, 0x6710, 0x80dd, 0x80eb, 0x80f1, 0x80f4, + 0x80ed, 0x810d, 0x810e, 0x80f2, 0x80fc, 0x6715, 0x8112, 0x8c5a, + 0x8136, 0x811e, 0x812c, 0x8118, 0x8132, 0x8148, 0x814c, 0x8153, + 0x8174, 0x8159, 0x815a, 0x8171, 0x8160, 0x8169, 0x817c, 0x817d, + 0x816d, 0x8167, 0x584d, 0x5ab5, 0x8188, 0x8182, 0x8191, 0x6ed5, + 0x81a3, 0x81aa, 0x81cc, 0x6726, 0x81ca, 0x81bb, + /* 0x6c */ + 0x81c1, 0x81a6, 0x6b24, 0x6b37, 0x6b39, 0x6b43, 0x6b46, 0x6b59, + 0x98d1, 0x98d2, 0x98d3, 0x98d5, 0x98d9, 0x98da, 0x6bb3, 0x5f40, + 0x6bc2, 0x89f3, 0x6590, 0x9f51, 0x6593, 0x65bc, 0x65c6, 0x65c4, + 0x65c3, 0x65cc, 0x65ce, 0x65d2, 0x65d6, 0x7080, 0x709c, 0x7096, + 0x709d, 0x70bb, 0x70c0, 0x70b7, 0x70ab, 0x70b1, 0x70e8, 0x70ca, + 0x7110, 0x7113, 0x7116, 0x712f, 0x7131, 0x7173, 0x715c, 0x7168, + 0x7145, 0x7172, 0x714a, 0x7178, 0x717a, 0x7198, 0x71b3, 0x71b5, + 0x71a8, 0x71a0, 0x71e0, 0x71d4, 0x71e7, 0x71f9, 0x721d, 0x7228, + 0x706c, 0x7118, 0x7166, 0x71b9, 0x623e, 0x623d, 0x6243, 0x6248, + 0x6249, 0x793b, 0x7940, 0x7946, 0x7949, 0x795b, 0x795c, 0x7953, + 0x795a, 0x7962, 0x7957, 0x7960, 0x796f, 0x7967, 0x797a, 0x7985, + 0x798a, 0x799a, 0x79a7, 0x79b3, 0x5fd1, 0x5fd0, + /* 0x6d */ + 0x603c, 0x605d, 0x605a, 0x6067, 0x6041, 0x6059, 0x6063, 0x60ab, + 0x6106, 0x610d, 0x615d, 0x61a9, 0x619d, 0x61cb, 0x61d1, 0x6206, + 0x8080, 0x807f, 0x6c93, 0x6cf6, 0x6dfc, 0x77f6, 0x77f8, 0x7800, + 0x7809, 0x7817, 0x7818, 0x7811, 0x65ab, 0x782d, 0x781c, 0x781d, + 0x7839, 0x783a, 0x783b, 0x781f, 0x783c, 0x7825, 0x782c, 0x7823, + 0x7829, 0x784e, 0x786d, 0x7856, 0x7857, 0x7826, 0x7850, 0x7847, + 0x784c, 0x786a, 0x789b, 0x7893, 0x789a, 0x7887, 0x789c, 0x78a1, + 0x78a3, 0x78b2, 0x78b9, 0x78a5, 0x78d4, 0x78d9, 0x78c9, 0x78ec, + 0x78f2, 0x7905, 0x78f4, 0x7913, 0x7924, 0x791e, 0x7934, 0x9f9b, + 0x9ef9, 0x9efb, 0x9efc, 0x76f1, 0x7704, 0x770d, 0x76f9, 0x7707, + 0x7708, 0x771a, 0x7722, 0x7719, 0x772d, 0x7726, 0x7735, 0x7738, + 0x7750, 0x7751, 0x7747, 0x7743, 0x775a, 0x7768, + /* 0x6e */ + 0x7762, 0x7765, 0x777f, 0x778d, 0x777d, 0x7780, 0x778c, 0x7791, + 0x779f, 0x77a0, 0x77b0, 0x77b5, 0x77bd, 0x753a, 0x7540, 0x754e, + 0x754b, 0x7548, 0x755b, 0x7572, 0x7579, 0x7583, 0x7f58, 0x7f61, + 0x7f5f, 0x8a48, 0x7f68, 0x7f74, 0x7f71, 0x7f79, 0x7f81, 0x7f7e, + 0x76cd, 0x76e5, 0x8832, 0x9485, 0x9486, 0x9487, 0x948b, 0x948a, + 0x948c, 0x948d, 0x948f, 0x9490, 0x9494, 0x9497, 0x9495, 0x949a, + 0x949b, 0x949c, 0x94a3, 0x94a4, 0x94ab, 0x94aa, 0x94ad, 0x94ac, + 0x94af, 0x94b0, 0x94b2, 0x94b4, 0x94b6, 0x94b7, 0x94b8, 0x94b9, + 0x94ba, 0x94bc, 0x94bd, 0x94bf, 0x94c4, 0x94c8, 0x94c9, 0x94ca, + 0x94cb, 0x94cc, 0x94cd, 0x94ce, 0x94d0, 0x94d1, 0x94d2, 0x94d5, + 0x94d6, 0x94d7, 0x94d9, 0x94d8, 0x94db, 0x94de, 0x94df, 0x94e0, + 0x94e2, 0x94e4, 0x94e5, 0x94e7, 0x94e8, 0x94ea, + /* 0x6f */ + 0x94e9, 0x94eb, 0x94ee, 0x94ef, 0x94f3, 0x94f4, 0x94f5, 0x94f7, + 0x94f9, 0x94fc, 0x94fd, 0x94ff, 0x9503, 0x9502, 0x9506, 0x9507, + 0x9509, 0x950a, 0x950d, 0x950e, 0x950f, 0x9512, 0x9513, 0x9514, + 0x9515, 0x9516, 0x9518, 0x951b, 0x951d, 0x951e, 0x951f, 0x9522, + 0x952a, 0x952b, 0x9529, 0x952c, 0x9531, 0x9532, 0x9534, 0x9536, + 0x9537, 0x9538, 0x953c, 0x953e, 0x953f, 0x9542, 0x9535, 0x9544, + 0x9545, 0x9546, 0x9549, 0x954c, 0x954e, 0x954f, 0x9552, 0x9553, + 0x9554, 0x9556, 0x9557, 0x9558, 0x9559, 0x955b, 0x955e, 0x955f, + 0x955d, 0x9561, 0x9562, 0x9564, 0x9565, 0x9566, 0x9567, 0x9568, + 0x9569, 0x956a, 0x956b, 0x956c, 0x956f, 0x9571, 0x9572, 0x9573, + 0x953a, 0x77e7, 0x77ec, 0x96c9, 0x79d5, 0x79ed, 0x79e3, 0x79eb, + 0x7a06, 0x5d47, 0x7a03, 0x7a02, 0x7a1e, 0x7a14, + /* 0x70 */ + 0x7a39, 0x7a37, 0x7a51, 0x9ecf, 0x99a5, 0x7a70, 0x7688, 0x768e, + 0x7693, 0x7699, 0x76a4, 0x74de, 0x74e0, 0x752c, 0x9e20, 0x9e22, + 0x9e28, 0x9e29, 0x9e2a, 0x9e2b, 0x9e2c, 0x9e32, 0x9e31, 0x9e36, + 0x9e38, 0x9e37, 0x9e39, 0x9e3a, 0x9e3e, 0x9e41, 0x9e42, 0x9e44, + 0x9e46, 0x9e47, 0x9e48, 0x9e49, 0x9e4b, 0x9e4c, 0x9e4e, 0x9e51, + 0x9e55, 0x9e57, 0x9e5a, 0x9e5b, 0x9e5c, 0x9e5e, 0x9e63, 0x9e66, + 0x9e67, 0x9e68, 0x9e69, 0x9e6a, 0x9e6b, 0x9e6c, 0x9e71, 0x9e6d, + 0x9e73, 0x7592, 0x7594, 0x7596, 0x75a0, 0x759d, 0x75ac, 0x75a3, + 0x75b3, 0x75b4, 0x75b8, 0x75c4, 0x75b1, 0x75b0, 0x75c3, 0x75c2, + 0x75d6, 0x75cd, 0x75e3, 0x75e8, 0x75e6, 0x75e4, 0x75eb, 0x75e7, + 0x7603, 0x75f1, 0x75fc, 0x75ff, 0x7610, 0x7600, 0x7605, 0x760c, + 0x7617, 0x760a, 0x7625, 0x7618, 0x7615, 0x7619, + /* 0x71 */ + 0x761b, 0x763c, 0x7622, 0x7620, 0x7640, 0x762d, 0x7630, 0x763f, + 0x7635, 0x7643, 0x763e, 0x7633, 0x764d, 0x765e, 0x7654, 0x765c, + 0x7656, 0x766b, 0x766f, 0x7fca, 0x7ae6, 0x7a78, 0x7a79, 0x7a80, + 0x7a86, 0x7a88, 0x7a95, 0x7aa6, 0x7aa0, 0x7aac, 0x7aa8, 0x7aad, + 0x7ab3, 0x8864, 0x8869, 0x8872, 0x887d, 0x887f, 0x8882, 0x88a2, + 0x88c6, 0x88b7, 0x88bc, 0x88c9, 0x88e2, 0x88ce, 0x88e3, 0x88e5, + 0x88f1, 0x891a, 0x88fc, 0x88e8, 0x88fe, 0x88f0, 0x8921, 0x8919, + 0x8913, 0x891b, 0x890a, 0x8934, 0x892b, 0x8936, 0x8941, 0x8966, + 0x897b, 0x758b, 0x80e5, 0x76b2, 0x76b4, 0x77dc, 0x8012, 0x8014, + 0x8016, 0x801c, 0x8020, 0x8022, 0x8025, 0x8026, 0x8027, 0x8029, + 0x8028, 0x8031, 0x800b, 0x8035, 0x8043, 0x8046, 0x804d, 0x8052, + 0x8069, 0x8071, 0x8983, 0x9878, 0x9880, 0x9883, + /* 0x72 */ + 0x9889, 0x988c, 0x988d, 0x988f, 0x9894, 0x989a, 0x989b, 0x989e, + 0x989f, 0x98a1, 0x98a2, 0x98a5, 0x98a6, 0x864d, 0x8654, 0x866c, + 0x866e, 0x867f, 0x867a, 0x867c, 0x867b, 0x86a8, 0x868d, 0x868b, + 0x86ac, 0x869d, 0x86a7, 0x86a3, 0x86aa, 0x8693, 0x86a9, 0x86b6, + 0x86c4, 0x86b5, 0x86ce, 0x86b0, 0x86ba, 0x86b1, 0x86af, 0x86c9, + 0x86cf, 0x86b4, 0x86e9, 0x86f1, 0x86f2, 0x86ed, 0x86f3, 0x86d0, + 0x8713, 0x86de, 0x86f4, 0x86df, 0x86d8, 0x86d1, 0x8703, 0x8707, + 0x86f8, 0x8708, 0x870a, 0x870d, 0x8709, 0x8723, 0x873b, 0x871e, + 0x8725, 0x872e, 0x871a, 0x873e, 0x8748, 0x8734, 0x8731, 0x8729, + 0x8737, 0x873f, 0x8782, 0x8722, 0x877d, 0x877e, 0x877b, 0x8760, + 0x8770, 0x874c, 0x876e, 0x878b, 0x8753, 0x8763, 0x877c, 0x8764, + 0x8759, 0x8765, 0x8793, 0x87af, 0x87a8, 0x87d2, + /* 0x73 */ + 0x87c6, 0x8788, 0x8785, 0x87ad, 0x8797, 0x8783, 0x87ab, 0x87e5, + 0x87ac, 0x87b5, 0x87b3, 0x87cb, 0x87d3, 0x87bd, 0x87d1, 0x87c0, + 0x87ca, 0x87db, 0x87ea, 0x87e0, 0x87ee, 0x8816, 0x8813, 0x87fe, + 0x880a, 0x881b, 0x8821, 0x8839, 0x883c, 0x7f36, 0x7f42, 0x7f44, + 0x7f45, 0x8210, 0x7afa, 0x7afd, 0x7b08, 0x7b03, 0x7b04, 0x7b15, + 0x7b0a, 0x7b2b, 0x7b0f, 0x7b47, 0x7b38, 0x7b2a, 0x7b19, 0x7b2e, + 0x7b31, 0x7b20, 0x7b25, 0x7b24, 0x7b33, 0x7b3e, 0x7b1e, 0x7b58, + 0x7b5a, 0x7b45, 0x7b75, 0x7b4c, 0x7b5d, 0x7b60, 0x7b6e, 0x7b7b, + 0x7b62, 0x7b72, 0x7b71, 0x7b90, 0x7ba6, 0x7ba7, 0x7bb8, 0x7bac, + 0x7b9d, 0x7ba8, 0x7b85, 0x7baa, 0x7b9c, 0x7ba2, 0x7bab, 0x7bb4, + 0x7bd1, 0x7bc1, 0x7bcc, 0x7bdd, 0x7bda, 0x7be5, 0x7be6, 0x7bea, + 0x7c0c, 0x7bfe, 0x7bfc, 0x7c0f, 0x7c16, 0x7c0b, + /* 0x74 */ + 0x7c1f, 0x7c2a, 0x7c26, 0x7c38, 0x7c41, 0x7c40, 0x81fe, 0x8201, + 0x8202, 0x8204, 0x81ec, 0x8844, 0x8221, 0x8222, 0x8223, 0x822d, + 0x822f, 0x8228, 0x822b, 0x8238, 0x823b, 0x8233, 0x8234, 0x823e, + 0x8244, 0x8249, 0x824b, 0x824f, 0x825a, 0x825f, 0x8268, 0x887e, + 0x8885, 0x8888, 0x88d8, 0x88df, 0x895e, 0x7f9d, 0x7f9f, 0x7fa7, + 0x7faf, 0x7fb0, 0x7fb2, 0x7c7c, 0x6549, 0x7c91, 0x7c9d, 0x7c9c, + 0x7c9e, 0x7ca2, 0x7cb2, 0x7cbc, 0x7cbd, 0x7cc1, 0x7cc7, 0x7ccc, + 0x7ccd, 0x7cc8, 0x7cc5, 0x7cd7, 0x7ce8, 0x826e, 0x66a8, 0x7fbf, + 0x7fce, 0x7fd5, 0x7fe5, 0x7fe1, 0x7fe6, 0x7fe9, 0x7fee, 0x7ff3, + 0x7cf8, 0x7d77, 0x7da6, 0x7dae, 0x7e47, 0x7e9b, 0x9eb8, 0x9eb4, + 0x8d73, 0x8d84, 0x8d94, 0x8d91, 0x8db1, 0x8d67, 0x8d6d, 0x8c47, + 0x8c49, 0x914a, 0x9150, 0x914e, 0x914f, 0x9164, + /* 0x75 */ + 0x9162, 0x9161, 0x9170, 0x9169, 0x916f, 0x917d, 0x917e, 0x9172, + 0x9174, 0x9179, 0x918c, 0x9185, 0x9190, 0x918d, 0x9191, 0x91a2, + 0x91a3, 0x91aa, 0x91ad, 0x91ae, 0x91af, 0x91b5, 0x91b4, 0x91ba, + 0x8c55, 0x9e7e, 0x8db8, 0x8deb, 0x8e05, 0x8e59, 0x8e69, 0x8db5, + 0x8dbf, 0x8dbc, 0x8dba, 0x8dc4, 0x8dd6, 0x8dd7, 0x8dda, 0x8dde, + 0x8dce, 0x8dcf, 0x8ddb, 0x8dc6, 0x8dec, 0x8df7, 0x8df8, 0x8de3, + 0x8df9, 0x8dfb, 0x8de4, 0x8e09, 0x8dfd, 0x8e14, 0x8e1d, 0x8e1f, + 0x8e2c, 0x8e2e, 0x8e23, 0x8e2f, 0x8e3a, 0x8e40, 0x8e39, 0x8e35, + 0x8e3d, 0x8e31, 0x8e49, 0x8e41, 0x8e42, 0x8e51, 0x8e52, 0x8e4a, + 0x8e70, 0x8e76, 0x8e7c, 0x8e6f, 0x8e74, 0x8e85, 0x8e8f, 0x8e94, + 0x8e90, 0x8e9c, 0x8e9e, 0x8c78, 0x8c82, 0x8c8a, 0x8c85, 0x8c98, + 0x8c94, 0x659b, 0x89d6, 0x89de, 0x89da, 0x89dc, + /* 0x76 */ + 0x89e5, 0x89eb, 0x89ef, 0x8a3e, 0x8b26, 0x9753, 0x96e9, 0x96f3, + 0x96ef, 0x9706, 0x9701, 0x9708, 0x970f, 0x970e, 0x972a, 0x972d, + 0x9730, 0x973e, 0x9f80, 0x9f83, 0x9f85, 0x9f86, 0x9f87, 0x9f88, + 0x9f89, 0x9f8a, 0x9f8c, 0x9efe, 0x9f0b, 0x9f0d, 0x96b9, 0x96bc, + 0x96bd, 0x96ce, 0x96d2, 0x77bf, 0x96e0, 0x928e, 0x92ae, 0x92c8, + 0x933e, 0x936a, 0x93ca, 0x938f, 0x943e, 0x946b, 0x9c7f, 0x9c82, + 0x9c85, 0x9c86, 0x9c87, 0x9c88, 0x7a23, 0x9c8b, 0x9c8e, 0x9c90, + 0x9c91, 0x9c92, 0x9c94, 0x9c95, 0x9c9a, 0x9c9b, 0x9c9e, 0x9c9f, + 0x9ca0, 0x9ca1, 0x9ca2, 0x9ca3, 0x9ca5, 0x9ca6, 0x9ca7, 0x9ca8, + 0x9ca9, 0x9cab, 0x9cad, 0x9cae, 0x9cb0, 0x9cb1, 0x9cb2, 0x9cb3, + 0x9cb4, 0x9cb5, 0x9cb6, 0x9cb7, 0x9cba, 0x9cbb, 0x9cbc, 0x9cbd, + 0x9cc4, 0x9cc5, 0x9cc6, 0x9cc7, 0x9cca, 0x9ccb, + /* 0x77 */ + 0x9ccc, 0x9ccd, 0x9cce, 0x9ccf, 0x9cd0, 0x9cd3, 0x9cd4, 0x9cd5, + 0x9cd7, 0x9cd8, 0x9cd9, 0x9cdc, 0x9cdd, 0x9cdf, 0x9ce2, 0x977c, + 0x9785, 0x9791, 0x9792, 0x9794, 0x97af, 0x97ab, 0x97a3, 0x97b2, + 0x97b4, 0x9ab1, 0x9ab0, 0x9ab7, 0x9e58, 0x9ab6, 0x9aba, 0x9abc, + 0x9ac1, 0x9ac0, 0x9ac5, 0x9ac2, 0x9acb, 0x9acc, 0x9ad1, 0x9b45, + 0x9b43, 0x9b47, 0x9b49, 0x9b48, 0x9b4d, 0x9b51, 0x98e8, 0x990d, + 0x992e, 0x9955, 0x9954, 0x9adf, 0x9ae1, 0x9ae6, 0x9aef, 0x9aeb, + 0x9afb, 0x9aed, 0x9af9, 0x9b08, 0x9b0f, 0x9b13, 0x9b1f, 0x9b23, + 0x9ebd, 0x9ebe, 0x7e3b, 0x9e82, 0x9e87, 0x9e88, 0x9e8b, 0x9e92, + 0x93d6, 0x9e9d, 0x9e9f, 0x9edb, 0x9edc, 0x9edd, 0x9ee0, 0x9edf, + 0x9ee2, 0x9ee9, 0x9ee7, 0x9ee5, 0x9eea, 0x9eef, 0x9f22, 0x9f2c, + 0x9f2f, 0x9f39, 0x9f37, 0x9f3d, 0x9f3e, 0x9f44, +}; + + + +static const u16 gbkext1_2uni_page81[6080] = { + /* 0x81 */ + 0x4e02, 0x4e04, 0x4e05, 0x4e06, 0x4e0f, 0x4e12, 0x4e17, 0x4e1f, + 0x4e20, 0x4e21, 0x4e23, 0x4e26, 0x4e29, 0x4e2e, 0x4e2f, 0x4e31, + 0x4e33, 0x4e35, 0x4e37, 0x4e3c, 0x4e40, 0x4e41, 0x4e42, 0x4e44, + 0x4e46, 0x4e4a, 0x4e51, 0x4e55, 0x4e57, 0x4e5a, 0x4e5b, 0x4e62, + 0x4e63, 0x4e64, 0x4e65, 0x4e67, 0x4e68, 0x4e6a, 0x4e6b, 0x4e6c, + 0x4e6d, 0x4e6e, 0x4e6f, 0x4e72, 0x4e74, 0x4e75, 0x4e76, 0x4e77, + 0x4e78, 0x4e79, 0x4e7a, 0x4e7b, 0x4e7c, 0x4e7d, 0x4e7f, 0x4e80, + 0x4e81, 0x4e82, 0x4e83, 0x4e84, 0x4e85, 0x4e87, 0x4e8a, 0x4e90, + 0x4e96, 0x4e97, 0x4e99, 0x4e9c, 0x4e9d, 0x4e9e, 0x4ea3, 0x4eaa, + 0x4eaf, 0x4eb0, 0x4eb1, 0x4eb4, 0x4eb6, 0x4eb7, 0x4eb8, 0x4eb9, + 0x4ebc, 0x4ebd, 0x4ebe, 0x4ec8, 0x4ecc, 0x4ecf, 0x4ed0, 0x4ed2, + 0x4eda, 0x4edb, 0x4edc, 0x4ee0, 0x4ee2, 0x4ee6, 0x4ee7, 0x4ee9, + 0x4eed, 0x4eee, 0x4eef, 0x4ef1, 0x4ef4, 0x4ef8, 0x4ef9, 0x4efa, + 0x4efc, 0x4efe, 0x4f00, 0x4f02, 0x4f03, 0x4f04, 0x4f05, 0x4f06, + 0x4f07, 0x4f08, 0x4f0b, 0x4f0c, 0x4f12, 0x4f13, 0x4f14, 0x4f15, + 0x4f16, 0x4f1c, 0x4f1d, 0x4f21, 0x4f23, 0x4f28, 0x4f29, 0x4f2c, + 0x4f2d, 0x4f2e, 0x4f31, 0x4f33, 0x4f35, 0x4f37, 0x4f39, 0x4f3b, + 0x4f3e, 0x4f3f, 0x4f40, 0x4f41, 0x4f42, 0x4f44, 0x4f45, 0x4f47, + 0x4f48, 0x4f49, 0x4f4a, 0x4f4b, 0x4f4c, 0x4f52, 0x4f54, 0x4f56, + 0x4f61, 0x4f62, 0x4f66, 0x4f68, 0x4f6a, 0x4f6b, 0x4f6d, 0x4f6e, + 0x4f71, 0x4f72, 0x4f75, 0x4f77, 0x4f78, 0x4f79, 0x4f7a, 0x4f7d, + 0x4f80, 0x4f81, 0x4f82, 0x4f85, 0x4f86, 0x4f87, 0x4f8a, 0x4f8c, + 0x4f8e, 0x4f90, 0x4f92, 0x4f93, 0x4f95, 0x4f96, 0x4f98, 0x4f99, + 0x4f9a, 0x4f9c, 0x4f9e, 0x4f9f, 0x4fa1, 0x4fa2, + /* 0x82 */ + 0x4fa4, 0x4fab, 0x4fad, 0x4fb0, 0x4fb1, 0x4fb2, 0x4fb3, 0x4fb4, + 0x4fb6, 0x4fb7, 0x4fb8, 0x4fb9, 0x4fba, 0x4fbb, 0x4fbc, 0x4fbd, + 0x4fbe, 0x4fc0, 0x4fc1, 0x4fc2, 0x4fc6, 0x4fc7, 0x4fc8, 0x4fc9, + 0x4fcb, 0x4fcc, 0x4fcd, 0x4fd2, 0x4fd3, 0x4fd4, 0x4fd5, 0x4fd6, + 0x4fd9, 0x4fdb, 0x4fe0, 0x4fe2, 0x4fe4, 0x4fe5, 0x4fe7, 0x4feb, + 0x4fec, 0x4ff0, 0x4ff2, 0x4ff4, 0x4ff5, 0x4ff6, 0x4ff7, 0x4ff9, + 0x4ffb, 0x4ffc, 0x4ffd, 0x4fff, 0x5000, 0x5001, 0x5002, 0x5003, + 0x5004, 0x5005, 0x5006, 0x5007, 0x5008, 0x5009, 0x500a, 0x500b, + 0x500e, 0x5010, 0x5011, 0x5013, 0x5015, 0x5016, 0x5017, 0x501b, + 0x501d, 0x501e, 0x5020, 0x5022, 0x5023, 0x5024, 0x5027, 0x502b, + 0x502f, 0x5030, 0x5031, 0x5032, 0x5033, 0x5034, 0x5035, 0x5036, + 0x5037, 0x5038, 0x5039, 0x503b, 0x503d, 0x503f, 0x5040, 0x5041, + 0x5042, 0x5044, 0x5045, 0x5046, 0x5049, 0x504a, 0x504b, 0x504d, + 0x5050, 0x5051, 0x5052, 0x5053, 0x5054, 0x5056, 0x5057, 0x5058, + 0x5059, 0x505b, 0x505d, 0x505e, 0x505f, 0x5060, 0x5061, 0x5062, + 0x5063, 0x5064, 0x5066, 0x5067, 0x5068, 0x5069, 0x506a, 0x506b, + 0x506d, 0x506e, 0x506f, 0x5070, 0x5071, 0x5072, 0x5073, 0x5074, + 0x5075, 0x5078, 0x5079, 0x507a, 0x507c, 0x507d, 0x5081, 0x5082, + 0x5083, 0x5084, 0x5086, 0x5087, 0x5089, 0x508a, 0x508b, 0x508c, + 0x508e, 0x508f, 0x5090, 0x5091, 0x5092, 0x5093, 0x5094, 0x5095, + 0x5096, 0x5097, 0x5098, 0x5099, 0x509a, 0x509b, 0x509c, 0x509d, + 0x509e, 0x509f, 0x50a0, 0x50a1, 0x50a2, 0x50a4, 0x50a6, 0x50aa, + 0x50ab, 0x50ad, 0x50ae, 0x50af, 0x50b0, 0x50b1, 0x50b3, 0x50b4, + 0x50b5, 0x50b6, 0x50b7, 0x50b8, 0x50b9, 0x50bc, + /* 0x83 */ + 0x50bd, 0x50be, 0x50bf, 0x50c0, 0x50c1, 0x50c2, 0x50c3, 0x50c4, + 0x50c5, 0x50c6, 0x50c7, 0x50c8, 0x50c9, 0x50ca, 0x50cb, 0x50cc, + 0x50cd, 0x50ce, 0x50d0, 0x50d1, 0x50d2, 0x50d3, 0x50d4, 0x50d5, + 0x50d7, 0x50d8, 0x50d9, 0x50db, 0x50dc, 0x50dd, 0x50de, 0x50df, + 0x50e0, 0x50e1, 0x50e2, 0x50e3, 0x50e4, 0x50e5, 0x50e8, 0x50e9, + 0x50ea, 0x50eb, 0x50ef, 0x50f0, 0x50f1, 0x50f2, 0x50f4, 0x50f6, + 0x50f7, 0x50f8, 0x50f9, 0x50fa, 0x50fc, 0x50fd, 0x50fe, 0x50ff, + 0x5100, 0x5101, 0x5102, 0x5103, 0x5104, 0x5105, 0x5108, 0x5109, + 0x510a, 0x510c, 0x510d, 0x510e, 0x510f, 0x5110, 0x5111, 0x5113, + 0x5114, 0x5115, 0x5116, 0x5117, 0x5118, 0x5119, 0x511a, 0x511b, + 0x511c, 0x511d, 0x511e, 0x511f, 0x5120, 0x5122, 0x5123, 0x5124, + 0x5125, 0x5126, 0x5127, 0x5128, 0x5129, 0x512a, 0x512b, 0x512c, + 0x512d, 0x512e, 0x512f, 0x5130, 0x5131, 0x5132, 0x5133, 0x5134, + 0x5135, 0x5136, 0x5137, 0x5138, 0x5139, 0x513a, 0x513b, 0x513c, + 0x513d, 0x513e, 0x5142, 0x5147, 0x514a, 0x514c, 0x514e, 0x514f, + 0x5150, 0x5152, 0x5153, 0x5157, 0x5158, 0x5159, 0x515b, 0x515d, + 0x515e, 0x515f, 0x5160, 0x5161, 0x5163, 0x5164, 0x5166, 0x5167, + 0x5169, 0x516a, 0x516f, 0x5172, 0x517a, 0x517e, 0x517f, 0x5183, + 0x5184, 0x5186, 0x5187, 0x518a, 0x518b, 0x518e, 0x518f, 0x5190, + 0x5191, 0x5193, 0x5194, 0x5198, 0x519a, 0x519d, 0x519e, 0x519f, + 0x51a1, 0x51a3, 0x51a6, 0x51a7, 0x51a8, 0x51a9, 0x51aa, 0x51ad, + 0x51ae, 0x51b4, 0x51b8, 0x51b9, 0x51ba, 0x51be, 0x51bf, 0x51c1, + 0x51c2, 0x51c3, 0x51c5, 0x51c8, 0x51ca, 0x51cd, 0x51ce, 0x51d0, + 0x51d2, 0x51d3, 0x51d4, 0x51d5, 0x51d6, 0x51d7, + /* 0x84 */ + 0x51d8, 0x51d9, 0x51da, 0x51dc, 0x51de, 0x51df, 0x51e2, 0x51e3, + 0x51e5, 0x51e6, 0x51e7, 0x51e8, 0x51e9, 0x51ea, 0x51ec, 0x51ee, + 0x51f1, 0x51f2, 0x51f4, 0x51f7, 0x51fe, 0x5204, 0x5205, 0x5209, + 0x520b, 0x520c, 0x520f, 0x5210, 0x5213, 0x5214, 0x5215, 0x521c, + 0x521e, 0x521f, 0x5221, 0x5222, 0x5223, 0x5225, 0x5226, 0x5227, + 0x522a, 0x522c, 0x522f, 0x5231, 0x5232, 0x5234, 0x5235, 0x523c, + 0x523e, 0x5244, 0x5245, 0x5246, 0x5247, 0x5248, 0x5249, 0x524b, + 0x524e, 0x524f, 0x5252, 0x5253, 0x5255, 0x5257, 0x5258, 0x5259, + 0x525a, 0x525b, 0x525d, 0x525f, 0x5260, 0x5262, 0x5263, 0x5264, + 0x5266, 0x5268, 0x526b, 0x526c, 0x526d, 0x526e, 0x5270, 0x5271, + 0x5273, 0x5274, 0x5275, 0x5276, 0x5277, 0x5278, 0x5279, 0x527a, + 0x527b, 0x527c, 0x527e, 0x5280, 0x5283, 0x5284, 0x5285, 0x5286, + 0x5287, 0x5289, 0x528a, 0x528b, 0x528c, 0x528d, 0x528e, 0x528f, + 0x5291, 0x5292, 0x5294, 0x5295, 0x5296, 0x5297, 0x5298, 0x5299, + 0x529a, 0x529c, 0x52a4, 0x52a5, 0x52a6, 0x52a7, 0x52ae, 0x52af, + 0x52b0, 0x52b4, 0x52b5, 0x52b6, 0x52b7, 0x52b8, 0x52b9, 0x52ba, + 0x52bb, 0x52bc, 0x52bd, 0x52c0, 0x52c1, 0x52c2, 0x52c4, 0x52c5, + 0x52c6, 0x52c8, 0x52ca, 0x52cc, 0x52cd, 0x52ce, 0x52cf, 0x52d1, + 0x52d3, 0x52d4, 0x52d5, 0x52d7, 0x52d9, 0x52da, 0x52db, 0x52dc, + 0x52dd, 0x52de, 0x52e0, 0x52e1, 0x52e2, 0x52e3, 0x52e5, 0x52e6, + 0x52e7, 0x52e8, 0x52e9, 0x52ea, 0x52eb, 0x52ec, 0x52ed, 0x52ee, + 0x52ef, 0x52f1, 0x52f2, 0x52f3, 0x52f4, 0x52f5, 0x52f6, 0x52f7, + 0x52f8, 0x52fb, 0x52fc, 0x52fd, 0x5301, 0x5302, 0x5303, 0x5304, + 0x5307, 0x5309, 0x530a, 0x530b, 0x530c, 0x530e, + /* 0x85 */ + 0x5311, 0x5312, 0x5313, 0x5314, 0x5318, 0x531b, 0x531c, 0x531e, + 0x531f, 0x5322, 0x5324, 0x5325, 0x5327, 0x5328, 0x5329, 0x532b, + 0x532c, 0x532d, 0x532f, 0x5330, 0x5331, 0x5332, 0x5333, 0x5334, + 0x5335, 0x5336, 0x5337, 0x5338, 0x533c, 0x533d, 0x5340, 0x5342, + 0x5344, 0x5346, 0x534b, 0x534c, 0x534d, 0x5350, 0x5354, 0x5358, + 0x5359, 0x535b, 0x535d, 0x5365, 0x5368, 0x536a, 0x536c, 0x536d, + 0x5372, 0x5376, 0x5379, 0x537b, 0x537c, 0x537d, 0x537e, 0x5380, + 0x5381, 0x5383, 0x5387, 0x5388, 0x538a, 0x538e, 0x538f, 0x5390, + 0x5391, 0x5392, 0x5393, 0x5394, 0x5396, 0x5397, 0x5399, 0x539b, + 0x539c, 0x539e, 0x53a0, 0x53a1, 0x53a4, 0x53a7, 0x53aa, 0x53ab, + 0x53ac, 0x53ad, 0x53af, 0x53b0, 0x53b1, 0x53b2, 0x53b3, 0x53b4, + 0x53b5, 0x53b7, 0x53b8, 0x53b9, 0x53ba, 0x53bc, 0x53bd, 0x53be, + 0x53c0, 0x53c3, 0x53c4, 0x53c5, 0x53c6, 0x53c7, 0x53ce, 0x53cf, + 0x53d0, 0x53d2, 0x53d3, 0x53d5, 0x53da, 0x53dc, 0x53dd, 0x53de, + 0x53e1, 0x53e2, 0x53e7, 0x53f4, 0x53fa, 0x53fe, 0x53ff, 0x5400, + 0x5402, 0x5405, 0x5407, 0x540b, 0x5414, 0x5418, 0x5419, 0x541a, + 0x541c, 0x5422, 0x5424, 0x5425, 0x542a, 0x5430, 0x5433, 0x5436, + 0x5437, 0x543a, 0x543d, 0x543f, 0x5441, 0x5442, 0x5444, 0x5445, + 0x5447, 0x5449, 0x544c, 0x544d, 0x544e, 0x544f, 0x5451, 0x545a, + 0x545d, 0x545e, 0x545f, 0x5460, 0x5461, 0x5463, 0x5465, 0x5467, + 0x5469, 0x546a, 0x546b, 0x546c, 0x546d, 0x546e, 0x546f, 0x5470, + 0x5474, 0x5479, 0x547a, 0x547e, 0x547f, 0x5481, 0x5483, 0x5485, + 0x5487, 0x5488, 0x5489, 0x548a, 0x548d, 0x5491, 0x5493, 0x5497, + 0x5498, 0x549c, 0x549e, 0x549f, 0x54a0, 0x54a1, + /* 0x86 */ + 0x54a2, 0x54a5, 0x54ae, 0x54b0, 0x54b2, 0x54b5, 0x54b6, 0x54b7, + 0x54b9, 0x54ba, 0x54bc, 0x54be, 0x54c3, 0x54c5, 0x54ca, 0x54cb, + 0x54d6, 0x54d8, 0x54db, 0x54e0, 0x54e1, 0x54e2, 0x54e3, 0x54e4, + 0x54eb, 0x54ec, 0x54ef, 0x54f0, 0x54f1, 0x54f4, 0x54f5, 0x54f6, + 0x54f7, 0x54f8, 0x54f9, 0x54fb, 0x54fe, 0x5500, 0x5502, 0x5503, + 0x5504, 0x5505, 0x5508, 0x550a, 0x550b, 0x550c, 0x550d, 0x550e, + 0x5512, 0x5513, 0x5515, 0x5516, 0x5517, 0x5518, 0x5519, 0x551a, + 0x551c, 0x551d, 0x551e, 0x551f, 0x5521, 0x5525, 0x5526, 0x5528, + 0x5529, 0x552b, 0x552d, 0x5532, 0x5534, 0x5535, 0x5536, 0x5538, + 0x5539, 0x553a, 0x553b, 0x553d, 0x5540, 0x5542, 0x5545, 0x5547, + 0x5548, 0x554b, 0x554c, 0x554d, 0x554e, 0x554f, 0x5551, 0x5552, + 0x5553, 0x5554, 0x5557, 0x5558, 0x5559, 0x555a, 0x555b, 0x555d, + 0x555e, 0x555f, 0x5560, 0x5562, 0x5563, 0x5568, 0x5569, 0x556b, + 0x556f, 0x5570, 0x5571, 0x5572, 0x5573, 0x5574, 0x5579, 0x557a, + 0x557d, 0x557f, 0x5585, 0x5586, 0x558c, 0x558d, 0x558e, 0x5590, + 0x5592, 0x5593, 0x5595, 0x5596, 0x5597, 0x559a, 0x559b, 0x559e, + 0x55a0, 0x55a1, 0x55a2, 0x55a3, 0x55a4, 0x55a5, 0x55a6, 0x55a8, + 0x55a9, 0x55aa, 0x55ab, 0x55ac, 0x55ad, 0x55ae, 0x55af, 0x55b0, + 0x55b2, 0x55b4, 0x55b6, 0x55b8, 0x55ba, 0x55bc, 0x55bf, 0x55c0, + 0x55c1, 0x55c2, 0x55c3, 0x55c6, 0x55c7, 0x55c8, 0x55ca, 0x55cb, + 0x55ce, 0x55cf, 0x55d0, 0x55d5, 0x55d7, 0x55d8, 0x55d9, 0x55da, + 0x55db, 0x55de, 0x55e0, 0x55e2, 0x55e7, 0x55e9, 0x55ed, 0x55ee, + 0x55f0, 0x55f1, 0x55f4, 0x55f6, 0x55f8, 0x55f9, 0x55fa, 0x55fb, + 0x55fc, 0x55ff, 0x5602, 0x5603, 0x5604, 0x5605, + /* 0x87 */ + 0x5606, 0x5607, 0x560a, 0x560b, 0x560d, 0x5610, 0x5611, 0x5612, + 0x5613, 0x5614, 0x5615, 0x5616, 0x5617, 0x5619, 0x561a, 0x561c, + 0x561d, 0x5620, 0x5621, 0x5622, 0x5625, 0x5626, 0x5628, 0x5629, + 0x562a, 0x562b, 0x562e, 0x562f, 0x5630, 0x5633, 0x5635, 0x5637, + 0x5638, 0x563a, 0x563c, 0x563d, 0x563e, 0x5640, 0x5641, 0x5642, + 0x5643, 0x5644, 0x5645, 0x5646, 0x5647, 0x5648, 0x5649, 0x564a, + 0x564b, 0x564f, 0x5650, 0x5651, 0x5652, 0x5653, 0x5655, 0x5656, + 0x565a, 0x565b, 0x565d, 0x565e, 0x565f, 0x5660, 0x5661, 0x5663, + 0x5665, 0x5666, 0x5667, 0x566d, 0x566e, 0x566f, 0x5670, 0x5672, + 0x5673, 0x5674, 0x5675, 0x5677, 0x5678, 0x5679, 0x567a, 0x567d, + 0x567e, 0x567f, 0x5680, 0x5681, 0x5682, 0x5683, 0x5684, 0x5687, + 0x5688, 0x5689, 0x568a, 0x568b, 0x568c, 0x568d, 0x5690, 0x5691, + 0x5692, 0x5694, 0x5695, 0x5696, 0x5697, 0x5698, 0x5699, 0x569a, + 0x569b, 0x569c, 0x569d, 0x569e, 0x569f, 0x56a0, 0x56a1, 0x56a2, + 0x56a4, 0x56a5, 0x56a6, 0x56a7, 0x56a8, 0x56a9, 0x56aa, 0x56ab, + 0x56ac, 0x56ad, 0x56ae, 0x56b0, 0x56b1, 0x56b2, 0x56b3, 0x56b4, + 0x56b5, 0x56b6, 0x56b8, 0x56b9, 0x56ba, 0x56bb, 0x56bd, 0x56be, + 0x56bf, 0x56c0, 0x56c1, 0x56c2, 0x56c3, 0x56c4, 0x56c5, 0x56c6, + 0x56c7, 0x56c8, 0x56c9, 0x56cb, 0x56cc, 0x56cd, 0x56ce, 0x56cf, + 0x56d0, 0x56d1, 0x56d2, 0x56d3, 0x56d5, 0x56d6, 0x56d8, 0x56d9, + 0x56dc, 0x56e3, 0x56e5, 0x56e6, 0x56e7, 0x56e8, 0x56e9, 0x56ea, + 0x56ec, 0x56ee, 0x56ef, 0x56f2, 0x56f3, 0x56f6, 0x56f7, 0x56f8, + 0x56fb, 0x56fc, 0x5700, 0x5701, 0x5702, 0x5705, 0x5707, 0x570b, + 0x570c, 0x570d, 0x570e, 0x570f, 0x5710, 0x5711, + /* 0x88 */ + 0x5712, 0x5713, 0x5714, 0x5715, 0x5716, 0x5717, 0x5718, 0x5719, + 0x571a, 0x571b, 0x571d, 0x571e, 0x5720, 0x5721, 0x5722, 0x5724, + 0x5725, 0x5726, 0x5727, 0x572b, 0x5731, 0x5732, 0x5734, 0x5735, + 0x5736, 0x5737, 0x5738, 0x573c, 0x573d, 0x573f, 0x5741, 0x5743, + 0x5744, 0x5745, 0x5746, 0x5748, 0x5749, 0x574b, 0x5752, 0x5753, + 0x5754, 0x5755, 0x5756, 0x5758, 0x5759, 0x5762, 0x5763, 0x5765, + 0x5767, 0x576c, 0x576e, 0x5770, 0x5771, 0x5772, 0x5774, 0x5775, + 0x5778, 0x5779, 0x577a, 0x577d, 0x577e, 0x577f, 0x5780, 0x5781, + 0x5787, 0x5788, 0x5789, 0x578a, 0x578d, 0x578e, 0x578f, 0x5790, + 0x5791, 0x5794, 0x5795, 0x5796, 0x5797, 0x5798, 0x5799, 0x579a, + 0x579c, 0x579d, 0x579e, 0x579f, 0x57a5, 0x57a8, 0x57aa, 0x57ac, + 0x57af, 0x57b0, 0x57b1, 0x57b3, 0x57b5, 0x57b6, 0x57b7, 0x57b9, + 0x57ba, 0x57bb, 0x57bc, 0x57bd, 0x57be, 0x57bf, 0x57c0, 0x57c1, + 0x57c4, 0x57c5, 0x57c6, 0x57c7, 0x57c8, 0x57c9, 0x57ca, 0x57cc, + 0x57cd, 0x57d0, 0x57d1, 0x57d3, 0x57d6, 0x57d7, 0x57db, 0x57dc, + 0x57de, 0x57e1, 0x57e2, 0x57e3, 0x57e5, 0x57e6, 0x57e7, 0x57e8, + 0x57e9, 0x57ea, 0x57eb, 0x57ec, 0x57ee, 0x57f0, 0x57f1, 0x57f2, + 0x57f3, 0x57f5, 0x57f6, 0x57f7, 0x57fb, 0x57fc, 0x57fe, 0x57ff, + 0x5801, 0x5803, 0x5804, 0x5805, 0x5808, 0x5809, 0x580a, 0x580c, + 0x580e, 0x580f, 0x5810, 0x5812, 0x5813, 0x5814, 0x5816, 0x5817, + 0x5818, 0x581a, 0x581b, 0x581c, 0x581d, 0x581f, 0x5822, 0x5823, + 0x5825, 0x5826, 0x5827, 0x5828, 0x5829, 0x582b, 0x582c, 0x582d, + 0x582e, 0x582f, 0x5831, 0x5832, 0x5833, 0x5834, 0x5836, 0x5837, + 0x5838, 0x5839, 0x583a, 0x583b, 0x583c, 0x583d, + /* 0x89 */ + 0x583e, 0x583f, 0x5840, 0x5841, 0x5842, 0x5843, 0x5845, 0x5846, + 0x5847, 0x5848, 0x5849, 0x584a, 0x584b, 0x584e, 0x584f, 0x5850, + 0x5852, 0x5853, 0x5855, 0x5856, 0x5857, 0x5859, 0x585a, 0x585b, + 0x585c, 0x585d, 0x585f, 0x5860, 0x5861, 0x5862, 0x5863, 0x5864, + 0x5866, 0x5867, 0x5868, 0x5869, 0x586a, 0x586d, 0x586e, 0x586f, + 0x5870, 0x5871, 0x5872, 0x5873, 0x5874, 0x5875, 0x5876, 0x5877, + 0x5878, 0x5879, 0x587a, 0x587b, 0x587c, 0x587d, 0x587f, 0x5882, + 0x5884, 0x5886, 0x5887, 0x5888, 0x588a, 0x588b, 0x588c, 0x588d, + 0x588e, 0x588f, 0x5890, 0x5891, 0x5894, 0x5895, 0x5896, 0x5897, + 0x5898, 0x589b, 0x589c, 0x589d, 0x58a0, 0x58a1, 0x58a2, 0x58a3, + 0x58a4, 0x58a5, 0x58a6, 0x58a7, 0x58aa, 0x58ab, 0x58ac, 0x58ad, + 0x58ae, 0x58af, 0x58b0, 0x58b1, 0x58b2, 0x58b3, 0x58b4, 0x58b5, + 0x58b6, 0x58b7, 0x58b8, 0x58b9, 0x58ba, 0x58bb, 0x58bd, 0x58be, + 0x58bf, 0x58c0, 0x58c2, 0x58c3, 0x58c4, 0x58c6, 0x58c7, 0x58c8, + 0x58c9, 0x58ca, 0x58cb, 0x58cc, 0x58cd, 0x58ce, 0x58cf, 0x58d0, + 0x58d2, 0x58d3, 0x58d4, 0x58d6, 0x58d7, 0x58d8, 0x58d9, 0x58da, + 0x58db, 0x58dc, 0x58dd, 0x58de, 0x58df, 0x58e0, 0x58e1, 0x58e2, + 0x58e3, 0x58e5, 0x58e6, 0x58e7, 0x58e8, 0x58e9, 0x58ea, 0x58ed, + 0x58ef, 0x58f1, 0x58f2, 0x58f4, 0x58f5, 0x58f7, 0x58f8, 0x58fa, + 0x58fb, 0x58fc, 0x58fd, 0x58fe, 0x58ff, 0x5900, 0x5901, 0x5903, + 0x5905, 0x5906, 0x5908, 0x5909, 0x590a, 0x590b, 0x590c, 0x590e, + 0x5910, 0x5911, 0x5912, 0x5913, 0x5917, 0x5918, 0x591b, 0x591d, + 0x591e, 0x5920, 0x5921, 0x5922, 0x5923, 0x5926, 0x5928, 0x592c, + 0x5930, 0x5932, 0x5933, 0x5935, 0x5936, 0x593b, + /* 0x8a */ + 0x593d, 0x593e, 0x593f, 0x5940, 0x5943, 0x5945, 0x5946, 0x594a, + 0x594c, 0x594d, 0x5950, 0x5952, 0x5953, 0x5959, 0x595b, 0x595c, + 0x595d, 0x595e, 0x595f, 0x5961, 0x5963, 0x5964, 0x5966, 0x5967, + 0x5968, 0x5969, 0x596a, 0x596b, 0x596c, 0x596d, 0x596e, 0x596f, + 0x5970, 0x5971, 0x5972, 0x5975, 0x5977, 0x597a, 0x597b, 0x597c, + 0x597e, 0x597f, 0x5980, 0x5985, 0x5989, 0x598b, 0x598c, 0x598e, + 0x598f, 0x5990, 0x5991, 0x5994, 0x5995, 0x5998, 0x599a, 0x599b, + 0x599c, 0x599d, 0x599f, 0x59a0, 0x59a1, 0x59a2, 0x59a6, 0x59a7, + 0x59ac, 0x59ad, 0x59b0, 0x59b1, 0x59b3, 0x59b4, 0x59b5, 0x59b6, + 0x59b7, 0x59b8, 0x59ba, 0x59bc, 0x59bd, 0x59bf, 0x59c0, 0x59c1, + 0x59c2, 0x59c3, 0x59c4, 0x59c5, 0x59c7, 0x59c8, 0x59c9, 0x59cc, + 0x59cd, 0x59ce, 0x59cf, 0x59d5, 0x59d6, 0x59d9, 0x59db, 0x59de, + 0x59df, 0x59e0, 0x59e1, 0x59e2, 0x59e4, 0x59e6, 0x59e7, 0x59e9, + 0x59ea, 0x59eb, 0x59ed, 0x59ee, 0x59ef, 0x59f0, 0x59f1, 0x59f2, + 0x59f3, 0x59f4, 0x59f5, 0x59f6, 0x59f7, 0x59f8, 0x59fa, 0x59fc, + 0x59fd, 0x59fe, 0x5a00, 0x5a02, 0x5a0a, 0x5a0b, 0x5a0d, 0x5a0e, + 0x5a0f, 0x5a10, 0x5a12, 0x5a14, 0x5a15, 0x5a16, 0x5a17, 0x5a19, + 0x5a1a, 0x5a1b, 0x5a1d, 0x5a1e, 0x5a21, 0x5a22, 0x5a24, 0x5a26, + 0x5a27, 0x5a28, 0x5a2a, 0x5a2b, 0x5a2c, 0x5a2d, 0x5a2e, 0x5a2f, + 0x5a30, 0x5a33, 0x5a35, 0x5a37, 0x5a38, 0x5a39, 0x5a3a, 0x5a3b, + 0x5a3d, 0x5a3e, 0x5a3f, 0x5a41, 0x5a42, 0x5a43, 0x5a44, 0x5a45, + 0x5a47, 0x5a48, 0x5a4b, 0x5a4c, 0x5a4d, 0x5a4e, 0x5a4f, 0x5a50, + 0x5a51, 0x5a52, 0x5a53, 0x5a54, 0x5a56, 0x5a57, 0x5a58, 0x5a59, + 0x5a5b, 0x5a5c, 0x5a5d, 0x5a5e, 0x5a5f, 0x5a60, + /* 0x8b */ + 0x5a61, 0x5a63, 0x5a64, 0x5a65, 0x5a66, 0x5a68, 0x5a69, 0x5a6b, + 0x5a6c, 0x5a6d, 0x5a6e, 0x5a6f, 0x5a70, 0x5a71, 0x5a72, 0x5a73, + 0x5a78, 0x5a79, 0x5a7b, 0x5a7c, 0x5a7d, 0x5a7e, 0x5a80, 0x5a81, + 0x5a82, 0x5a83, 0x5a84, 0x5a85, 0x5a86, 0x5a87, 0x5a88, 0x5a89, + 0x5a8a, 0x5a8b, 0x5a8c, 0x5a8d, 0x5a8e, 0x5a8f, 0x5a90, 0x5a91, + 0x5a93, 0x5a94, 0x5a95, 0x5a96, 0x5a97, 0x5a98, 0x5a99, 0x5a9c, + 0x5a9d, 0x5a9e, 0x5a9f, 0x5aa0, 0x5aa1, 0x5aa2, 0x5aa3, 0x5aa4, + 0x5aa5, 0x5aa6, 0x5aa7, 0x5aa8, 0x5aa9, 0x5aab, 0x5aac, 0x5aad, + 0x5aae, 0x5aaf, 0x5ab0, 0x5ab1, 0x5ab4, 0x5ab6, 0x5ab7, 0x5ab9, + 0x5aba, 0x5abb, 0x5abc, 0x5abd, 0x5abf, 0x5ac0, 0x5ac3, 0x5ac4, + 0x5ac5, 0x5ac6, 0x5ac7, 0x5ac8, 0x5aca, 0x5acb, 0x5acd, 0x5ace, + 0x5acf, 0x5ad0, 0x5ad1, 0x5ad3, 0x5ad5, 0x5ad7, 0x5ad9, 0x5ada, + 0x5adb, 0x5add, 0x5ade, 0x5adf, 0x5ae2, 0x5ae4, 0x5ae5, 0x5ae7, + 0x5ae8, 0x5aea, 0x5aec, 0x5aed, 0x5aee, 0x5aef, 0x5af0, 0x5af2, + 0x5af3, 0x5af4, 0x5af5, 0x5af6, 0x5af7, 0x5af8, 0x5af9, 0x5afa, + 0x5afb, 0x5afc, 0x5afd, 0x5afe, 0x5aff, 0x5b00, 0x5b01, 0x5b02, + 0x5b03, 0x5b04, 0x5b05, 0x5b06, 0x5b07, 0x5b08, 0x5b0a, 0x5b0b, + 0x5b0c, 0x5b0d, 0x5b0e, 0x5b0f, 0x5b10, 0x5b11, 0x5b12, 0x5b13, + 0x5b14, 0x5b15, 0x5b18, 0x5b19, 0x5b1a, 0x5b1b, 0x5b1c, 0x5b1d, + 0x5b1e, 0x5b1f, 0x5b20, 0x5b21, 0x5b22, 0x5b23, 0x5b24, 0x5b25, + 0x5b26, 0x5b27, 0x5b28, 0x5b29, 0x5b2a, 0x5b2b, 0x5b2c, 0x5b2d, + 0x5b2e, 0x5b2f, 0x5b30, 0x5b31, 0x5b33, 0x5b35, 0x5b36, 0x5b38, + 0x5b39, 0x5b3a, 0x5b3b, 0x5b3c, 0x5b3d, 0x5b3e, 0x5b3f, 0x5b41, + 0x5b42, 0x5b43, 0x5b44, 0x5b45, 0x5b46, 0x5b47, + /* 0x8c */ + 0x5b48, 0x5b49, 0x5b4a, 0x5b4b, 0x5b4c, 0x5b4d, 0x5b4e, 0x5b4f, + 0x5b52, 0x5b56, 0x5b5e, 0x5b60, 0x5b61, 0x5b67, 0x5b68, 0x5b6b, + 0x5b6d, 0x5b6e, 0x5b6f, 0x5b72, 0x5b74, 0x5b76, 0x5b77, 0x5b78, + 0x5b79, 0x5b7b, 0x5b7c, 0x5b7e, 0x5b7f, 0x5b82, 0x5b86, 0x5b8a, + 0x5b8d, 0x5b8e, 0x5b90, 0x5b91, 0x5b92, 0x5b94, 0x5b96, 0x5b9f, + 0x5ba7, 0x5ba8, 0x5ba9, 0x5bac, 0x5bad, 0x5bae, 0x5baf, 0x5bb1, + 0x5bb2, 0x5bb7, 0x5bba, 0x5bbb, 0x5bbc, 0x5bc0, 0x5bc1, 0x5bc3, + 0x5bc8, 0x5bc9, 0x5bca, 0x5bcb, 0x5bcd, 0x5bce, 0x5bcf, 0x5bd1, + 0x5bd4, 0x5bd5, 0x5bd6, 0x5bd7, 0x5bd8, 0x5bd9, 0x5bda, 0x5bdb, + 0x5bdc, 0x5be0, 0x5be2, 0x5be3, 0x5be6, 0x5be7, 0x5be9, 0x5bea, + 0x5beb, 0x5bec, 0x5bed, 0x5bef, 0x5bf1, 0x5bf2, 0x5bf3, 0x5bf4, + 0x5bf5, 0x5bf6, 0x5bf7, 0x5bfd, 0x5bfe, 0x5c00, 0x5c02, 0x5c03, + 0x5c05, 0x5c07, 0x5c08, 0x5c0b, 0x5c0c, 0x5c0d, 0x5c0e, 0x5c10, + 0x5c12, 0x5c13, 0x5c17, 0x5c19, 0x5c1b, 0x5c1e, 0x5c1f, 0x5c20, + 0x5c21, 0x5c23, 0x5c26, 0x5c28, 0x5c29, 0x5c2a, 0x5c2b, 0x5c2d, + 0x5c2e, 0x5c2f, 0x5c30, 0x5c32, 0x5c33, 0x5c35, 0x5c36, 0x5c37, + 0x5c43, 0x5c44, 0x5c46, 0x5c47, 0x5c4c, 0x5c4d, 0x5c52, 0x5c53, + 0x5c54, 0x5c56, 0x5c57, 0x5c58, 0x5c5a, 0x5c5b, 0x5c5c, 0x5c5d, + 0x5c5f, 0x5c62, 0x5c64, 0x5c67, 0x5c68, 0x5c69, 0x5c6a, 0x5c6b, + 0x5c6c, 0x5c6d, 0x5c70, 0x5c72, 0x5c73, 0x5c74, 0x5c75, 0x5c76, + 0x5c77, 0x5c78, 0x5c7b, 0x5c7c, 0x5c7d, 0x5c7e, 0x5c80, 0x5c83, + 0x5c84, 0x5c85, 0x5c86, 0x5c87, 0x5c89, 0x5c8a, 0x5c8b, 0x5c8e, + 0x5c8f, 0x5c92, 0x5c93, 0x5c95, 0x5c9d, 0x5c9e, 0x5c9f, 0x5ca0, + 0x5ca1, 0x5ca4, 0x5ca5, 0x5ca6, 0x5ca7, 0x5ca8, + /* 0x8d */ + 0x5caa, 0x5cae, 0x5caf, 0x5cb0, 0x5cb2, 0x5cb4, 0x5cb6, 0x5cb9, + 0x5cba, 0x5cbb, 0x5cbc, 0x5cbe, 0x5cc0, 0x5cc2, 0x5cc3, 0x5cc5, + 0x5cc6, 0x5cc7, 0x5cc8, 0x5cc9, 0x5cca, 0x5ccc, 0x5ccd, 0x5cce, + 0x5ccf, 0x5cd0, 0x5cd1, 0x5cd3, 0x5cd4, 0x5cd5, 0x5cd6, 0x5cd7, + 0x5cd8, 0x5cda, 0x5cdb, 0x5cdc, 0x5cdd, 0x5cde, 0x5cdf, 0x5ce0, + 0x5ce2, 0x5ce3, 0x5ce7, 0x5ce9, 0x5ceb, 0x5cec, 0x5cee, 0x5cef, + 0x5cf1, 0x5cf2, 0x5cf3, 0x5cf4, 0x5cf5, 0x5cf6, 0x5cf7, 0x5cf8, + 0x5cf9, 0x5cfa, 0x5cfc, 0x5cfd, 0x5cfe, 0x5cff, 0x5d00, 0x5d01, + 0x5d04, 0x5d05, 0x5d08, 0x5d09, 0x5d0a, 0x5d0b, 0x5d0c, 0x5d0d, + 0x5d0f, 0x5d10, 0x5d11, 0x5d12, 0x5d13, 0x5d15, 0x5d17, 0x5d18, + 0x5d19, 0x5d1a, 0x5d1c, 0x5d1d, 0x5d1f, 0x5d20, 0x5d21, 0x5d22, + 0x5d23, 0x5d25, 0x5d28, 0x5d2a, 0x5d2b, 0x5d2c, 0x5d2f, 0x5d30, + 0x5d31, 0x5d32, 0x5d33, 0x5d35, 0x5d36, 0x5d37, 0x5d38, 0x5d39, + 0x5d3a, 0x5d3b, 0x5d3c, 0x5d3f, 0x5d40, 0x5d41, 0x5d42, 0x5d43, + 0x5d44, 0x5d45, 0x5d46, 0x5d48, 0x5d49, 0x5d4d, 0x5d4e, 0x5d4f, + 0x5d50, 0x5d51, 0x5d52, 0x5d53, 0x5d54, 0x5d55, 0x5d56, 0x5d57, + 0x5d59, 0x5d5a, 0x5d5c, 0x5d5e, 0x5d5f, 0x5d60, 0x5d61, 0x5d62, + 0x5d63, 0x5d64, 0x5d65, 0x5d66, 0x5d67, 0x5d68, 0x5d6a, 0x5d6d, + 0x5d6e, 0x5d70, 0x5d71, 0x5d72, 0x5d73, 0x5d75, 0x5d76, 0x5d77, + 0x5d78, 0x5d79, 0x5d7a, 0x5d7b, 0x5d7c, 0x5d7d, 0x5d7e, 0x5d7f, + 0x5d80, 0x5d81, 0x5d83, 0x5d84, 0x5d85, 0x5d86, 0x5d87, 0x5d88, + 0x5d89, 0x5d8a, 0x5d8b, 0x5d8c, 0x5d8d, 0x5d8e, 0x5d8f, 0x5d90, + 0x5d91, 0x5d92, 0x5d93, 0x5d94, 0x5d95, 0x5d96, 0x5d97, 0x5d98, + 0x5d9a, 0x5d9b, 0x5d9c, 0x5d9e, 0x5d9f, 0x5da0, + /* 0x8e */ + 0x5da1, 0x5da2, 0x5da3, 0x5da4, 0x5da5, 0x5da6, 0x5da7, 0x5da8, + 0x5da9, 0x5daa, 0x5dab, 0x5dac, 0x5dad, 0x5dae, 0x5daf, 0x5db0, + 0x5db1, 0x5db2, 0x5db3, 0x5db4, 0x5db5, 0x5db6, 0x5db8, 0x5db9, + 0x5dba, 0x5dbb, 0x5dbc, 0x5dbd, 0x5dbe, 0x5dbf, 0x5dc0, 0x5dc1, + 0x5dc2, 0x5dc3, 0x5dc4, 0x5dc6, 0x5dc7, 0x5dc8, 0x5dc9, 0x5dca, + 0x5dcb, 0x5dcc, 0x5dce, 0x5dcf, 0x5dd0, 0x5dd1, 0x5dd2, 0x5dd3, + 0x5dd4, 0x5dd5, 0x5dd6, 0x5dd7, 0x5dd8, 0x5dd9, 0x5dda, 0x5ddc, + 0x5ddf, 0x5de0, 0x5de3, 0x5de4, 0x5dea, 0x5dec, 0x5ded, 0x5df0, + 0x5df5, 0x5df6, 0x5df8, 0x5df9, 0x5dfa, 0x5dfb, 0x5dfc, 0x5dff, + 0x5e00, 0x5e04, 0x5e07, 0x5e09, 0x5e0a, 0x5e0b, 0x5e0d, 0x5e0e, + 0x5e12, 0x5e13, 0x5e17, 0x5e1e, 0x5e1f, 0x5e20, 0x5e21, 0x5e22, + 0x5e23, 0x5e24, 0x5e25, 0x5e28, 0x5e29, 0x5e2a, 0x5e2b, 0x5e2c, + 0x5e2f, 0x5e30, 0x5e32, 0x5e33, 0x5e34, 0x5e35, 0x5e36, 0x5e39, + 0x5e3a, 0x5e3e, 0x5e3f, 0x5e40, 0x5e41, 0x5e43, 0x5e46, 0x5e47, + 0x5e48, 0x5e49, 0x5e4a, 0x5e4b, 0x5e4d, 0x5e4e, 0x5e4f, 0x5e50, + 0x5e51, 0x5e52, 0x5e53, 0x5e56, 0x5e57, 0x5e58, 0x5e59, 0x5e5a, + 0x5e5c, 0x5e5d, 0x5e5f, 0x5e60, 0x5e63, 0x5e64, 0x5e65, 0x5e66, + 0x5e67, 0x5e68, 0x5e69, 0x5e6a, 0x5e6b, 0x5e6c, 0x5e6d, 0x5e6e, + 0x5e6f, 0x5e70, 0x5e71, 0x5e75, 0x5e77, 0x5e79, 0x5e7e, 0x5e81, + 0x5e82, 0x5e83, 0x5e85, 0x5e88, 0x5e89, 0x5e8c, 0x5e8d, 0x5e8e, + 0x5e92, 0x5e98, 0x5e9b, 0x5e9d, 0x5ea1, 0x5ea2, 0x5ea3, 0x5ea4, + 0x5ea8, 0x5ea9, 0x5eaa, 0x5eab, 0x5eac, 0x5eae, 0x5eaf, 0x5eb0, + 0x5eb1, 0x5eb2, 0x5eb4, 0x5eba, 0x5ebb, 0x5ebc, 0x5ebd, 0x5ebf, + 0x5ec0, 0x5ec1, 0x5ec2, 0x5ec3, 0x5ec4, 0x5ec5, + /* 0x8f */ + 0x5ec6, 0x5ec7, 0x5ec8, 0x5ecb, 0x5ecc, 0x5ecd, 0x5ece, 0x5ecf, + 0x5ed0, 0x5ed4, 0x5ed5, 0x5ed7, 0x5ed8, 0x5ed9, 0x5eda, 0x5edc, + 0x5edd, 0x5ede, 0x5edf, 0x5ee0, 0x5ee1, 0x5ee2, 0x5ee3, 0x5ee4, + 0x5ee5, 0x5ee6, 0x5ee7, 0x5ee9, 0x5eeb, 0x5eec, 0x5eed, 0x5eee, + 0x5eef, 0x5ef0, 0x5ef1, 0x5ef2, 0x5ef3, 0x5ef5, 0x5ef8, 0x5ef9, + 0x5efb, 0x5efc, 0x5efd, 0x5f05, 0x5f06, 0x5f07, 0x5f09, 0x5f0c, + 0x5f0d, 0x5f0e, 0x5f10, 0x5f12, 0x5f14, 0x5f16, 0x5f19, 0x5f1a, + 0x5f1c, 0x5f1d, 0x5f1e, 0x5f21, 0x5f22, 0x5f23, 0x5f24, 0x5f28, + 0x5f2b, 0x5f2c, 0x5f2e, 0x5f30, 0x5f32, 0x5f33, 0x5f34, 0x5f35, + 0x5f36, 0x5f37, 0x5f38, 0x5f3b, 0x5f3d, 0x5f3e, 0x5f3f, 0x5f41, + 0x5f42, 0x5f43, 0x5f44, 0x5f45, 0x5f46, 0x5f47, 0x5f48, 0x5f49, + 0x5f4a, 0x5f4b, 0x5f4c, 0x5f4d, 0x5f4e, 0x5f4f, 0x5f51, 0x5f54, + 0x5f59, 0x5f5a, 0x5f5b, 0x5f5c, 0x5f5e, 0x5f5f, 0x5f60, 0x5f63, + 0x5f65, 0x5f67, 0x5f68, 0x5f6b, 0x5f6e, 0x5f6f, 0x5f72, 0x5f74, + 0x5f75, 0x5f76, 0x5f78, 0x5f7a, 0x5f7d, 0x5f7e, 0x5f7f, 0x5f83, + 0x5f86, 0x5f8d, 0x5f8e, 0x5f8f, 0x5f91, 0x5f93, 0x5f94, 0x5f96, + 0x5f9a, 0x5f9b, 0x5f9d, 0x5f9e, 0x5f9f, 0x5fa0, 0x5fa2, 0x5fa3, + 0x5fa4, 0x5fa5, 0x5fa6, 0x5fa7, 0x5fa9, 0x5fab, 0x5fac, 0x5faf, + 0x5fb0, 0x5fb1, 0x5fb2, 0x5fb3, 0x5fb4, 0x5fb6, 0x5fb8, 0x5fb9, + 0x5fba, 0x5fbb, 0x5fbe, 0x5fbf, 0x5fc0, 0x5fc1, 0x5fc2, 0x5fc7, + 0x5fc8, 0x5fca, 0x5fcb, 0x5fce, 0x5fd3, 0x5fd4, 0x5fd5, 0x5fda, + 0x5fdb, 0x5fdc, 0x5fde, 0x5fdf, 0x5fe2, 0x5fe3, 0x5fe5, 0x5fe6, + 0x5fe8, 0x5fe9, 0x5fec, 0x5fef, 0x5ff0, 0x5ff2, 0x5ff3, 0x5ff4, + 0x5ff6, 0x5ff7, 0x5ff9, 0x5ffa, 0x5ffc, 0x6007, + /* 0x90 */ + 0x6008, 0x6009, 0x600b, 0x600c, 0x6010, 0x6011, 0x6013, 0x6017, + 0x6018, 0x601a, 0x601e, 0x601f, 0x6022, 0x6023, 0x6024, 0x602c, + 0x602d, 0x602e, 0x6030, 0x6031, 0x6032, 0x6033, 0x6034, 0x6036, + 0x6037, 0x6038, 0x6039, 0x603a, 0x603d, 0x603e, 0x6040, 0x6044, + 0x6045, 0x6046, 0x6047, 0x6048, 0x6049, 0x604a, 0x604c, 0x604e, + 0x604f, 0x6051, 0x6053, 0x6054, 0x6056, 0x6057, 0x6058, 0x605b, + 0x605c, 0x605e, 0x605f, 0x6060, 0x6061, 0x6065, 0x6066, 0x606e, + 0x6071, 0x6072, 0x6074, 0x6075, 0x6077, 0x607e, 0x6080, 0x6081, + 0x6082, 0x6085, 0x6086, 0x6087, 0x6088, 0x608a, 0x608b, 0x608e, + 0x608f, 0x6090, 0x6091, 0x6093, 0x6095, 0x6097, 0x6098, 0x6099, + 0x609c, 0x609e, 0x60a1, 0x60a2, 0x60a4, 0x60a5, 0x60a7, 0x60a9, + 0x60aa, 0x60ae, 0x60b0, 0x60b3, 0x60b5, 0x60b6, 0x60b7, 0x60b9, + 0x60ba, 0x60bd, 0x60be, 0x60bf, 0x60c0, 0x60c1, 0x60c2, 0x60c3, + 0x60c4, 0x60c7, 0x60c8, 0x60c9, 0x60cc, 0x60cd, 0x60ce, 0x60cf, + 0x60d0, 0x60d2, 0x60d3, 0x60d4, 0x60d6, 0x60d7, 0x60d9, 0x60db, + 0x60de, 0x60e1, 0x60e2, 0x60e3, 0x60e4, 0x60e5, 0x60ea, 0x60f1, + 0x60f2, 0x60f5, 0x60f7, 0x60f8, 0x60fb, 0x60fc, 0x60fd, 0x60fe, + 0x60ff, 0x6102, 0x6103, 0x6104, 0x6105, 0x6107, 0x610a, 0x610b, + 0x610c, 0x6110, 0x6111, 0x6112, 0x6113, 0x6114, 0x6116, 0x6117, + 0x6118, 0x6119, 0x611b, 0x611c, 0x611d, 0x611e, 0x6121, 0x6122, + 0x6125, 0x6128, 0x6129, 0x612a, 0x612c, 0x612d, 0x612e, 0x612f, + 0x6130, 0x6131, 0x6132, 0x6133, 0x6134, 0x6135, 0x6136, 0x6137, + 0x6138, 0x6139, 0x613a, 0x613b, 0x613c, 0x613d, 0x613e, 0x6140, + 0x6141, 0x6142, 0x6143, 0x6144, 0x6145, 0x6146, + /* 0x91 */ + 0x6147, 0x6149, 0x614b, 0x614d, 0x614f, 0x6150, 0x6152, 0x6153, + 0x6154, 0x6156, 0x6157, 0x6158, 0x6159, 0x615a, 0x615b, 0x615c, + 0x615e, 0x615f, 0x6160, 0x6161, 0x6163, 0x6164, 0x6165, 0x6166, + 0x6169, 0x616a, 0x616b, 0x616c, 0x616d, 0x616e, 0x616f, 0x6171, + 0x6172, 0x6173, 0x6174, 0x6176, 0x6178, 0x6179, 0x617a, 0x617b, + 0x617c, 0x617d, 0x617e, 0x617f, 0x6180, 0x6181, 0x6182, 0x6183, + 0x6184, 0x6185, 0x6186, 0x6187, 0x6188, 0x6189, 0x618a, 0x618c, + 0x618d, 0x618f, 0x6190, 0x6191, 0x6192, 0x6193, 0x6195, 0x6196, + 0x6197, 0x6198, 0x6199, 0x619a, 0x619b, 0x619c, 0x619e, 0x619f, + 0x61a0, 0x61a1, 0x61a2, 0x61a3, 0x61a4, 0x61a5, 0x61a6, 0x61aa, + 0x61ab, 0x61ad, 0x61ae, 0x61af, 0x61b0, 0x61b1, 0x61b2, 0x61b3, + 0x61b4, 0x61b5, 0x61b6, 0x61b8, 0x61b9, 0x61ba, 0x61bb, 0x61bc, + 0x61bd, 0x61bf, 0x61c0, 0x61c1, 0x61c3, 0x61c4, 0x61c5, 0x61c6, + 0x61c7, 0x61c9, 0x61cc, 0x61cd, 0x61ce, 0x61cf, 0x61d0, 0x61d3, + 0x61d5, 0x61d6, 0x61d7, 0x61d8, 0x61d9, 0x61da, 0x61db, 0x61dc, + 0x61dd, 0x61de, 0x61df, 0x61e0, 0x61e1, 0x61e2, 0x61e3, 0x61e4, + 0x61e5, 0x61e7, 0x61e8, 0x61e9, 0x61ea, 0x61eb, 0x61ec, 0x61ed, + 0x61ee, 0x61ef, 0x61f0, 0x61f1, 0x61f2, 0x61f3, 0x61f4, 0x61f6, + 0x61f7, 0x61f8, 0x61f9, 0x61fa, 0x61fb, 0x61fc, 0x61fd, 0x61fe, + 0x6200, 0x6201, 0x6202, 0x6203, 0x6204, 0x6205, 0x6207, 0x6209, + 0x6213, 0x6214, 0x6219, 0x621c, 0x621d, 0x621e, 0x6220, 0x6223, + 0x6226, 0x6227, 0x6228, 0x6229, 0x622b, 0x622d, 0x622f, 0x6230, + 0x6231, 0x6232, 0x6235, 0x6236, 0x6238, 0x6239, 0x623a, 0x623b, + 0x623c, 0x6242, 0x6244, 0x6245, 0x6246, 0x624a, + /* 0x92 */ + 0x624f, 0x6250, 0x6255, 0x6256, 0x6257, 0x6259, 0x625a, 0x625c, + 0x625d, 0x625e, 0x625f, 0x6260, 0x6261, 0x6262, 0x6264, 0x6265, + 0x6268, 0x6271, 0x6272, 0x6274, 0x6275, 0x6277, 0x6278, 0x627a, + 0x627b, 0x627d, 0x6281, 0x6282, 0x6283, 0x6285, 0x6286, 0x6287, + 0x6288, 0x628b, 0x628c, 0x628d, 0x628e, 0x628f, 0x6290, 0x6294, + 0x6299, 0x629c, 0x629d, 0x629e, 0x62a3, 0x62a6, 0x62a7, 0x62a9, + 0x62aa, 0x62ad, 0x62ae, 0x62af, 0x62b0, 0x62b2, 0x62b3, 0x62b4, + 0x62b6, 0x62b7, 0x62b8, 0x62ba, 0x62be, 0x62c0, 0x62c1, 0x62c3, + 0x62cb, 0x62cf, 0x62d1, 0x62d5, 0x62dd, 0x62de, 0x62e0, 0x62e1, + 0x62e4, 0x62ea, 0x62eb, 0x62f0, 0x62f2, 0x62f5, 0x62f8, 0x62f9, + 0x62fa, 0x62fb, 0x6300, 0x6303, 0x6304, 0x6305, 0x6306, 0x630a, + 0x630b, 0x630c, 0x630d, 0x630f, 0x6310, 0x6312, 0x6313, 0x6314, + 0x6315, 0x6317, 0x6318, 0x6319, 0x631c, 0x6326, 0x6327, 0x6329, + 0x632c, 0x632d, 0x632e, 0x6330, 0x6331, 0x6333, 0x6334, 0x6335, + 0x6336, 0x6337, 0x6338, 0x633b, 0x633c, 0x633e, 0x633f, 0x6340, + 0x6341, 0x6344, 0x6347, 0x6348, 0x634a, 0x6351, 0x6352, 0x6353, + 0x6354, 0x6356, 0x6357, 0x6358, 0x6359, 0x635a, 0x635b, 0x635c, + 0x635d, 0x6360, 0x6364, 0x6365, 0x6366, 0x6368, 0x636a, 0x636b, + 0x636c, 0x636f, 0x6370, 0x6372, 0x6373, 0x6374, 0x6375, 0x6378, + 0x6379, 0x637c, 0x637d, 0x637e, 0x637f, 0x6381, 0x6383, 0x6384, + 0x6385, 0x6386, 0x638b, 0x638d, 0x6391, 0x6393, 0x6394, 0x6395, + 0x6397, 0x6399, 0x639a, 0x639b, 0x639c, 0x639d, 0x639e, 0x639f, + 0x63a1, 0x63a4, 0x63a6, 0x63ab, 0x63af, 0x63b1, 0x63b2, 0x63b5, + 0x63b6, 0x63b9, 0x63bb, 0x63bd, 0x63bf, 0x63c0, + /* 0x93 */ + 0x63c1, 0x63c2, 0x63c3, 0x63c5, 0x63c7, 0x63c8, 0x63ca, 0x63cb, + 0x63cc, 0x63d1, 0x63d3, 0x63d4, 0x63d5, 0x63d7, 0x63d8, 0x63d9, + 0x63da, 0x63db, 0x63dc, 0x63dd, 0x63df, 0x63e2, 0x63e4, 0x63e5, + 0x63e6, 0x63e7, 0x63e8, 0x63eb, 0x63ec, 0x63ee, 0x63ef, 0x63f0, + 0x63f1, 0x63f3, 0x63f5, 0x63f7, 0x63f9, 0x63fa, 0x63fb, 0x63fc, + 0x63fe, 0x6403, 0x6404, 0x6406, 0x6407, 0x6408, 0x6409, 0x640a, + 0x640d, 0x640e, 0x6411, 0x6412, 0x6415, 0x6416, 0x6417, 0x6418, + 0x6419, 0x641a, 0x641d, 0x641f, 0x6422, 0x6423, 0x6424, 0x6425, + 0x6427, 0x6428, 0x6429, 0x642b, 0x642e, 0x642f, 0x6430, 0x6431, + 0x6432, 0x6433, 0x6435, 0x6436, 0x6437, 0x6438, 0x6439, 0x643b, + 0x643c, 0x643e, 0x6440, 0x6442, 0x6443, 0x6449, 0x644b, 0x644c, + 0x644d, 0x644e, 0x644f, 0x6450, 0x6451, 0x6453, 0x6455, 0x6456, + 0x6457, 0x6459, 0x645a, 0x645b, 0x645c, 0x645d, 0x645f, 0x6460, + 0x6461, 0x6462, 0x6463, 0x6464, 0x6465, 0x6466, 0x6468, 0x646a, + 0x646b, 0x646c, 0x646e, 0x646f, 0x6470, 0x6471, 0x6472, 0x6473, + 0x6474, 0x6475, 0x6476, 0x6477, 0x647b, 0x647c, 0x647d, 0x647e, + 0x647f, 0x6480, 0x6481, 0x6483, 0x6486, 0x6488, 0x6489, 0x648a, + 0x648b, 0x648c, 0x648d, 0x648e, 0x648f, 0x6490, 0x6493, 0x6494, + 0x6497, 0x6498, 0x649a, 0x649b, 0x649c, 0x649d, 0x649f, 0x64a0, + 0x64a1, 0x64a2, 0x64a3, 0x64a5, 0x64a6, 0x64a7, 0x64a8, 0x64aa, + 0x64ab, 0x64af, 0x64b1, 0x64b2, 0x64b3, 0x64b4, 0x64b6, 0x64b9, + 0x64bb, 0x64bd, 0x64be, 0x64bf, 0x64c1, 0x64c3, 0x64c4, 0x64c6, + 0x64c7, 0x64c8, 0x64c9, 0x64ca, 0x64cb, 0x64cc, 0x64cf, 0x64d1, + 0x64d3, 0x64d4, 0x64d5, 0x64d6, 0x64d9, 0x64da, + /* 0x94 */ + 0x64db, 0x64dc, 0x64dd, 0x64df, 0x64e0, 0x64e1, 0x64e3, 0x64e5, + 0x64e7, 0x64e8, 0x64e9, 0x64ea, 0x64eb, 0x64ec, 0x64ed, 0x64ee, + 0x64ef, 0x64f0, 0x64f1, 0x64f2, 0x64f3, 0x64f4, 0x64f5, 0x64f6, + 0x64f7, 0x64f8, 0x64f9, 0x64fa, 0x64fb, 0x64fc, 0x64fd, 0x64fe, + 0x64ff, 0x6501, 0x6502, 0x6503, 0x6504, 0x6505, 0x6506, 0x6507, + 0x6508, 0x650a, 0x650b, 0x650c, 0x650d, 0x650e, 0x650f, 0x6510, + 0x6511, 0x6513, 0x6514, 0x6515, 0x6516, 0x6517, 0x6519, 0x651a, + 0x651b, 0x651c, 0x651d, 0x651e, 0x651f, 0x6520, 0x6521, 0x6522, + 0x6523, 0x6524, 0x6526, 0x6527, 0x6528, 0x6529, 0x652a, 0x652c, + 0x652d, 0x6530, 0x6531, 0x6532, 0x6533, 0x6537, 0x653a, 0x653c, + 0x653d, 0x6540, 0x6541, 0x6542, 0x6543, 0x6544, 0x6546, 0x6547, + 0x654a, 0x654b, 0x654d, 0x654e, 0x6550, 0x6552, 0x6553, 0x6554, + 0x6557, 0x6558, 0x655a, 0x655c, 0x655f, 0x6560, 0x6561, 0x6564, + 0x6565, 0x6567, 0x6568, 0x6569, 0x656a, 0x656d, 0x656e, 0x656f, + 0x6571, 0x6573, 0x6575, 0x6576, 0x6578, 0x6579, 0x657a, 0x657b, + 0x657c, 0x657d, 0x657e, 0x657f, 0x6580, 0x6581, 0x6582, 0x6583, + 0x6584, 0x6585, 0x6586, 0x6588, 0x6589, 0x658a, 0x658d, 0x658e, + 0x658f, 0x6592, 0x6594, 0x6595, 0x6596, 0x6598, 0x659a, 0x659d, + 0x659e, 0x65a0, 0x65a2, 0x65a3, 0x65a6, 0x65a8, 0x65aa, 0x65ac, + 0x65ae, 0x65b1, 0x65b2, 0x65b3, 0x65b4, 0x65b5, 0x65b6, 0x65b7, + 0x65b8, 0x65ba, 0x65bb, 0x65be, 0x65bf, 0x65c0, 0x65c2, 0x65c7, + 0x65c8, 0x65c9, 0x65ca, 0x65cd, 0x65d0, 0x65d1, 0x65d3, 0x65d4, + 0x65d5, 0x65d8, 0x65d9, 0x65da, 0x65db, 0x65dc, 0x65dd, 0x65de, + 0x65df, 0x65e1, 0x65e3, 0x65e4, 0x65ea, 0x65eb, + /* 0x95 */ + 0x65f2, 0x65f3, 0x65f4, 0x65f5, 0x65f8, 0x65f9, 0x65fb, 0x65fc, + 0x65fd, 0x65fe, 0x65ff, 0x6601, 0x6604, 0x6605, 0x6607, 0x6608, + 0x6609, 0x660b, 0x660d, 0x6610, 0x6611, 0x6612, 0x6616, 0x6617, + 0x6618, 0x661a, 0x661b, 0x661c, 0x661e, 0x6621, 0x6622, 0x6623, + 0x6624, 0x6626, 0x6629, 0x662a, 0x662b, 0x662c, 0x662e, 0x6630, + 0x6632, 0x6633, 0x6637, 0x6638, 0x6639, 0x663a, 0x663b, 0x663d, + 0x663f, 0x6640, 0x6642, 0x6644, 0x6645, 0x6646, 0x6647, 0x6648, + 0x6649, 0x664a, 0x664d, 0x664e, 0x6650, 0x6651, 0x6658, 0x6659, + 0x665b, 0x665c, 0x665d, 0x665e, 0x6660, 0x6662, 0x6663, 0x6665, + 0x6667, 0x6669, 0x666a, 0x666b, 0x666c, 0x666d, 0x6671, 0x6672, + 0x6673, 0x6675, 0x6678, 0x6679, 0x667b, 0x667c, 0x667d, 0x667f, + 0x6680, 0x6681, 0x6683, 0x6685, 0x6686, 0x6688, 0x6689, 0x668a, + 0x668b, 0x668d, 0x668e, 0x668f, 0x6690, 0x6692, 0x6693, 0x6694, + 0x6695, 0x6698, 0x6699, 0x669a, 0x669b, 0x669c, 0x669e, 0x669f, + 0x66a0, 0x66a1, 0x66a2, 0x66a3, 0x66a4, 0x66a5, 0x66a6, 0x66a9, + 0x66aa, 0x66ab, 0x66ac, 0x66ad, 0x66af, 0x66b0, 0x66b1, 0x66b2, + 0x66b3, 0x66b5, 0x66b6, 0x66b7, 0x66b8, 0x66ba, 0x66bb, 0x66bc, + 0x66bd, 0x66bf, 0x66c0, 0x66c1, 0x66c2, 0x66c3, 0x66c4, 0x66c5, + 0x66c6, 0x66c7, 0x66c8, 0x66c9, 0x66ca, 0x66cb, 0x66cc, 0x66cd, + 0x66ce, 0x66cf, 0x66d0, 0x66d1, 0x66d2, 0x66d3, 0x66d4, 0x66d5, + 0x66d6, 0x66d7, 0x66d8, 0x66da, 0x66de, 0x66df, 0x66e0, 0x66e1, + 0x66e2, 0x66e3, 0x66e4, 0x66e5, 0x66e7, 0x66e8, 0x66ea, 0x66eb, + 0x66ec, 0x66ed, 0x66ee, 0x66ef, 0x66f1, 0x66f5, 0x66f6, 0x66f8, + 0x66fa, 0x66fb, 0x66fd, 0x6701, 0x6702, 0x6703, + /* 0x96 */ + 0x6704, 0x6705, 0x6706, 0x6707, 0x670c, 0x670e, 0x670f, 0x6711, + 0x6712, 0x6713, 0x6716, 0x6718, 0x6719, 0x671a, 0x671c, 0x671e, + 0x6720, 0x6721, 0x6722, 0x6723, 0x6724, 0x6725, 0x6727, 0x6729, + 0x672e, 0x6730, 0x6732, 0x6733, 0x6736, 0x6737, 0x6738, 0x6739, + 0x673b, 0x673c, 0x673e, 0x673f, 0x6741, 0x6744, 0x6745, 0x6747, + 0x674a, 0x674b, 0x674d, 0x6752, 0x6754, 0x6755, 0x6757, 0x6758, + 0x6759, 0x675a, 0x675b, 0x675d, 0x6762, 0x6763, 0x6764, 0x6766, + 0x6767, 0x676b, 0x676c, 0x676e, 0x6771, 0x6774, 0x6776, 0x6778, + 0x6779, 0x677a, 0x677b, 0x677d, 0x6780, 0x6782, 0x6783, 0x6785, + 0x6786, 0x6788, 0x678a, 0x678c, 0x678d, 0x678e, 0x678f, 0x6791, + 0x6792, 0x6793, 0x6794, 0x6796, 0x6799, 0x679b, 0x679f, 0x67a0, + 0x67a1, 0x67a4, 0x67a6, 0x67a9, 0x67ac, 0x67ae, 0x67b1, 0x67b2, + 0x67b4, 0x67b9, 0x67ba, 0x67bb, 0x67bc, 0x67bd, 0x67be, 0x67bf, + 0x67c0, 0x67c2, 0x67c5, 0x67c6, 0x67c7, 0x67c8, 0x67c9, 0x67ca, + 0x67cb, 0x67cc, 0x67cd, 0x67ce, 0x67d5, 0x67d6, 0x67d7, 0x67db, + 0x67df, 0x67e1, 0x67e3, 0x67e4, 0x67e6, 0x67e7, 0x67e8, 0x67ea, + 0x67eb, 0x67ed, 0x67ee, 0x67f2, 0x67f5, 0x67f6, 0x67f7, 0x67f8, + 0x67f9, 0x67fa, 0x67fb, 0x67fc, 0x67fe, 0x6801, 0x6802, 0x6803, + 0x6804, 0x6806, 0x680d, 0x6810, 0x6812, 0x6814, 0x6815, 0x6818, + 0x6819, 0x681a, 0x681b, 0x681c, 0x681e, 0x681f, 0x6820, 0x6822, + 0x6823, 0x6824, 0x6825, 0x6826, 0x6827, 0x6828, 0x682b, 0x682c, + 0x682d, 0x682e, 0x682f, 0x6830, 0x6831, 0x6834, 0x6835, 0x6836, + 0x683a, 0x683b, 0x683f, 0x6847, 0x684b, 0x684d, 0x684f, 0x6852, + 0x6856, 0x6857, 0x6858, 0x6859, 0x685a, 0x685b, + /* 0x97 */ + 0x685c, 0x685d, 0x685e, 0x685f, 0x686a, 0x686c, 0x686d, 0x686e, + 0x686f, 0x6870, 0x6871, 0x6872, 0x6873, 0x6875, 0x6878, 0x6879, + 0x687a, 0x687b, 0x687c, 0x687d, 0x687e, 0x687f, 0x6880, 0x6882, + 0x6884, 0x6887, 0x6888, 0x6889, 0x688a, 0x688b, 0x688c, 0x688d, + 0x688e, 0x6890, 0x6891, 0x6892, 0x6894, 0x6895, 0x6896, 0x6898, + 0x6899, 0x689a, 0x689b, 0x689c, 0x689d, 0x689e, 0x689f, 0x68a0, + 0x68a1, 0x68a3, 0x68a4, 0x68a5, 0x68a9, 0x68aa, 0x68ab, 0x68ac, + 0x68ae, 0x68b1, 0x68b2, 0x68b4, 0x68b6, 0x68b7, 0x68b8, 0x68b9, + 0x68ba, 0x68bb, 0x68bc, 0x68bd, 0x68be, 0x68bf, 0x68c1, 0x68c3, + 0x68c4, 0x68c5, 0x68c6, 0x68c7, 0x68c8, 0x68ca, 0x68cc, 0x68ce, + 0x68cf, 0x68d0, 0x68d1, 0x68d3, 0x68d4, 0x68d6, 0x68d7, 0x68d9, + 0x68db, 0x68dc, 0x68dd, 0x68de, 0x68df, 0x68e1, 0x68e2, 0x68e4, + 0x68e5, 0x68e6, 0x68e7, 0x68e8, 0x68e9, 0x68ea, 0x68eb, 0x68ec, + 0x68ed, 0x68ef, 0x68f2, 0x68f3, 0x68f4, 0x68f6, 0x68f7, 0x68f8, + 0x68fb, 0x68fd, 0x68fe, 0x68ff, 0x6900, 0x6902, 0x6903, 0x6904, + 0x6906, 0x6907, 0x6908, 0x6909, 0x690a, 0x690c, 0x690f, 0x6911, + 0x6913, 0x6914, 0x6915, 0x6916, 0x6917, 0x6918, 0x6919, 0x691a, + 0x691b, 0x691c, 0x691d, 0x691e, 0x6921, 0x6922, 0x6923, 0x6925, + 0x6926, 0x6927, 0x6928, 0x6929, 0x692a, 0x692b, 0x692c, 0x692e, + 0x692f, 0x6931, 0x6932, 0x6933, 0x6935, 0x6936, 0x6937, 0x6938, + 0x693a, 0x693b, 0x693c, 0x693e, 0x6940, 0x6941, 0x6943, 0x6944, + 0x6945, 0x6946, 0x6947, 0x6948, 0x6949, 0x694a, 0x694b, 0x694c, + 0x694d, 0x694e, 0x694f, 0x6950, 0x6951, 0x6952, 0x6953, 0x6955, + 0x6956, 0x6958, 0x6959, 0x695b, 0x695c, 0x695f, + /* 0x98 */ + 0x6961, 0x6962, 0x6964, 0x6965, 0x6967, 0x6968, 0x6969, 0x696a, + 0x696c, 0x696d, 0x696f, 0x6970, 0x6972, 0x6973, 0x6974, 0x6975, + 0x6976, 0x697a, 0x697b, 0x697d, 0x697e, 0x697f, 0x6981, 0x6983, + 0x6985, 0x698a, 0x698b, 0x698c, 0x698e, 0x698f, 0x6990, 0x6991, + 0x6992, 0x6993, 0x6996, 0x6997, 0x6999, 0x699a, 0x699d, 0x699e, + 0x699f, 0x69a0, 0x69a1, 0x69a2, 0x69a3, 0x69a4, 0x69a5, 0x69a6, + 0x69a9, 0x69aa, 0x69ac, 0x69ae, 0x69af, 0x69b0, 0x69b2, 0x69b3, + 0x69b5, 0x69b6, 0x69b8, 0x69b9, 0x69ba, 0x69bc, 0x69bd, 0x69be, + 0x69bf, 0x69c0, 0x69c2, 0x69c3, 0x69c4, 0x69c5, 0x69c6, 0x69c7, + 0x69c8, 0x69c9, 0x69cb, 0x69cd, 0x69cf, 0x69d1, 0x69d2, 0x69d3, + 0x69d5, 0x69d6, 0x69d7, 0x69d8, 0x69d9, 0x69da, 0x69dc, 0x69dd, + 0x69de, 0x69e1, 0x69e2, 0x69e3, 0x69e4, 0x69e5, 0x69e6, 0x69e7, + 0x69e8, 0x69e9, 0x69ea, 0x69eb, 0x69ec, 0x69ee, 0x69ef, 0x69f0, + 0x69f1, 0x69f3, 0x69f4, 0x69f5, 0x69f6, 0x69f7, 0x69f8, 0x69f9, + 0x69fa, 0x69fb, 0x69fc, 0x69fe, 0x6a00, 0x6a01, 0x6a02, 0x6a03, + 0x6a04, 0x6a05, 0x6a06, 0x6a07, 0x6a08, 0x6a09, 0x6a0b, 0x6a0c, + 0x6a0d, 0x6a0e, 0x6a0f, 0x6a10, 0x6a11, 0x6a12, 0x6a13, 0x6a14, + 0x6a15, 0x6a16, 0x6a19, 0x6a1a, 0x6a1b, 0x6a1c, 0x6a1d, 0x6a1e, + 0x6a20, 0x6a22, 0x6a23, 0x6a24, 0x6a25, 0x6a26, 0x6a27, 0x6a29, + 0x6a2b, 0x6a2c, 0x6a2d, 0x6a2e, 0x6a30, 0x6a32, 0x6a33, 0x6a34, + 0x6a36, 0x6a37, 0x6a38, 0x6a39, 0x6a3a, 0x6a3b, 0x6a3c, 0x6a3f, + 0x6a40, 0x6a41, 0x6a42, 0x6a43, 0x6a45, 0x6a46, 0x6a48, 0x6a49, + 0x6a4a, 0x6a4b, 0x6a4c, 0x6a4d, 0x6a4e, 0x6a4f, 0x6a51, 0x6a52, + 0x6a53, 0x6a54, 0x6a55, 0x6a56, 0x6a57, 0x6a5a, + /* 0x99 */ + 0x6a5c, 0x6a5d, 0x6a5e, 0x6a5f, 0x6a60, 0x6a62, 0x6a63, 0x6a64, + 0x6a66, 0x6a67, 0x6a68, 0x6a69, 0x6a6a, 0x6a6b, 0x6a6c, 0x6a6d, + 0x6a6e, 0x6a6f, 0x6a70, 0x6a72, 0x6a73, 0x6a74, 0x6a75, 0x6a76, + 0x6a77, 0x6a78, 0x6a7a, 0x6a7b, 0x6a7d, 0x6a7e, 0x6a7f, 0x6a81, + 0x6a82, 0x6a83, 0x6a85, 0x6a86, 0x6a87, 0x6a88, 0x6a89, 0x6a8a, + 0x6a8b, 0x6a8c, 0x6a8d, 0x6a8f, 0x6a92, 0x6a93, 0x6a94, 0x6a95, + 0x6a96, 0x6a98, 0x6a99, 0x6a9a, 0x6a9b, 0x6a9c, 0x6a9d, 0x6a9e, + 0x6a9f, 0x6aa1, 0x6aa2, 0x6aa3, 0x6aa4, 0x6aa5, 0x6aa6, 0x6aa7, + 0x6aa8, 0x6aaa, 0x6aad, 0x6aae, 0x6aaf, 0x6ab0, 0x6ab1, 0x6ab2, + 0x6ab3, 0x6ab4, 0x6ab5, 0x6ab6, 0x6ab7, 0x6ab8, 0x6ab9, 0x6aba, + 0x6abb, 0x6abc, 0x6abd, 0x6abe, 0x6abf, 0x6ac0, 0x6ac1, 0x6ac2, + 0x6ac3, 0x6ac4, 0x6ac5, 0x6ac6, 0x6ac7, 0x6ac8, 0x6ac9, 0x6aca, + 0x6acb, 0x6acc, 0x6acd, 0x6ace, 0x6acf, 0x6ad0, 0x6ad1, 0x6ad2, + 0x6ad3, 0x6ad4, 0x6ad5, 0x6ad6, 0x6ad7, 0x6ad8, 0x6ad9, 0x6ada, + 0x6adb, 0x6adc, 0x6add, 0x6ade, 0x6adf, 0x6ae0, 0x6ae1, 0x6ae2, + 0x6ae3, 0x6ae4, 0x6ae5, 0x6ae6, 0x6ae7, 0x6ae8, 0x6ae9, 0x6aea, + 0x6aeb, 0x6aec, 0x6aed, 0x6aee, 0x6aef, 0x6af0, 0x6af1, 0x6af2, + 0x6af3, 0x6af4, 0x6af5, 0x6af6, 0x6af7, 0x6af8, 0x6af9, 0x6afa, + 0x6afb, 0x6afc, 0x6afd, 0x6afe, 0x6aff, 0x6b00, 0x6b01, 0x6b02, + 0x6b03, 0x6b04, 0x6b05, 0x6b06, 0x6b07, 0x6b08, 0x6b09, 0x6b0a, + 0x6b0b, 0x6b0c, 0x6b0d, 0x6b0e, 0x6b0f, 0x6b10, 0x6b11, 0x6b12, + 0x6b13, 0x6b14, 0x6b15, 0x6b16, 0x6b17, 0x6b18, 0x6b19, 0x6b1a, + 0x6b1b, 0x6b1c, 0x6b1d, 0x6b1e, 0x6b1f, 0x6b25, 0x6b26, 0x6b28, + 0x6b29, 0x6b2a, 0x6b2b, 0x6b2c, 0x6b2d, 0x6b2e, + /* 0x9a */ + 0x6b2f, 0x6b30, 0x6b31, 0x6b33, 0x6b34, 0x6b35, 0x6b36, 0x6b38, + 0x6b3b, 0x6b3c, 0x6b3d, 0x6b3f, 0x6b40, 0x6b41, 0x6b42, 0x6b44, + 0x6b45, 0x6b48, 0x6b4a, 0x6b4b, 0x6b4d, 0x6b4e, 0x6b4f, 0x6b50, + 0x6b51, 0x6b52, 0x6b53, 0x6b54, 0x6b55, 0x6b56, 0x6b57, 0x6b58, + 0x6b5a, 0x6b5b, 0x6b5c, 0x6b5d, 0x6b5e, 0x6b5f, 0x6b60, 0x6b61, + 0x6b68, 0x6b69, 0x6b6b, 0x6b6c, 0x6b6d, 0x6b6e, 0x6b6f, 0x6b70, + 0x6b71, 0x6b72, 0x6b73, 0x6b74, 0x6b75, 0x6b76, 0x6b77, 0x6b78, + 0x6b7a, 0x6b7d, 0x6b7e, 0x6b7f, 0x6b80, 0x6b85, 0x6b88, 0x6b8c, + 0x6b8e, 0x6b8f, 0x6b90, 0x6b91, 0x6b94, 0x6b95, 0x6b97, 0x6b98, + 0x6b99, 0x6b9c, 0x6b9d, 0x6b9e, 0x6b9f, 0x6ba0, 0x6ba2, 0x6ba3, + 0x6ba4, 0x6ba5, 0x6ba6, 0x6ba7, 0x6ba8, 0x6ba9, 0x6bab, 0x6bac, + 0x6bad, 0x6bae, 0x6baf, 0x6bb0, 0x6bb1, 0x6bb2, 0x6bb6, 0x6bb8, + 0x6bb9, 0x6bba, 0x6bbb, 0x6bbc, 0x6bbd, 0x6bbe, 0x6bc0, 0x6bc3, + 0x6bc4, 0x6bc6, 0x6bc7, 0x6bc8, 0x6bc9, 0x6bca, 0x6bcc, 0x6bce, + 0x6bd0, 0x6bd1, 0x6bd8, 0x6bda, 0x6bdc, 0x6bdd, 0x6bde, 0x6bdf, + 0x6be0, 0x6be2, 0x6be3, 0x6be4, 0x6be5, 0x6be6, 0x6be7, 0x6be8, + 0x6be9, 0x6bec, 0x6bed, 0x6bee, 0x6bf0, 0x6bf1, 0x6bf2, 0x6bf4, + 0x6bf6, 0x6bf7, 0x6bf8, 0x6bfa, 0x6bfb, 0x6bfc, 0x6bfe, 0x6bff, + 0x6c00, 0x6c01, 0x6c02, 0x6c03, 0x6c04, 0x6c08, 0x6c09, 0x6c0a, + 0x6c0b, 0x6c0c, 0x6c0e, 0x6c12, 0x6c17, 0x6c1c, 0x6c1d, 0x6c1e, + 0x6c20, 0x6c23, 0x6c25, 0x6c2b, 0x6c2c, 0x6c2d, 0x6c31, 0x6c33, + 0x6c36, 0x6c37, 0x6c39, 0x6c3a, 0x6c3b, 0x6c3c, 0x6c3e, 0x6c3f, + 0x6c43, 0x6c44, 0x6c45, 0x6c48, 0x6c4b, 0x6c4c, 0x6c4d, 0x6c4e, + 0x6c4f, 0x6c51, 0x6c52, 0x6c53, 0x6c56, 0x6c58, + /* 0x9b */ + 0x6c59, 0x6c5a, 0x6c62, 0x6c63, 0x6c65, 0x6c66, 0x6c67, 0x6c6b, + 0x6c6c, 0x6c6d, 0x6c6e, 0x6c6f, 0x6c71, 0x6c73, 0x6c75, 0x6c77, + 0x6c78, 0x6c7a, 0x6c7b, 0x6c7c, 0x6c7f, 0x6c80, 0x6c84, 0x6c87, + 0x6c8a, 0x6c8b, 0x6c8d, 0x6c8e, 0x6c91, 0x6c92, 0x6c95, 0x6c96, + 0x6c97, 0x6c98, 0x6c9a, 0x6c9c, 0x6c9d, 0x6c9e, 0x6ca0, 0x6ca2, + 0x6ca8, 0x6cac, 0x6caf, 0x6cb0, 0x6cb4, 0x6cb5, 0x6cb6, 0x6cb7, + 0x6cba, 0x6cc0, 0x6cc1, 0x6cc2, 0x6cc3, 0x6cc6, 0x6cc7, 0x6cc8, + 0x6ccb, 0x6ccd, 0x6cce, 0x6ccf, 0x6cd1, 0x6cd2, 0x6cd8, 0x6cd9, + 0x6cda, 0x6cdc, 0x6cdd, 0x6cdf, 0x6ce4, 0x6ce6, 0x6ce7, 0x6ce9, + 0x6cec, 0x6ced, 0x6cf2, 0x6cf4, 0x6cf9, 0x6cff, 0x6d00, 0x6d02, + 0x6d03, 0x6d05, 0x6d06, 0x6d08, 0x6d09, 0x6d0a, 0x6d0d, 0x6d0f, + 0x6d10, 0x6d11, 0x6d13, 0x6d14, 0x6d15, 0x6d16, 0x6d18, 0x6d1c, + 0x6d1d, 0x6d1f, 0x6d20, 0x6d21, 0x6d22, 0x6d23, 0x6d24, 0x6d26, + 0x6d28, 0x6d29, 0x6d2c, 0x6d2d, 0x6d2f, 0x6d30, 0x6d34, 0x6d36, + 0x6d37, 0x6d38, 0x6d3a, 0x6d3f, 0x6d40, 0x6d42, 0x6d44, 0x6d49, + 0x6d4c, 0x6d50, 0x6d55, 0x6d56, 0x6d57, 0x6d58, 0x6d5b, 0x6d5d, + 0x6d5f, 0x6d61, 0x6d62, 0x6d64, 0x6d65, 0x6d67, 0x6d68, 0x6d6b, + 0x6d6c, 0x6d6d, 0x6d70, 0x6d71, 0x6d72, 0x6d73, 0x6d75, 0x6d76, + 0x6d79, 0x6d7a, 0x6d7b, 0x6d7d, 0x6d7e, 0x6d7f, 0x6d80, 0x6d81, + 0x6d83, 0x6d84, 0x6d86, 0x6d87, 0x6d8a, 0x6d8b, 0x6d8d, 0x6d8f, + 0x6d90, 0x6d92, 0x6d96, 0x6d97, 0x6d98, 0x6d99, 0x6d9a, 0x6d9c, + 0x6da2, 0x6da5, 0x6dac, 0x6dad, 0x6db0, 0x6db1, 0x6db3, 0x6db4, + 0x6db6, 0x6db7, 0x6db9, 0x6dba, 0x6dbb, 0x6dbc, 0x6dbd, 0x6dbe, + 0x6dc1, 0x6dc2, 0x6dc3, 0x6dc8, 0x6dc9, 0x6dca, + /* 0x9c */ + 0x6dcd, 0x6dce, 0x6dcf, 0x6dd0, 0x6dd2, 0x6dd3, 0x6dd4, 0x6dd5, + 0x6dd7, 0x6dda, 0x6ddb, 0x6ddc, 0x6ddf, 0x6de2, 0x6de3, 0x6de5, + 0x6de7, 0x6de8, 0x6de9, 0x6dea, 0x6ded, 0x6def, 0x6df0, 0x6df2, + 0x6df4, 0x6df5, 0x6df6, 0x6df8, 0x6dfa, 0x6dfd, 0x6dfe, 0x6dff, + 0x6e00, 0x6e01, 0x6e02, 0x6e03, 0x6e04, 0x6e06, 0x6e07, 0x6e08, + 0x6e09, 0x6e0b, 0x6e0f, 0x6e12, 0x6e13, 0x6e15, 0x6e18, 0x6e19, + 0x6e1b, 0x6e1c, 0x6e1e, 0x6e1f, 0x6e22, 0x6e26, 0x6e27, 0x6e28, + 0x6e2a, 0x6e2c, 0x6e2e, 0x6e30, 0x6e31, 0x6e33, 0x6e35, 0x6e36, + 0x6e37, 0x6e39, 0x6e3b, 0x6e3c, 0x6e3d, 0x6e3e, 0x6e3f, 0x6e40, + 0x6e41, 0x6e42, 0x6e45, 0x6e46, 0x6e47, 0x6e48, 0x6e49, 0x6e4a, + 0x6e4b, 0x6e4c, 0x6e4f, 0x6e50, 0x6e51, 0x6e52, 0x6e55, 0x6e57, + 0x6e59, 0x6e5a, 0x6e5c, 0x6e5d, 0x6e5e, 0x6e60, 0x6e61, 0x6e62, + 0x6e63, 0x6e64, 0x6e65, 0x6e66, 0x6e67, 0x6e68, 0x6e69, 0x6e6a, + 0x6e6c, 0x6e6d, 0x6e6f, 0x6e70, 0x6e71, 0x6e72, 0x6e73, 0x6e74, + 0x6e75, 0x6e76, 0x6e77, 0x6e78, 0x6e79, 0x6e7a, 0x6e7b, 0x6e7c, + 0x6e7d, 0x6e80, 0x6e81, 0x6e82, 0x6e84, 0x6e87, 0x6e88, 0x6e8a, + 0x6e8b, 0x6e8c, 0x6e8d, 0x6e8e, 0x6e91, 0x6e92, 0x6e93, 0x6e94, + 0x6e95, 0x6e96, 0x6e97, 0x6e99, 0x6e9a, 0x6e9b, 0x6e9d, 0x6e9e, + 0x6ea0, 0x6ea1, 0x6ea3, 0x6ea4, 0x6ea6, 0x6ea8, 0x6ea9, 0x6eab, + 0x6eac, 0x6ead, 0x6eae, 0x6eb0, 0x6eb3, 0x6eb5, 0x6eb8, 0x6eb9, + 0x6ebc, 0x6ebe, 0x6ebf, 0x6ec0, 0x6ec3, 0x6ec4, 0x6ec5, 0x6ec6, + 0x6ec8, 0x6ec9, 0x6eca, 0x6ecc, 0x6ecd, 0x6ece, 0x6ed0, 0x6ed2, + 0x6ed6, 0x6ed8, 0x6ed9, 0x6edb, 0x6edc, 0x6edd, 0x6ee3, 0x6ee7, + 0x6eea, 0x6eeb, 0x6eec, 0x6eed, 0x6eee, 0x6eef, + /* 0x9d */ + 0x6ef0, 0x6ef1, 0x6ef2, 0x6ef3, 0x6ef5, 0x6ef6, 0x6ef7, 0x6ef8, + 0x6efa, 0x6efb, 0x6efc, 0x6efd, 0x6efe, 0x6eff, 0x6f00, 0x6f01, + 0x6f03, 0x6f04, 0x6f05, 0x6f07, 0x6f08, 0x6f0a, 0x6f0b, 0x6f0c, + 0x6f0d, 0x6f0e, 0x6f10, 0x6f11, 0x6f12, 0x6f16, 0x6f17, 0x6f18, + 0x6f19, 0x6f1a, 0x6f1b, 0x6f1c, 0x6f1d, 0x6f1e, 0x6f1f, 0x6f21, + 0x6f22, 0x6f23, 0x6f25, 0x6f26, 0x6f27, 0x6f28, 0x6f2c, 0x6f2e, + 0x6f30, 0x6f32, 0x6f34, 0x6f35, 0x6f37, 0x6f38, 0x6f39, 0x6f3a, + 0x6f3b, 0x6f3c, 0x6f3d, 0x6f3f, 0x6f40, 0x6f41, 0x6f42, 0x6f43, + 0x6f44, 0x6f45, 0x6f48, 0x6f49, 0x6f4a, 0x6f4c, 0x6f4e, 0x6f4f, + 0x6f50, 0x6f51, 0x6f52, 0x6f53, 0x6f54, 0x6f55, 0x6f56, 0x6f57, + 0x6f59, 0x6f5a, 0x6f5b, 0x6f5d, 0x6f5f, 0x6f60, 0x6f61, 0x6f63, + 0x6f64, 0x6f65, 0x6f67, 0x6f68, 0x6f69, 0x6f6a, 0x6f6b, 0x6f6c, + 0x6f6f, 0x6f70, 0x6f71, 0x6f73, 0x6f75, 0x6f76, 0x6f77, 0x6f79, + 0x6f7b, 0x6f7d, 0x6f7e, 0x6f7f, 0x6f80, 0x6f81, 0x6f82, 0x6f83, + 0x6f85, 0x6f86, 0x6f87, 0x6f8a, 0x6f8b, 0x6f8f, 0x6f90, 0x6f91, + 0x6f92, 0x6f93, 0x6f94, 0x6f95, 0x6f96, 0x6f97, 0x6f98, 0x6f99, + 0x6f9a, 0x6f9b, 0x6f9d, 0x6f9e, 0x6f9f, 0x6fa0, 0x6fa2, 0x6fa3, + 0x6fa4, 0x6fa5, 0x6fa6, 0x6fa8, 0x6fa9, 0x6faa, 0x6fab, 0x6fac, + 0x6fad, 0x6fae, 0x6faf, 0x6fb0, 0x6fb1, 0x6fb2, 0x6fb4, 0x6fb5, + 0x6fb7, 0x6fb8, 0x6fba, 0x6fbb, 0x6fbc, 0x6fbd, 0x6fbe, 0x6fbf, + 0x6fc1, 0x6fc3, 0x6fc4, 0x6fc5, 0x6fc6, 0x6fc7, 0x6fc8, 0x6fca, + 0x6fcb, 0x6fcc, 0x6fcd, 0x6fce, 0x6fcf, 0x6fd0, 0x6fd3, 0x6fd4, + 0x6fd5, 0x6fd6, 0x6fd7, 0x6fd8, 0x6fd9, 0x6fda, 0x6fdb, 0x6fdc, + 0x6fdd, 0x6fdf, 0x6fe2, 0x6fe3, 0x6fe4, 0x6fe5, + /* 0x9e */ + 0x6fe6, 0x6fe7, 0x6fe8, 0x6fe9, 0x6fea, 0x6feb, 0x6fec, 0x6fed, + 0x6ff0, 0x6ff1, 0x6ff2, 0x6ff3, 0x6ff4, 0x6ff5, 0x6ff6, 0x6ff7, + 0x6ff8, 0x6ff9, 0x6ffa, 0x6ffb, 0x6ffc, 0x6ffd, 0x6ffe, 0x6fff, + 0x7000, 0x7001, 0x7002, 0x7003, 0x7004, 0x7005, 0x7006, 0x7007, + 0x7008, 0x7009, 0x700a, 0x700b, 0x700c, 0x700d, 0x700e, 0x700f, + 0x7010, 0x7012, 0x7013, 0x7014, 0x7015, 0x7016, 0x7017, 0x7018, + 0x7019, 0x701c, 0x701d, 0x701e, 0x701f, 0x7020, 0x7021, 0x7022, + 0x7024, 0x7025, 0x7026, 0x7027, 0x7028, 0x7029, 0x702a, 0x702b, + 0x702c, 0x702d, 0x702e, 0x702f, 0x7030, 0x7031, 0x7032, 0x7033, + 0x7034, 0x7036, 0x7037, 0x7038, 0x703a, 0x703b, 0x703c, 0x703d, + 0x703e, 0x703f, 0x7040, 0x7041, 0x7042, 0x7043, 0x7044, 0x7045, + 0x7046, 0x7047, 0x7048, 0x7049, 0x704a, 0x704b, 0x704d, 0x704e, + 0x7050, 0x7051, 0x7052, 0x7053, 0x7054, 0x7055, 0x7056, 0x7057, + 0x7058, 0x7059, 0x705a, 0x705b, 0x705c, 0x705d, 0x705f, 0x7060, + 0x7061, 0x7062, 0x7063, 0x7064, 0x7065, 0x7066, 0x7067, 0x7068, + 0x7069, 0x706a, 0x706e, 0x7071, 0x7072, 0x7073, 0x7074, 0x7077, + 0x7079, 0x707a, 0x707b, 0x707d, 0x7081, 0x7082, 0x7083, 0x7084, + 0x7086, 0x7087, 0x7088, 0x708b, 0x708c, 0x708d, 0x708f, 0x7090, + 0x7091, 0x7093, 0x7097, 0x7098, 0x709a, 0x709b, 0x709e, 0x709f, + 0x70a0, 0x70a1, 0x70a2, 0x70a3, 0x70a4, 0x70a5, 0x70a6, 0x70a7, + 0x70a8, 0x70a9, 0x70aa, 0x70b0, 0x70b2, 0x70b4, 0x70b5, 0x70b6, + 0x70ba, 0x70be, 0x70bf, 0x70c4, 0x70c5, 0x70c6, 0x70c7, 0x70c9, + 0x70cb, 0x70cc, 0x70cd, 0x70ce, 0x70cf, 0x70d0, 0x70d1, 0x70d2, + 0x70d3, 0x70d4, 0x70d5, 0x70d6, 0x70d7, 0x70da, + /* 0x9f */ + 0x70dc, 0x70dd, 0x70de, 0x70e0, 0x70e1, 0x70e2, 0x70e3, 0x70e5, + 0x70ea, 0x70ee, 0x70f0, 0x70f1, 0x70f2, 0x70f3, 0x70f4, 0x70f5, + 0x70f6, 0x70f8, 0x70fa, 0x70fb, 0x70fc, 0x70fe, 0x70ff, 0x7100, + 0x7101, 0x7102, 0x7103, 0x7104, 0x7105, 0x7106, 0x7107, 0x7108, + 0x710b, 0x710c, 0x710d, 0x710e, 0x710f, 0x7111, 0x7112, 0x7114, + 0x7117, 0x711b, 0x711c, 0x711d, 0x711e, 0x711f, 0x7120, 0x7121, + 0x7122, 0x7123, 0x7124, 0x7125, 0x7127, 0x7128, 0x7129, 0x712a, + 0x712b, 0x712c, 0x712d, 0x712e, 0x7132, 0x7133, 0x7134, 0x7135, + 0x7137, 0x7138, 0x7139, 0x713a, 0x713b, 0x713c, 0x713d, 0x713e, + 0x713f, 0x7140, 0x7141, 0x7142, 0x7143, 0x7144, 0x7146, 0x7147, + 0x7148, 0x7149, 0x714b, 0x714d, 0x714f, 0x7150, 0x7151, 0x7152, + 0x7153, 0x7154, 0x7155, 0x7156, 0x7157, 0x7158, 0x7159, 0x715a, + 0x715b, 0x715d, 0x715f, 0x7160, 0x7161, 0x7162, 0x7163, 0x7165, + 0x7169, 0x716a, 0x716b, 0x716c, 0x716d, 0x716f, 0x7170, 0x7171, + 0x7174, 0x7175, 0x7176, 0x7177, 0x7179, 0x717b, 0x717c, 0x717e, + 0x717f, 0x7180, 0x7181, 0x7182, 0x7183, 0x7185, 0x7186, 0x7187, + 0x7188, 0x7189, 0x718b, 0x718c, 0x718d, 0x718e, 0x7190, 0x7191, + 0x7192, 0x7193, 0x7195, 0x7196, 0x7197, 0x719a, 0x719b, 0x719c, + 0x719d, 0x719e, 0x71a1, 0x71a2, 0x71a3, 0x71a4, 0x71a5, 0x71a6, + 0x71a7, 0x71a9, 0x71aa, 0x71ab, 0x71ad, 0x71ae, 0x71af, 0x71b0, + 0x71b1, 0x71b2, 0x71b4, 0x71b6, 0x71b7, 0x71b8, 0x71ba, 0x71bb, + 0x71bc, 0x71bd, 0x71be, 0x71bf, 0x71c0, 0x71c1, 0x71c2, 0x71c4, + 0x71c5, 0x71c6, 0x71c7, 0x71c8, 0x71c9, 0x71ca, 0x71cb, 0x71cc, + 0x71cd, 0x71cf, 0x71d0, 0x71d1, 0x71d2, 0x71d3, + /* 0xa0 */ + 0x71d6, 0x71d7, 0x71d8, 0x71d9, 0x71da, 0x71db, 0x71dc, 0x71dd, + 0x71de, 0x71df, 0x71e1, 0x71e2, 0x71e3, 0x71e4, 0x71e6, 0x71e8, + 0x71e9, 0x71ea, 0x71eb, 0x71ec, 0x71ed, 0x71ef, 0x71f0, 0x71f1, + 0x71f2, 0x71f3, 0x71f4, 0x71f5, 0x71f6, 0x71f7, 0x71f8, 0x71fa, + 0x71fb, 0x71fc, 0x71fd, 0x71fe, 0x71ff, 0x7200, 0x7201, 0x7202, + 0x7203, 0x7204, 0x7205, 0x7207, 0x7208, 0x7209, 0x720a, 0x720b, + 0x720c, 0x720d, 0x720e, 0x720f, 0x7210, 0x7211, 0x7212, 0x7213, + 0x7214, 0x7215, 0x7216, 0x7217, 0x7218, 0x7219, 0x721a, 0x721b, + 0x721c, 0x721e, 0x721f, 0x7220, 0x7221, 0x7222, 0x7223, 0x7224, + 0x7225, 0x7226, 0x7227, 0x7229, 0x722b, 0x722d, 0x722e, 0x722f, + 0x7232, 0x7233, 0x7234, 0x723a, 0x723c, 0x723e, 0x7240, 0x7241, + 0x7242, 0x7243, 0x7244, 0x7245, 0x7246, 0x7249, 0x724a, 0x724b, + 0x724e, 0x724f, 0x7250, 0x7251, 0x7253, 0x7254, 0x7255, 0x7257, + 0x7258, 0x725a, 0x725c, 0x725e, 0x7260, 0x7263, 0x7264, 0x7265, + 0x7268, 0x726a, 0x726b, 0x726c, 0x726d, 0x7270, 0x7271, 0x7273, + 0x7274, 0x7276, 0x7277, 0x7278, 0x727b, 0x727c, 0x727d, 0x7282, + 0x7283, 0x7285, 0x7286, 0x7287, 0x7288, 0x7289, 0x728c, 0x728e, + 0x7290, 0x7291, 0x7293, 0x7294, 0x7295, 0x7296, 0x7297, 0x7298, + 0x7299, 0x729a, 0x729b, 0x729c, 0x729d, 0x729e, 0x72a0, 0x72a1, + 0x72a2, 0x72a3, 0x72a4, 0x72a5, 0x72a6, 0x72a7, 0x72a8, 0x72a9, + 0x72aa, 0x72ab, 0x72ae, 0x72b1, 0x72b2, 0x72b3, 0x72b5, 0x72ba, + 0x72bb, 0x72bc, 0x72bd, 0x72be, 0x72bf, 0x72c0, 0x72c5, 0x72c6, + 0x72c7, 0x72c9, 0x72ca, 0x72cb, 0x72cc, 0x72cf, 0x72d1, 0x72d3, + 0x72d4, 0x72d5, 0x72d6, 0x72d8, 0x72da, 0x72db, +}; + + +static const u16 gbkext2_2uni_pagea8[8272] = { + /* 0xa8 */ + 0x02ca, 0x02cb, 0x02d9, 0x2013, 0x2015, 0x2025, 0x2035, 0x2105, + 0x2109, 0x2196, 0x2197, 0x2198, 0x2199, 0x2215, 0x221f, 0x2223, + 0x2252, 0x2266, 0x2267, 0x22bf, 0x2550, 0x2551, 0x2552, 0x2553, + 0x2554, 0x2555, 0x2556, 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, + 0x255c, 0x255d, 0x255e, 0x255f, 0x2560, 0x2561, 0x2562, 0x2563, + 0x2564, 0x2565, 0x2566, 0x2567, 0x2568, 0x2569, 0x256a, 0x256b, + 0x256c, 0x256d, 0x256e, 0x256f, 0x2570, 0x2571, 0x2572, 0x2573, + 0x2581, 0x2582, 0x2583, 0x2584, 0x2585, 0x2586, 0x2587, 0x2588, + 0x2589, 0x258a, 0x258b, 0x258c, 0x258d, 0x258e, 0x258f, 0x2593, + 0x2594, 0x2595, 0x25bc, 0x25bd, 0x25e2, 0x25e3, 0x25e4, 0x25e5, + 0x2609, 0x2295, 0x3012, 0x301d, 0x301e, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + /* 0xa9 */ + 0x3021, 0x3022, 0x3023, 0x3024, 0x3025, 0x3026, 0x3027, 0x3028, + 0x3029, 0x32a3, 0x338e, 0x338f, 0x339c, 0x339d, 0x339e, 0x33a1, + 0x33c4, 0x33ce, 0x33d1, 0x33d2, 0x33d5, 0xfe30, 0xffe2, 0xffe4, + 0xfffd, 0x2121, 0x3231, 0xfffd, 0x2010, 0xfffd, 0xfffd, 0xfffd, + 0x30fc, 0x309b, 0x309c, 0x30fd, 0x30fe, 0x3006, 0x309d, 0x309e, + 0xfe49, 0xfe4a, 0xfe4b, 0xfe4c, 0xfe4d, 0xfe4e, 0xfe4f, 0xfe50, + 0xfe51, 0xfe52, 0xfe54, 0xfe55, 0xfe56, 0xfe57, 0xfe59, 0xfe5a, + 0xfe5b, 0xfe5c, 0xfe5d, 0xfe5e, 0xfe5f, 0xfe60, 0xfe61, 0xfe62, + 0xfe63, 0xfe64, 0xfe65, 0xfe66, 0xfe68, 0xfe69, 0xfe6a, 0xfe6b, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x3007, 0xfffd, 0xfffd, + 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, + /* 0xaa */ + 0x72dc, 0x72dd, 0x72df, 0x72e2, 0x72e3, 0x72e4, 0x72e5, 0x72e6, + 0x72e7, 0x72ea, 0x72eb, 0x72f5, 0x72f6, 0x72f9, 0x72fd, 0x72fe, + 0x72ff, 0x7300, 0x7302, 0x7304, 0x7305, 0x7306, 0x7307, 0x7308, + 0x7309, 0x730b, 0x730c, 0x730d, 0x730f, 0x7310, 0x7311, 0x7312, + 0x7314, 0x7318, 0x7319, 0x731a, 0x731f, 0x7320, 0x7323, 0x7324, + 0x7326, 0x7327, 0x7328, 0x732d, 0x732f, 0x7330, 0x7332, 0x7333, + 0x7335, 0x7336, 0x733a, 0x733b, 0x733c, 0x733d, 0x7340, 0x7341, + 0x7342, 0x7343, 0x7344, 0x7345, 0x7346, 0x7347, 0x7348, 0x7349, + 0x734a, 0x734b, 0x734c, 0x734e, 0x734f, 0x7351, 0x7353, 0x7354, + 0x7355, 0x7356, 0x7358, 0x7359, 0x735a, 0x735b, 0x735c, 0x735d, + 0x735e, 0x735f, 0x7361, 0x7362, 0x7363, 0x7364, 0x7365, 0x7366, + 0x7367, 0x7368, 0x7369, 0x736a, 0x736b, 0x736e, 0x7370, 0x7371, + /* 0xab */ + 0x7372, 0x7373, 0x7374, 0x7375, 0x7376, 0x7377, 0x7378, 0x7379, + 0x737a, 0x737b, 0x737c, 0x737d, 0x737f, 0x7380, 0x7381, 0x7382, + 0x7383, 0x7385, 0x7386, 0x7388, 0x738a, 0x738c, 0x738d, 0x738f, + 0x7390, 0x7392, 0x7393, 0x7394, 0x7395, 0x7397, 0x7398, 0x7399, + 0x739a, 0x739c, 0x739d, 0x739e, 0x73a0, 0x73a1, 0x73a3, 0x73a4, + 0x73a5, 0x73a6, 0x73a7, 0x73a8, 0x73aa, 0x73ac, 0x73ad, 0x73b1, + 0x73b4, 0x73b5, 0x73b6, 0x73b8, 0x73b9, 0x73bc, 0x73bd, 0x73be, + 0x73bf, 0x73c1, 0x73c3, 0x73c4, 0x73c5, 0x73c6, 0x73c7, 0x73cb, + 0x73cc, 0x73ce, 0x73d2, 0x73d3, 0x73d4, 0x73d5, 0x73d6, 0x73d7, + 0x73d8, 0x73da, 0x73db, 0x73dc, 0x73dd, 0x73df, 0x73e1, 0x73e2, + 0x73e3, 0x73e4, 0x73e6, 0x73e8, 0x73ea, 0x73eb, 0x73ec, 0x73ee, + 0x73ef, 0x73f0, 0x73f1, 0x73f3, 0x73f4, 0x73f5, 0x73f6, 0x73f7, + /* 0xac */ + 0x73f8, 0x73f9, 0x73fa, 0x73fb, 0x73fc, 0x73fd, 0x73fe, 0x73ff, + 0x7400, 0x7401, 0x7402, 0x7404, 0x7407, 0x7408, 0x740b, 0x740c, + 0x740d, 0x740e, 0x7411, 0x7412, 0x7413, 0x7414, 0x7415, 0x7416, + 0x7417, 0x7418, 0x7419, 0x741c, 0x741d, 0x741e, 0x741f, 0x7420, + 0x7421, 0x7423, 0x7424, 0x7427, 0x7429, 0x742b, 0x742d, 0x742f, + 0x7431, 0x7432, 0x7437, 0x7438, 0x7439, 0x743a, 0x743b, 0x743d, + 0x743e, 0x743f, 0x7440, 0x7442, 0x7443, 0x7444, 0x7445, 0x7446, + 0x7447, 0x7448, 0x7449, 0x744a, 0x744b, 0x744c, 0x744d, 0x744e, + 0x744f, 0x7450, 0x7451, 0x7452, 0x7453, 0x7454, 0x7456, 0x7458, + 0x745d, 0x7460, 0x7461, 0x7462, 0x7463, 0x7464, 0x7465, 0x7466, + 0x7467, 0x7468, 0x7469, 0x746a, 0x746b, 0x746c, 0x746e, 0x746f, + 0x7471, 0x7472, 0x7473, 0x7474, 0x7475, 0x7478, 0x7479, 0x747a, + /* 0xad */ + 0x747b, 0x747c, 0x747d, 0x747f, 0x7482, 0x7484, 0x7485, 0x7486, + 0x7488, 0x7489, 0x748a, 0x748c, 0x748d, 0x748f, 0x7491, 0x7492, + 0x7493, 0x7494, 0x7495, 0x7496, 0x7497, 0x7498, 0x7499, 0x749a, + 0x749b, 0x749d, 0x749f, 0x74a0, 0x74a1, 0x74a2, 0x74a3, 0x74a4, + 0x74a5, 0x74a6, 0x74aa, 0x74ab, 0x74ac, 0x74ad, 0x74ae, 0x74af, + 0x74b0, 0x74b1, 0x74b2, 0x74b3, 0x74b4, 0x74b5, 0x74b6, 0x74b7, + 0x74b8, 0x74b9, 0x74bb, 0x74bc, 0x74bd, 0x74be, 0x74bf, 0x74c0, + 0x74c1, 0x74c2, 0x74c3, 0x74c4, 0x74c5, 0x74c6, 0x74c7, 0x74c8, + 0x74c9, 0x74ca, 0x74cb, 0x74cc, 0x74cd, 0x74ce, 0x74cf, 0x74d0, + 0x74d1, 0x74d3, 0x74d4, 0x74d5, 0x74d6, 0x74d7, 0x74d8, 0x74d9, + 0x74da, 0x74db, 0x74dd, 0x74df, 0x74e1, 0x74e5, 0x74e7, 0x74e8, + 0x74e9, 0x74ea, 0x74eb, 0x74ec, 0x74ed, 0x74f0, 0x74f1, 0x74f2, + /* 0xae */ + 0x74f3, 0x74f5, 0x74f8, 0x74f9, 0x74fa, 0x74fb, 0x74fc, 0x74fd, + 0x74fe, 0x7500, 0x7501, 0x7502, 0x7503, 0x7505, 0x7506, 0x7507, + 0x7508, 0x7509, 0x750a, 0x750b, 0x750c, 0x750e, 0x7510, 0x7512, + 0x7514, 0x7515, 0x7516, 0x7517, 0x751b, 0x751d, 0x751e, 0x7520, + 0x7521, 0x7522, 0x7523, 0x7524, 0x7526, 0x7527, 0x752a, 0x752e, + 0x7534, 0x7536, 0x7539, 0x753c, 0x753d, 0x753f, 0x7541, 0x7542, + 0x7543, 0x7544, 0x7546, 0x7547, 0x7549, 0x754a, 0x754d, 0x7550, + 0x7551, 0x7552, 0x7553, 0x7555, 0x7556, 0x7557, 0x7558, 0x755d, + 0x755e, 0x755f, 0x7560, 0x7561, 0x7562, 0x7563, 0x7564, 0x7567, + 0x7568, 0x7569, 0x756b, 0x756c, 0x756d, 0x756e, 0x756f, 0x7570, + 0x7571, 0x7573, 0x7575, 0x7576, 0x7577, 0x757a, 0x757b, 0x757c, + 0x757d, 0x757e, 0x7580, 0x7581, 0x7582, 0x7584, 0x7585, 0x7587, + /* 0xaf */ + 0x7588, 0x7589, 0x758a, 0x758c, 0x758d, 0x758e, 0x7590, 0x7593, + 0x7595, 0x7598, 0x759b, 0x759c, 0x759e, 0x75a2, 0x75a6, 0x75a7, + 0x75a8, 0x75a9, 0x75aa, 0x75ad, 0x75b6, 0x75b7, 0x75ba, 0x75bb, + 0x75bf, 0x75c0, 0x75c1, 0x75c6, 0x75cb, 0x75cc, 0x75ce, 0x75cf, + 0x75d0, 0x75d1, 0x75d3, 0x75d7, 0x75d9, 0x75da, 0x75dc, 0x75dd, + 0x75df, 0x75e0, 0x75e1, 0x75e5, 0x75e9, 0x75ec, 0x75ed, 0x75ee, + 0x75ef, 0x75f2, 0x75f3, 0x75f5, 0x75f6, 0x75f7, 0x75f8, 0x75fa, + 0x75fb, 0x75fd, 0x75fe, 0x7602, 0x7604, 0x7606, 0x7607, 0x7608, + 0x7609, 0x760b, 0x760d, 0x760e, 0x760f, 0x7611, 0x7612, 0x7613, + 0x7614, 0x7616, 0x761a, 0x761c, 0x761d, 0x761e, 0x7621, 0x7623, + 0x7627, 0x7628, 0x762c, 0x762e, 0x762f, 0x7631, 0x7632, 0x7636, + 0x7637, 0x7639, 0x763a, 0x763b, 0x763d, 0x7641, 0x7642, 0x7644, + /* 0xb0 */ + 0x7645, 0x7646, 0x7647, 0x7648, 0x7649, 0x764a, 0x764b, 0x764e, + 0x764f, 0x7650, 0x7651, 0x7652, 0x7653, 0x7655, 0x7657, 0x7658, + 0x7659, 0x765a, 0x765b, 0x765d, 0x765f, 0x7660, 0x7661, 0x7662, + 0x7664, 0x7665, 0x7666, 0x7667, 0x7668, 0x7669, 0x766a, 0x766c, + 0x766d, 0x766e, 0x7670, 0x7671, 0x7672, 0x7673, 0x7674, 0x7675, + 0x7676, 0x7677, 0x7679, 0x767a, 0x767c, 0x767f, 0x7680, 0x7681, + 0x7683, 0x7685, 0x7689, 0x768a, 0x768c, 0x768d, 0x768f, 0x7690, + 0x7692, 0x7694, 0x7695, 0x7697, 0x7698, 0x769a, 0x769b, 0x769c, + 0x769d, 0x769e, 0x769f, 0x76a0, 0x76a1, 0x76a2, 0x76a3, 0x76a5, + 0x76a6, 0x76a7, 0x76a8, 0x76a9, 0x76aa, 0x76ab, 0x76ac, 0x76ad, + 0x76af, 0x76b0, 0x76b3, 0x76b5, 0x76b6, 0x76b7, 0x76b8, 0x76b9, + 0x76ba, 0x76bb, 0x76bc, 0x76bd, 0x76be, 0x76c0, 0x76c1, 0x76c3, + /* 0xb1 */ + 0x76c4, 0x76c7, 0x76c9, 0x76cb, 0x76cc, 0x76d3, 0x76d5, 0x76d9, + 0x76da, 0x76dc, 0x76dd, 0x76de, 0x76e0, 0x76e1, 0x76e2, 0x76e3, + 0x76e4, 0x76e6, 0x76e7, 0x76e8, 0x76e9, 0x76ea, 0x76eb, 0x76ec, + 0x76ed, 0x76f0, 0x76f3, 0x76f5, 0x76f6, 0x76f7, 0x76fa, 0x76fb, + 0x76fd, 0x76ff, 0x7700, 0x7702, 0x7703, 0x7705, 0x7706, 0x770a, + 0x770c, 0x770e, 0x770f, 0x7710, 0x7711, 0x7712, 0x7713, 0x7714, + 0x7715, 0x7716, 0x7717, 0x7718, 0x771b, 0x771c, 0x771d, 0x771e, + 0x7721, 0x7723, 0x7724, 0x7725, 0x7727, 0x772a, 0x772b, 0x772c, + 0x772e, 0x7730, 0x7731, 0x7732, 0x7733, 0x7734, 0x7739, 0x773b, + 0x773d, 0x773e, 0x773f, 0x7742, 0x7744, 0x7745, 0x7746, 0x7748, + 0x7749, 0x774a, 0x774b, 0x774c, 0x774d, 0x774e, 0x774f, 0x7752, + 0x7753, 0x7754, 0x7755, 0x7756, 0x7757, 0x7758, 0x7759, 0x775c, + /* 0xb2 */ + 0x775d, 0x775e, 0x775f, 0x7760, 0x7764, 0x7767, 0x7769, 0x776a, + 0x776d, 0x776e, 0x776f, 0x7770, 0x7771, 0x7772, 0x7773, 0x7774, + 0x7775, 0x7776, 0x7777, 0x7778, 0x777a, 0x777b, 0x777c, 0x7781, + 0x7782, 0x7783, 0x7786, 0x7787, 0x7788, 0x7789, 0x778a, 0x778b, + 0x778f, 0x7790, 0x7793, 0x7794, 0x7795, 0x7796, 0x7797, 0x7798, + 0x7799, 0x779a, 0x779b, 0x779c, 0x779d, 0x779e, 0x77a1, 0x77a3, + 0x77a4, 0x77a6, 0x77a8, 0x77ab, 0x77ad, 0x77ae, 0x77af, 0x77b1, + 0x77b2, 0x77b4, 0x77b6, 0x77b7, 0x77b8, 0x77b9, 0x77ba, 0x77bc, + 0x77be, 0x77c0, 0x77c1, 0x77c2, 0x77c3, 0x77c4, 0x77c5, 0x77c6, + 0x77c7, 0x77c8, 0x77c9, 0x77ca, 0x77cb, 0x77cc, 0x77ce, 0x77cf, + 0x77d0, 0x77d1, 0x77d2, 0x77d3, 0x77d4, 0x77d5, 0x77d6, 0x77d8, + 0x77d9, 0x77da, 0x77dd, 0x77de, 0x77df, 0x77e0, 0x77e1, 0x77e4, + /* 0xb3 */ + 0x77e6, 0x77e8, 0x77ea, 0x77ef, 0x77f0, 0x77f1, 0x77f2, 0x77f4, + 0x77f5, 0x77f7, 0x77f9, 0x77fa, 0x77fb, 0x77fc, 0x7803, 0x7804, + 0x7805, 0x7806, 0x7807, 0x7808, 0x780a, 0x780b, 0x780e, 0x780f, + 0x7810, 0x7813, 0x7815, 0x7819, 0x781b, 0x781e, 0x7820, 0x7821, + 0x7822, 0x7824, 0x7828, 0x782a, 0x782b, 0x782e, 0x782f, 0x7831, + 0x7832, 0x7833, 0x7835, 0x7836, 0x783d, 0x783f, 0x7841, 0x7842, + 0x7843, 0x7844, 0x7846, 0x7848, 0x7849, 0x784a, 0x784b, 0x784d, + 0x784f, 0x7851, 0x7853, 0x7854, 0x7858, 0x7859, 0x785a, 0x785b, + 0x785c, 0x785e, 0x785f, 0x7860, 0x7861, 0x7862, 0x7863, 0x7864, + 0x7865, 0x7866, 0x7867, 0x7868, 0x7869, 0x786f, 0x7870, 0x7871, + 0x7872, 0x7873, 0x7874, 0x7875, 0x7876, 0x7878, 0x7879, 0x787a, + 0x787b, 0x787d, 0x787e, 0x787f, 0x7880, 0x7881, 0x7882, 0x7883, + /* 0xb4 */ + 0x7884, 0x7885, 0x7886, 0x7888, 0x788a, 0x788b, 0x788f, 0x7890, + 0x7892, 0x7894, 0x7895, 0x7896, 0x7899, 0x789d, 0x789e, 0x78a0, + 0x78a2, 0x78a4, 0x78a6, 0x78a8, 0x78a9, 0x78aa, 0x78ab, 0x78ac, + 0x78ad, 0x78ae, 0x78af, 0x78b5, 0x78b6, 0x78b7, 0x78b8, 0x78ba, + 0x78bb, 0x78bc, 0x78bd, 0x78bf, 0x78c0, 0x78c2, 0x78c3, 0x78c4, + 0x78c6, 0x78c7, 0x78c8, 0x78cc, 0x78cd, 0x78ce, 0x78cf, 0x78d1, + 0x78d2, 0x78d3, 0x78d6, 0x78d7, 0x78d8, 0x78da, 0x78db, 0x78dc, + 0x78dd, 0x78de, 0x78df, 0x78e0, 0x78e1, 0x78e2, 0x78e3, 0x78e4, + 0x78e5, 0x78e6, 0x78e7, 0x78e9, 0x78ea, 0x78eb, 0x78ed, 0x78ee, + 0x78ef, 0x78f0, 0x78f1, 0x78f3, 0x78f5, 0x78f6, 0x78f8, 0x78f9, + 0x78fb, 0x78fc, 0x78fd, 0x78fe, 0x78ff, 0x7900, 0x7902, 0x7903, + 0x7904, 0x7906, 0x7907, 0x7908, 0x7909, 0x790a, 0x790b, 0x790c, + /* 0xb5 */ + 0x790d, 0x790e, 0x790f, 0x7910, 0x7911, 0x7912, 0x7914, 0x7915, + 0x7916, 0x7917, 0x7918, 0x7919, 0x791a, 0x791b, 0x791c, 0x791d, + 0x791f, 0x7920, 0x7921, 0x7922, 0x7923, 0x7925, 0x7926, 0x7927, + 0x7928, 0x7929, 0x792a, 0x792b, 0x792c, 0x792d, 0x792e, 0x792f, + 0x7930, 0x7931, 0x7932, 0x7933, 0x7935, 0x7936, 0x7937, 0x7938, + 0x7939, 0x793d, 0x793f, 0x7942, 0x7943, 0x7944, 0x7945, 0x7947, + 0x794a, 0x794b, 0x794c, 0x794d, 0x794e, 0x794f, 0x7950, 0x7951, + 0x7952, 0x7954, 0x7955, 0x7958, 0x7959, 0x7961, 0x7963, 0x7964, + 0x7966, 0x7969, 0x796a, 0x796b, 0x796c, 0x796e, 0x7970, 0x7971, + 0x7972, 0x7973, 0x7974, 0x7975, 0x7976, 0x7979, 0x797b, 0x797c, + 0x797d, 0x797e, 0x797f, 0x7982, 0x7983, 0x7986, 0x7987, 0x7988, + 0x7989, 0x798b, 0x798c, 0x798d, 0x798e, 0x7990, 0x7991, 0x7992, + /* 0xb6 */ + 0x7993, 0x7994, 0x7995, 0x7996, 0x7997, 0x7998, 0x7999, 0x799b, + 0x799c, 0x799d, 0x799e, 0x799f, 0x79a0, 0x79a1, 0x79a2, 0x79a3, + 0x79a4, 0x79a5, 0x79a6, 0x79a8, 0x79a9, 0x79aa, 0x79ab, 0x79ac, + 0x79ad, 0x79ae, 0x79af, 0x79b0, 0x79b1, 0x79b2, 0x79b4, 0x79b5, + 0x79b6, 0x79b7, 0x79b8, 0x79bc, 0x79bf, 0x79c2, 0x79c4, 0x79c5, + 0x79c7, 0x79c8, 0x79ca, 0x79cc, 0x79ce, 0x79cf, 0x79d0, 0x79d3, + 0x79d4, 0x79d6, 0x79d7, 0x79d9, 0x79da, 0x79db, 0x79dc, 0x79dd, + 0x79de, 0x79e0, 0x79e1, 0x79e2, 0x79e5, 0x79e8, 0x79ea, 0x79ec, + 0x79ee, 0x79f1, 0x79f2, 0x79f3, 0x79f4, 0x79f5, 0x79f6, 0x79f7, + 0x79f9, 0x79fa, 0x79fc, 0x79fe, 0x79ff, 0x7a01, 0x7a04, 0x7a05, + 0x7a07, 0x7a08, 0x7a09, 0x7a0a, 0x7a0c, 0x7a0f, 0x7a10, 0x7a11, + 0x7a12, 0x7a13, 0x7a15, 0x7a16, 0x7a18, 0x7a19, 0x7a1b, 0x7a1c, + /* 0xb7 */ + 0x7a1d, 0x7a1f, 0x7a21, 0x7a22, 0x7a24, 0x7a25, 0x7a26, 0x7a27, + 0x7a28, 0x7a29, 0x7a2a, 0x7a2b, 0x7a2c, 0x7a2d, 0x7a2e, 0x7a2f, + 0x7a30, 0x7a31, 0x7a32, 0x7a34, 0x7a35, 0x7a36, 0x7a38, 0x7a3a, + 0x7a3e, 0x7a40, 0x7a41, 0x7a42, 0x7a43, 0x7a44, 0x7a45, 0x7a47, + 0x7a48, 0x7a49, 0x7a4a, 0x7a4b, 0x7a4c, 0x7a4d, 0x7a4e, 0x7a4f, + 0x7a50, 0x7a52, 0x7a53, 0x7a54, 0x7a55, 0x7a56, 0x7a58, 0x7a59, + 0x7a5a, 0x7a5b, 0x7a5c, 0x7a5d, 0x7a5e, 0x7a5f, 0x7a60, 0x7a61, + 0x7a62, 0x7a63, 0x7a64, 0x7a65, 0x7a66, 0x7a67, 0x7a68, 0x7a69, + 0x7a6a, 0x7a6b, 0x7a6c, 0x7a6d, 0x7a6e, 0x7a6f, 0x7a71, 0x7a72, + 0x7a73, 0x7a75, 0x7a7b, 0x7a7c, 0x7a7d, 0x7a7e, 0x7a82, 0x7a85, + 0x7a87, 0x7a89, 0x7a8a, 0x7a8b, 0x7a8c, 0x7a8e, 0x7a8f, 0x7a90, + 0x7a93, 0x7a94, 0x7a99, 0x7a9a, 0x7a9b, 0x7a9e, 0x7aa1, 0x7aa2, + /* 0xb8 */ + 0x7aa3, 0x7aa4, 0x7aa7, 0x7aa9, 0x7aaa, 0x7aab, 0x7aae, 0x7aaf, + 0x7ab0, 0x7ab1, 0x7ab2, 0x7ab4, 0x7ab5, 0x7ab6, 0x7ab7, 0x7ab8, + 0x7ab9, 0x7aba, 0x7abb, 0x7abc, 0x7abd, 0x7abe, 0x7ac0, 0x7ac1, + 0x7ac2, 0x7ac3, 0x7ac4, 0x7ac5, 0x7ac6, 0x7ac7, 0x7ac8, 0x7ac9, + 0x7aca, 0x7acc, 0x7acd, 0x7ace, 0x7acf, 0x7ad0, 0x7ad1, 0x7ad2, + 0x7ad3, 0x7ad4, 0x7ad5, 0x7ad7, 0x7ad8, 0x7ada, 0x7adb, 0x7adc, + 0x7add, 0x7ae1, 0x7ae2, 0x7ae4, 0x7ae7, 0x7ae8, 0x7ae9, 0x7aea, + 0x7aeb, 0x7aec, 0x7aee, 0x7af0, 0x7af1, 0x7af2, 0x7af3, 0x7af4, + 0x7af5, 0x7af6, 0x7af7, 0x7af8, 0x7afb, 0x7afc, 0x7afe, 0x7b00, + 0x7b01, 0x7b02, 0x7b05, 0x7b07, 0x7b09, 0x7b0c, 0x7b0d, 0x7b0e, + 0x7b10, 0x7b12, 0x7b13, 0x7b16, 0x7b17, 0x7b18, 0x7b1a, 0x7b1c, + 0x7b1d, 0x7b1f, 0x7b21, 0x7b22, 0x7b23, 0x7b27, 0x7b29, 0x7b2d, + /* 0xb9 */ + 0x7b2f, 0x7b30, 0x7b32, 0x7b34, 0x7b35, 0x7b36, 0x7b37, 0x7b39, + 0x7b3b, 0x7b3d, 0x7b3f, 0x7b40, 0x7b41, 0x7b42, 0x7b43, 0x7b44, + 0x7b46, 0x7b48, 0x7b4a, 0x7b4d, 0x7b4e, 0x7b53, 0x7b55, 0x7b57, + 0x7b59, 0x7b5c, 0x7b5e, 0x7b5f, 0x7b61, 0x7b63, 0x7b64, 0x7b65, + 0x7b66, 0x7b67, 0x7b68, 0x7b69, 0x7b6a, 0x7b6b, 0x7b6c, 0x7b6d, + 0x7b6f, 0x7b70, 0x7b73, 0x7b74, 0x7b76, 0x7b78, 0x7b7a, 0x7b7c, + 0x7b7d, 0x7b7f, 0x7b81, 0x7b82, 0x7b83, 0x7b84, 0x7b86, 0x7b87, + 0x7b88, 0x7b89, 0x7b8a, 0x7b8b, 0x7b8c, 0x7b8e, 0x7b8f, 0x7b91, + 0x7b92, 0x7b93, 0x7b96, 0x7b98, 0x7b99, 0x7b9a, 0x7b9b, 0x7b9e, + 0x7b9f, 0x7ba0, 0x7ba3, 0x7ba4, 0x7ba5, 0x7bae, 0x7baf, 0x7bb0, + 0x7bb2, 0x7bb3, 0x7bb5, 0x7bb6, 0x7bb7, 0x7bb9, 0x7bba, 0x7bbb, + 0x7bbc, 0x7bbd, 0x7bbe, 0x7bbf, 0x7bc0, 0x7bc2, 0x7bc3, 0x7bc4, + /* 0xba */ + 0x7bc5, 0x7bc8, 0x7bc9, 0x7bca, 0x7bcb, 0x7bcd, 0x7bce, 0x7bcf, + 0x7bd0, 0x7bd2, 0x7bd4, 0x7bd5, 0x7bd6, 0x7bd7, 0x7bd8, 0x7bdb, + 0x7bdc, 0x7bde, 0x7bdf, 0x7be0, 0x7be2, 0x7be3, 0x7be4, 0x7be7, + 0x7be8, 0x7be9, 0x7beb, 0x7bec, 0x7bed, 0x7bef, 0x7bf0, 0x7bf2, + 0x7bf3, 0x7bf4, 0x7bf5, 0x7bf6, 0x7bf8, 0x7bf9, 0x7bfa, 0x7bfb, + 0x7bfd, 0x7bff, 0x7c00, 0x7c01, 0x7c02, 0x7c03, 0x7c04, 0x7c05, + 0x7c06, 0x7c08, 0x7c09, 0x7c0a, 0x7c0d, 0x7c0e, 0x7c10, 0x7c11, + 0x7c12, 0x7c13, 0x7c14, 0x7c15, 0x7c17, 0x7c18, 0x7c19, 0x7c1a, + 0x7c1b, 0x7c1c, 0x7c1d, 0x7c1e, 0x7c20, 0x7c21, 0x7c22, 0x7c23, + 0x7c24, 0x7c25, 0x7c28, 0x7c29, 0x7c2b, 0x7c2c, 0x7c2d, 0x7c2e, + 0x7c2f, 0x7c30, 0x7c31, 0x7c32, 0x7c33, 0x7c34, 0x7c35, 0x7c36, + 0x7c37, 0x7c39, 0x7c3a, 0x7c3b, 0x7c3c, 0x7c3d, 0x7c3e, 0x7c42, + /* 0xbb */ + 0x7c43, 0x7c44, 0x7c45, 0x7c46, 0x7c47, 0x7c48, 0x7c49, 0x7c4a, + 0x7c4b, 0x7c4c, 0x7c4e, 0x7c4f, 0x7c50, 0x7c51, 0x7c52, 0x7c53, + 0x7c54, 0x7c55, 0x7c56, 0x7c57, 0x7c58, 0x7c59, 0x7c5a, 0x7c5b, + 0x7c5c, 0x7c5d, 0x7c5e, 0x7c5f, 0x7c60, 0x7c61, 0x7c62, 0x7c63, + 0x7c64, 0x7c65, 0x7c66, 0x7c67, 0x7c68, 0x7c69, 0x7c6a, 0x7c6b, + 0x7c6c, 0x7c6d, 0x7c6e, 0x7c6f, 0x7c70, 0x7c71, 0x7c72, 0x7c75, + 0x7c76, 0x7c77, 0x7c78, 0x7c79, 0x7c7a, 0x7c7e, 0x7c7f, 0x7c80, + 0x7c81, 0x7c82, 0x7c83, 0x7c84, 0x7c85, 0x7c86, 0x7c87, 0x7c88, + 0x7c8a, 0x7c8b, 0x7c8c, 0x7c8d, 0x7c8e, 0x7c8f, 0x7c90, 0x7c93, + 0x7c94, 0x7c96, 0x7c99, 0x7c9a, 0x7c9b, 0x7ca0, 0x7ca1, 0x7ca3, + 0x7ca6, 0x7ca7, 0x7ca8, 0x7ca9, 0x7cab, 0x7cac, 0x7cad, 0x7caf, + 0x7cb0, 0x7cb4, 0x7cb5, 0x7cb6, 0x7cb7, 0x7cb8, 0x7cba, 0x7cbb, + /* 0xbc */ + 0x7cbf, 0x7cc0, 0x7cc2, 0x7cc3, 0x7cc4, 0x7cc6, 0x7cc9, 0x7ccb, + 0x7cce, 0x7ccf, 0x7cd0, 0x7cd1, 0x7cd2, 0x7cd3, 0x7cd4, 0x7cd8, + 0x7cda, 0x7cdb, 0x7cdd, 0x7cde, 0x7ce1, 0x7ce2, 0x7ce3, 0x7ce4, + 0x7ce5, 0x7ce6, 0x7ce7, 0x7ce9, 0x7cea, 0x7ceb, 0x7cec, 0x7ced, + 0x7cee, 0x7cf0, 0x7cf1, 0x7cf2, 0x7cf3, 0x7cf4, 0x7cf5, 0x7cf6, + 0x7cf7, 0x7cf9, 0x7cfa, 0x7cfc, 0x7cfd, 0x7cfe, 0x7cff, 0x7d00, + 0x7d01, 0x7d02, 0x7d03, 0x7d04, 0x7d05, 0x7d06, 0x7d07, 0x7d08, + 0x7d09, 0x7d0b, 0x7d0c, 0x7d0d, 0x7d0e, 0x7d0f, 0x7d10, 0x7d11, + 0x7d12, 0x7d13, 0x7d14, 0x7d15, 0x7d16, 0x7d17, 0x7d18, 0x7d19, + 0x7d1a, 0x7d1b, 0x7d1c, 0x7d1d, 0x7d1e, 0x7d1f, 0x7d21, 0x7d23, + 0x7d24, 0x7d25, 0x7d26, 0x7d28, 0x7d29, 0x7d2a, 0x7d2c, 0x7d2d, + 0x7d2e, 0x7d30, 0x7d31, 0x7d32, 0x7d33, 0x7d34, 0x7d35, 0x7d36, + /* 0xbd */ + 0x7d37, 0x7d38, 0x7d39, 0x7d3a, 0x7d3b, 0x7d3c, 0x7d3d, 0x7d3e, + 0x7d3f, 0x7d40, 0x7d41, 0x7d42, 0x7d43, 0x7d44, 0x7d45, 0x7d46, + 0x7d47, 0x7d48, 0x7d49, 0x7d4a, 0x7d4b, 0x7d4c, 0x7d4d, 0x7d4e, + 0x7d4f, 0x7d50, 0x7d51, 0x7d52, 0x7d53, 0x7d54, 0x7d55, 0x7d56, + 0x7d57, 0x7d58, 0x7d59, 0x7d5a, 0x7d5b, 0x7d5c, 0x7d5d, 0x7d5e, + 0x7d5f, 0x7d60, 0x7d61, 0x7d62, 0x7d63, 0x7d64, 0x7d65, 0x7d66, + 0x7d67, 0x7d68, 0x7d69, 0x7d6a, 0x7d6b, 0x7d6c, 0x7d6d, 0x7d6f, + 0x7d70, 0x7d71, 0x7d72, 0x7d73, 0x7d74, 0x7d75, 0x7d76, 0x7d78, + 0x7d79, 0x7d7a, 0x7d7b, 0x7d7c, 0x7d7d, 0x7d7e, 0x7d7f, 0x7d80, + 0x7d81, 0x7d82, 0x7d83, 0x7d84, 0x7d85, 0x7d86, 0x7d87, 0x7d88, + 0x7d89, 0x7d8a, 0x7d8b, 0x7d8c, 0x7d8d, 0x7d8e, 0x7d8f, 0x7d90, + 0x7d91, 0x7d92, 0x7d93, 0x7d94, 0x7d95, 0x7d96, 0x7d97, 0x7d98, + /* 0xbe */ + 0x7d99, 0x7d9a, 0x7d9b, 0x7d9c, 0x7d9d, 0x7d9e, 0x7d9f, 0x7da0, + 0x7da1, 0x7da2, 0x7da3, 0x7da4, 0x7da5, 0x7da7, 0x7da8, 0x7da9, + 0x7daa, 0x7dab, 0x7dac, 0x7dad, 0x7daf, 0x7db0, 0x7db1, 0x7db2, + 0x7db3, 0x7db4, 0x7db5, 0x7db6, 0x7db7, 0x7db8, 0x7db9, 0x7dba, + 0x7dbb, 0x7dbc, 0x7dbd, 0x7dbe, 0x7dbf, 0x7dc0, 0x7dc1, 0x7dc2, + 0x7dc3, 0x7dc4, 0x7dc5, 0x7dc6, 0x7dc7, 0x7dc8, 0x7dc9, 0x7dca, + 0x7dcb, 0x7dcc, 0x7dcd, 0x7dce, 0x7dcf, 0x7dd0, 0x7dd1, 0x7dd2, + 0x7dd3, 0x7dd4, 0x7dd5, 0x7dd6, 0x7dd7, 0x7dd8, 0x7dd9, 0x7dda, + 0x7ddb, 0x7ddc, 0x7ddd, 0x7dde, 0x7ddf, 0x7de0, 0x7de1, 0x7de2, + 0x7de3, 0x7de4, 0x7de5, 0x7de6, 0x7de7, 0x7de8, 0x7de9, 0x7dea, + 0x7deb, 0x7dec, 0x7ded, 0x7dee, 0x7def, 0x7df0, 0x7df1, 0x7df2, + 0x7df3, 0x7df4, 0x7df5, 0x7df6, 0x7df7, 0x7df8, 0x7df9, 0x7dfa, + /* 0xbf */ + 0x7dfb, 0x7dfc, 0x7dfd, 0x7dfe, 0x7dff, 0x7e00, 0x7e01, 0x7e02, + 0x7e03, 0x7e04, 0x7e05, 0x7e06, 0x7e07, 0x7e08, 0x7e09, 0x7e0a, + 0x7e0b, 0x7e0c, 0x7e0d, 0x7e0e, 0x7e0f, 0x7e10, 0x7e11, 0x7e12, + 0x7e13, 0x7e14, 0x7e15, 0x7e16, 0x7e17, 0x7e18, 0x7e19, 0x7e1a, + 0x7e1b, 0x7e1c, 0x7e1d, 0x7e1e, 0x7e1f, 0x7e20, 0x7e21, 0x7e22, + 0x7e23, 0x7e24, 0x7e25, 0x7e26, 0x7e27, 0x7e28, 0x7e29, 0x7e2a, + 0x7e2b, 0x7e2c, 0x7e2d, 0x7e2e, 0x7e2f, 0x7e30, 0x7e31, 0x7e32, + 0x7e33, 0x7e34, 0x7e35, 0x7e36, 0x7e37, 0x7e38, 0x7e39, 0x7e3a, + 0x7e3c, 0x7e3d, 0x7e3e, 0x7e3f, 0x7e40, 0x7e42, 0x7e43, 0x7e44, + 0x7e45, 0x7e46, 0x7e48, 0x7e49, 0x7e4a, 0x7e4b, 0x7e4c, 0x7e4d, + 0x7e4e, 0x7e4f, 0x7e50, 0x7e51, 0x7e52, 0x7e53, 0x7e54, 0x7e55, + 0x7e56, 0x7e57, 0x7e58, 0x7e59, 0x7e5a, 0x7e5b, 0x7e5c, 0x7e5d, + /* 0xc0 */ + 0x7e5e, 0x7e5f, 0x7e60, 0x7e61, 0x7e62, 0x7e63, 0x7e64, 0x7e65, + 0x7e66, 0x7e67, 0x7e68, 0x7e69, 0x7e6a, 0x7e6b, 0x7e6c, 0x7e6d, + 0x7e6e, 0x7e6f, 0x7e70, 0x7e71, 0x7e72, 0x7e73, 0x7e74, 0x7e75, + 0x7e76, 0x7e77, 0x7e78, 0x7e79, 0x7e7a, 0x7e7b, 0x7e7c, 0x7e7d, + 0x7e7e, 0x7e7f, 0x7e80, 0x7e81, 0x7e83, 0x7e84, 0x7e85, 0x7e86, + 0x7e87, 0x7e88, 0x7e89, 0x7e8a, 0x7e8b, 0x7e8c, 0x7e8d, 0x7e8e, + 0x7e8f, 0x7e90, 0x7e91, 0x7e92, 0x7e93, 0x7e94, 0x7e95, 0x7e96, + 0x7e97, 0x7e98, 0x7e99, 0x7e9a, 0x7e9c, 0x7e9d, 0x7e9e, 0x7eae, + 0x7eb4, 0x7ebb, 0x7ebc, 0x7ed6, 0x7ee4, 0x7eec, 0x7ef9, 0x7f0a, + 0x7f10, 0x7f1e, 0x7f37, 0x7f39, 0x7f3b, 0x7f3c, 0x7f3d, 0x7f3e, + 0x7f3f, 0x7f40, 0x7f41, 0x7f43, 0x7f46, 0x7f47, 0x7f48, 0x7f49, + 0x7f4a, 0x7f4b, 0x7f4c, 0x7f4d, 0x7f4e, 0x7f4f, 0x7f52, 0x7f53, + /* 0xc1 */ + 0x7f56, 0x7f59, 0x7f5b, 0x7f5c, 0x7f5d, 0x7f5e, 0x7f60, 0x7f63, + 0x7f64, 0x7f65, 0x7f66, 0x7f67, 0x7f6b, 0x7f6c, 0x7f6d, 0x7f6f, + 0x7f70, 0x7f73, 0x7f75, 0x7f76, 0x7f77, 0x7f78, 0x7f7a, 0x7f7b, + 0x7f7c, 0x7f7d, 0x7f7f, 0x7f80, 0x7f82, 0x7f83, 0x7f84, 0x7f85, + 0x7f86, 0x7f87, 0x7f88, 0x7f89, 0x7f8b, 0x7f8d, 0x7f8f, 0x7f90, + 0x7f91, 0x7f92, 0x7f93, 0x7f95, 0x7f96, 0x7f97, 0x7f98, 0x7f99, + 0x7f9b, 0x7f9c, 0x7fa0, 0x7fa2, 0x7fa3, 0x7fa5, 0x7fa6, 0x7fa8, + 0x7fa9, 0x7faa, 0x7fab, 0x7fac, 0x7fad, 0x7fae, 0x7fb1, 0x7fb3, + 0x7fb4, 0x7fb5, 0x7fb6, 0x7fb7, 0x7fba, 0x7fbb, 0x7fbe, 0x7fc0, + 0x7fc2, 0x7fc3, 0x7fc4, 0x7fc6, 0x7fc7, 0x7fc8, 0x7fc9, 0x7fcb, + 0x7fcd, 0x7fcf, 0x7fd0, 0x7fd1, 0x7fd2, 0x7fd3, 0x7fd6, 0x7fd7, + 0x7fd9, 0x7fda, 0x7fdb, 0x7fdc, 0x7fdd, 0x7fde, 0x7fe2, 0x7fe3, + /* 0xc2 */ + 0x7fe4, 0x7fe7, 0x7fe8, 0x7fea, 0x7feb, 0x7fec, 0x7fed, 0x7fef, + 0x7ff2, 0x7ff4, 0x7ff5, 0x7ff6, 0x7ff7, 0x7ff8, 0x7ff9, 0x7ffa, + 0x7ffd, 0x7ffe, 0x7fff, 0x8002, 0x8007, 0x8008, 0x8009, 0x800a, + 0x800e, 0x800f, 0x8011, 0x8013, 0x801a, 0x801b, 0x801d, 0x801e, + 0x801f, 0x8021, 0x8023, 0x8024, 0x802b, 0x802c, 0x802d, 0x802e, + 0x802f, 0x8030, 0x8032, 0x8034, 0x8039, 0x803a, 0x803c, 0x803e, + 0x8040, 0x8041, 0x8044, 0x8045, 0x8047, 0x8048, 0x8049, 0x804e, + 0x804f, 0x8050, 0x8051, 0x8053, 0x8055, 0x8056, 0x8057, 0x8059, + 0x805b, 0x805c, 0x805d, 0x805e, 0x805f, 0x8060, 0x8061, 0x8062, + 0x8063, 0x8064, 0x8065, 0x8066, 0x8067, 0x8068, 0x806b, 0x806c, + 0x806d, 0x806e, 0x806f, 0x8070, 0x8072, 0x8073, 0x8074, 0x8075, + 0x8076, 0x8077, 0x8078, 0x8079, 0x807a, 0x807b, 0x807c, 0x807d, + /* 0xc3 */ + 0x807e, 0x8081, 0x8082, 0x8085, 0x8088, 0x808a, 0x808d, 0x808e, + 0x808f, 0x8090, 0x8091, 0x8092, 0x8094, 0x8095, 0x8097, 0x8099, + 0x809e, 0x80a3, 0x80a6, 0x80a7, 0x80a8, 0x80ac, 0x80b0, 0x80b3, + 0x80b5, 0x80b6, 0x80b8, 0x80b9, 0x80bb, 0x80c5, 0x80c7, 0x80c8, + 0x80c9, 0x80ca, 0x80cb, 0x80cf, 0x80d0, 0x80d1, 0x80d2, 0x80d3, + 0x80d4, 0x80d5, 0x80d8, 0x80df, 0x80e0, 0x80e2, 0x80e3, 0x80e6, + 0x80ee, 0x80f5, 0x80f7, 0x80f9, 0x80fb, 0x80fe, 0x80ff, 0x8100, + 0x8101, 0x8103, 0x8104, 0x8105, 0x8107, 0x8108, 0x810b, 0x810c, + 0x8115, 0x8117, 0x8119, 0x811b, 0x811c, 0x811d, 0x811f, 0x8120, + 0x8121, 0x8122, 0x8123, 0x8124, 0x8125, 0x8126, 0x8127, 0x8128, + 0x8129, 0x812a, 0x812b, 0x812d, 0x812e, 0x8130, 0x8133, 0x8134, + 0x8135, 0x8137, 0x8139, 0x813a, 0x813b, 0x813c, 0x813d, 0x813f, + /* 0xc4 */ + 0x8140, 0x8141, 0x8142, 0x8143, 0x8144, 0x8145, 0x8147, 0x8149, + 0x814d, 0x814e, 0x814f, 0x8152, 0x8156, 0x8157, 0x8158, 0x815b, + 0x815c, 0x815d, 0x815e, 0x815f, 0x8161, 0x8162, 0x8163, 0x8164, + 0x8166, 0x8168, 0x816a, 0x816b, 0x816c, 0x816f, 0x8172, 0x8173, + 0x8175, 0x8176, 0x8177, 0x8178, 0x8181, 0x8183, 0x8184, 0x8185, + 0x8186, 0x8187, 0x8189, 0x818b, 0x818c, 0x818d, 0x818e, 0x8190, + 0x8192, 0x8193, 0x8194, 0x8195, 0x8196, 0x8197, 0x8199, 0x819a, + 0x819e, 0x819f, 0x81a0, 0x81a1, 0x81a2, 0x81a4, 0x81a5, 0x81a7, + 0x81a9, 0x81ab, 0x81ac, 0x81ad, 0x81ae, 0x81af, 0x81b0, 0x81b1, + 0x81b2, 0x81b4, 0x81b5, 0x81b6, 0x81b7, 0x81b8, 0x81b9, 0x81bc, + 0x81bd, 0x81be, 0x81bf, 0x81c4, 0x81c5, 0x81c7, 0x81c8, 0x81c9, + 0x81cb, 0x81cd, 0x81ce, 0x81cf, 0x81d0, 0x81d1, 0x81d2, 0x81d3, + /* 0xc5 */ + 0x81d4, 0x81d5, 0x81d6, 0x81d7, 0x81d8, 0x81d9, 0x81da, 0x81db, + 0x81dc, 0x81dd, 0x81de, 0x81df, 0x81e0, 0x81e1, 0x81e2, 0x81e4, + 0x81e5, 0x81e6, 0x81e8, 0x81e9, 0x81eb, 0x81ee, 0x81ef, 0x81f0, + 0x81f1, 0x81f2, 0x81f5, 0x81f6, 0x81f7, 0x81f8, 0x81f9, 0x81fa, + 0x81fd, 0x81ff, 0x8203, 0x8207, 0x8208, 0x8209, 0x820a, 0x820b, + 0x820e, 0x820f, 0x8211, 0x8213, 0x8215, 0x8216, 0x8217, 0x8218, + 0x8219, 0x821a, 0x821d, 0x8220, 0x8224, 0x8225, 0x8226, 0x8227, + 0x8229, 0x822e, 0x8232, 0x823a, 0x823c, 0x823d, 0x823f, 0x8240, + 0x8241, 0x8242, 0x8243, 0x8245, 0x8246, 0x8248, 0x824a, 0x824c, + 0x824d, 0x824e, 0x8250, 0x8251, 0x8252, 0x8253, 0x8254, 0x8255, + 0x8256, 0x8257, 0x8259, 0x825b, 0x825c, 0x825d, 0x825e, 0x8260, + 0x8261, 0x8262, 0x8263, 0x8264, 0x8265, 0x8266, 0x8267, 0x8269, + /* 0xc6 */ + 0x826a, 0x826b, 0x826c, 0x826d, 0x8271, 0x8275, 0x8276, 0x8277, + 0x8278, 0x827b, 0x827c, 0x8280, 0x8281, 0x8283, 0x8285, 0x8286, + 0x8287, 0x8289, 0x828c, 0x8290, 0x8293, 0x8294, 0x8295, 0x8296, + 0x829a, 0x829b, 0x829e, 0x82a0, 0x82a2, 0x82a3, 0x82a7, 0x82b2, + 0x82b5, 0x82b6, 0x82ba, 0x82bb, 0x82bc, 0x82bf, 0x82c0, 0x82c2, + 0x82c3, 0x82c5, 0x82c6, 0x82c9, 0x82d0, 0x82d6, 0x82d9, 0x82da, + 0x82dd, 0x82e2, 0x82e7, 0x82e8, 0x82e9, 0x82ea, 0x82ec, 0x82ed, + 0x82ee, 0x82f0, 0x82f2, 0x82f3, 0x82f5, 0x82f6, 0x82f8, 0x82fa, + 0x82fc, 0x82fd, 0x82fe, 0x82ff, 0x8300, 0x830a, 0x830b, 0x830d, + 0x8310, 0x8312, 0x8313, 0x8316, 0x8318, 0x8319, 0x831d, 0x831e, + 0x831f, 0x8320, 0x8321, 0x8322, 0x8323, 0x8324, 0x8325, 0x8326, + 0x8329, 0x832a, 0x832e, 0x8330, 0x8332, 0x8337, 0x833b, 0x833d, + /* 0xc7 */ + 0x833e, 0x833f, 0x8341, 0x8342, 0x8344, 0x8345, 0x8348, 0x834a, + 0x834b, 0x834c, 0x834d, 0x834e, 0x8353, 0x8355, 0x8356, 0x8357, + 0x8358, 0x8359, 0x835d, 0x8362, 0x8370, 0x8371, 0x8372, 0x8373, + 0x8374, 0x8375, 0x8376, 0x8379, 0x837a, 0x837e, 0x837f, 0x8380, + 0x8381, 0x8382, 0x8383, 0x8384, 0x8387, 0x8388, 0x838a, 0x838b, + 0x838c, 0x838d, 0x838f, 0x8390, 0x8391, 0x8394, 0x8395, 0x8396, + 0x8397, 0x8399, 0x839a, 0x839d, 0x839f, 0x83a1, 0x83a2, 0x83a3, + 0x83a4, 0x83a5, 0x83a6, 0x83a7, 0x83ac, 0x83ad, 0x83ae, 0x83af, + 0x83b5, 0x83bb, 0x83be, 0x83bf, 0x83c2, 0x83c3, 0x83c4, 0x83c6, + 0x83c8, 0x83c9, 0x83cb, 0x83cd, 0x83ce, 0x83d0, 0x83d1, 0x83d2, + 0x83d3, 0x83d5, 0x83d7, 0x83d9, 0x83da, 0x83db, 0x83de, 0x83e2, + 0x83e3, 0x83e4, 0x83e6, 0x83e7, 0x83e8, 0x83eb, 0x83ec, 0x83ed, + /* 0xc8 */ + 0x83ee, 0x83ef, 0x83f3, 0x83f4, 0x83f5, 0x83f6, 0x83f7, 0x83fa, + 0x83fb, 0x83fc, 0x83fe, 0x83ff, 0x8400, 0x8402, 0x8405, 0x8407, + 0x8408, 0x8409, 0x840a, 0x8410, 0x8412, 0x8413, 0x8414, 0x8415, + 0x8416, 0x8417, 0x8419, 0x841a, 0x841b, 0x841e, 0x841f, 0x8420, + 0x8421, 0x8422, 0x8423, 0x8429, 0x842a, 0x842b, 0x842c, 0x842d, + 0x842e, 0x842f, 0x8430, 0x8432, 0x8433, 0x8434, 0x8435, 0x8436, + 0x8437, 0x8439, 0x843a, 0x843b, 0x843e, 0x843f, 0x8440, 0x8441, + 0x8442, 0x8443, 0x8444, 0x8445, 0x8447, 0x8448, 0x8449, 0x844a, + 0x844b, 0x844c, 0x844d, 0x844e, 0x844f, 0x8450, 0x8452, 0x8453, + 0x8454, 0x8455, 0x8456, 0x8458, 0x845d, 0x845e, 0x845f, 0x8460, + 0x8462, 0x8464, 0x8465, 0x8466, 0x8467, 0x8468, 0x846a, 0x846e, + 0x846f, 0x8470, 0x8472, 0x8474, 0x8477, 0x8479, 0x847b, 0x847c, + /* 0xc9 */ + 0x847d, 0x847e, 0x847f, 0x8480, 0x8481, 0x8483, 0x8484, 0x8485, + 0x8486, 0x848a, 0x848d, 0x848f, 0x8490, 0x8491, 0x8492, 0x8493, + 0x8494, 0x8495, 0x8496, 0x8498, 0x849a, 0x849b, 0x849d, 0x849e, + 0x849f, 0x84a0, 0x84a2, 0x84a3, 0x84a4, 0x84a5, 0x84a6, 0x84a7, + 0x84a8, 0x84a9, 0x84aa, 0x84ab, 0x84ac, 0x84ad, 0x84ae, 0x84b0, + 0x84b1, 0x84b3, 0x84b5, 0x84b6, 0x84b7, 0x84bb, 0x84bc, 0x84be, + 0x84c0, 0x84c2, 0x84c3, 0x84c5, 0x84c6, 0x84c7, 0x84c8, 0x84cb, + 0x84cc, 0x84ce, 0x84cf, 0x84d2, 0x84d4, 0x84d5, 0x84d7, 0x84d8, + 0x84d9, 0x84da, 0x84db, 0x84dc, 0x84de, 0x84e1, 0x84e2, 0x84e4, + 0x84e7, 0x84e8, 0x84e9, 0x84ea, 0x84eb, 0x84ed, 0x84ee, 0x84ef, + 0x84f1, 0x84f2, 0x84f3, 0x84f4, 0x84f5, 0x84f6, 0x84f7, 0x84f8, + 0x84f9, 0x84fa, 0x84fb, 0x84fd, 0x84fe, 0x8500, 0x8501, 0x8502, + /* 0xca */ + 0x8503, 0x8504, 0x8505, 0x8506, 0x8507, 0x8508, 0x8509, 0x850a, + 0x850b, 0x850d, 0x850e, 0x850f, 0x8510, 0x8512, 0x8514, 0x8515, + 0x8516, 0x8518, 0x8519, 0x851b, 0x851c, 0x851d, 0x851e, 0x8520, + 0x8522, 0x8523, 0x8524, 0x8525, 0x8526, 0x8527, 0x8528, 0x8529, + 0x852a, 0x852d, 0x852e, 0x852f, 0x8530, 0x8531, 0x8532, 0x8533, + 0x8534, 0x8535, 0x8536, 0x853e, 0x853f, 0x8540, 0x8541, 0x8542, + 0x8544, 0x8545, 0x8546, 0x8547, 0x854b, 0x854c, 0x854d, 0x854e, + 0x854f, 0x8550, 0x8551, 0x8552, 0x8553, 0x8554, 0x8555, 0x8557, + 0x8558, 0x855a, 0x855b, 0x855c, 0x855d, 0x855f, 0x8560, 0x8561, + 0x8562, 0x8563, 0x8565, 0x8566, 0x8567, 0x8569, 0x856a, 0x856b, + 0x856c, 0x856d, 0x856e, 0x856f, 0x8570, 0x8571, 0x8573, 0x8575, + 0x8576, 0x8577, 0x8578, 0x857c, 0x857d, 0x857f, 0x8580, 0x8581, + /* 0xcb */ + 0x8582, 0x8583, 0x8586, 0x8588, 0x8589, 0x858a, 0x858b, 0x858c, + 0x858d, 0x858e, 0x8590, 0x8591, 0x8592, 0x8593, 0x8594, 0x8595, + 0x8596, 0x8597, 0x8598, 0x8599, 0x859a, 0x859d, 0x859e, 0x859f, + 0x85a0, 0x85a1, 0x85a2, 0x85a3, 0x85a5, 0x85a6, 0x85a7, 0x85a9, + 0x85ab, 0x85ac, 0x85ad, 0x85b1, 0x85b2, 0x85b3, 0x85b4, 0x85b5, + 0x85b6, 0x85b8, 0x85ba, 0x85bb, 0x85bc, 0x85bd, 0x85be, 0x85bf, + 0x85c0, 0x85c2, 0x85c3, 0x85c4, 0x85c5, 0x85c6, 0x85c7, 0x85c8, + 0x85ca, 0x85cb, 0x85cc, 0x85cd, 0x85ce, 0x85d1, 0x85d2, 0x85d4, + 0x85d6, 0x85d7, 0x85d8, 0x85d9, 0x85da, 0x85db, 0x85dd, 0x85de, + 0x85df, 0x85e0, 0x85e1, 0x85e2, 0x85e3, 0x85e5, 0x85e6, 0x85e7, + 0x85e8, 0x85ea, 0x85eb, 0x85ec, 0x85ed, 0x85ee, 0x85ef, 0x85f0, + 0x85f1, 0x85f2, 0x85f3, 0x85f4, 0x85f5, 0x85f6, 0x85f7, 0x85f8, + /* 0xcc */ + 0x85f9, 0x85fa, 0x85fc, 0x85fd, 0x85fe, 0x8600, 0x8601, 0x8602, + 0x8603, 0x8604, 0x8606, 0x8607, 0x8608, 0x8609, 0x860a, 0x860b, + 0x860c, 0x860d, 0x860e, 0x860f, 0x8610, 0x8612, 0x8613, 0x8614, + 0x8615, 0x8617, 0x8618, 0x8619, 0x861a, 0x861b, 0x861c, 0x861d, + 0x861e, 0x861f, 0x8620, 0x8621, 0x8622, 0x8623, 0x8624, 0x8625, + 0x8626, 0x8628, 0x862a, 0x862b, 0x862c, 0x862d, 0x862e, 0x862f, + 0x8630, 0x8631, 0x8632, 0x8633, 0x8634, 0x8635, 0x8636, 0x8637, + 0x8639, 0x863a, 0x863b, 0x863d, 0x863e, 0x863f, 0x8640, 0x8641, + 0x8642, 0x8643, 0x8644, 0x8645, 0x8646, 0x8647, 0x8648, 0x8649, + 0x864a, 0x864b, 0x864c, 0x8652, 0x8653, 0x8655, 0x8656, 0x8657, + 0x8658, 0x8659, 0x865b, 0x865c, 0x865d, 0x865f, 0x8660, 0x8661, + 0x8663, 0x8664, 0x8665, 0x8666, 0x8667, 0x8668, 0x8669, 0x866a, + /* 0xcd */ + 0x866d, 0x866f, 0x8670, 0x8672, 0x8673, 0x8674, 0x8675, 0x8676, + 0x8677, 0x8678, 0x8683, 0x8684, 0x8685, 0x8686, 0x8687, 0x8688, + 0x8689, 0x868e, 0x868f, 0x8690, 0x8691, 0x8692, 0x8694, 0x8696, + 0x8697, 0x8698, 0x8699, 0x869a, 0x869b, 0x869e, 0x869f, 0x86a0, + 0x86a1, 0x86a2, 0x86a5, 0x86a6, 0x86ab, 0x86ad, 0x86ae, 0x86b2, + 0x86b3, 0x86b7, 0x86b8, 0x86b9, 0x86bb, 0x86bc, 0x86bd, 0x86be, + 0x86bf, 0x86c1, 0x86c2, 0x86c3, 0x86c5, 0x86c8, 0x86cc, 0x86cd, + 0x86d2, 0x86d3, 0x86d5, 0x86d6, 0x86d7, 0x86da, 0x86dc, 0x86dd, + 0x86e0, 0x86e1, 0x86e2, 0x86e3, 0x86e5, 0x86e6, 0x86e7, 0x86e8, + 0x86ea, 0x86eb, 0x86ec, 0x86ef, 0x86f5, 0x86f6, 0x86f7, 0x86fa, + 0x86fb, 0x86fc, 0x86fd, 0x86ff, 0x8701, 0x8704, 0x8705, 0x8706, + 0x870b, 0x870c, 0x870e, 0x870f, 0x8710, 0x8711, 0x8714, 0x8716, + /* 0xce */ + 0x8719, 0x871b, 0x871d, 0x871f, 0x8720, 0x8724, 0x8726, 0x8727, + 0x8728, 0x872a, 0x872b, 0x872c, 0x872d, 0x872f, 0x8730, 0x8732, + 0x8733, 0x8735, 0x8736, 0x8738, 0x8739, 0x873a, 0x873c, 0x873d, + 0x8740, 0x8741, 0x8742, 0x8743, 0x8744, 0x8745, 0x8746, 0x874a, + 0x874b, 0x874d, 0x874f, 0x8750, 0x8751, 0x8752, 0x8754, 0x8755, + 0x8756, 0x8758, 0x875a, 0x875b, 0x875c, 0x875d, 0x875e, 0x875f, + 0x8761, 0x8762, 0x8766, 0x8767, 0x8768, 0x8769, 0x876a, 0x876b, + 0x876c, 0x876d, 0x876f, 0x8771, 0x8772, 0x8773, 0x8775, 0x8777, + 0x8778, 0x8779, 0x877a, 0x877f, 0x8780, 0x8781, 0x8784, 0x8786, + 0x8787, 0x8789, 0x878a, 0x878c, 0x878e, 0x878f, 0x8790, 0x8791, + 0x8792, 0x8794, 0x8795, 0x8796, 0x8798, 0x8799, 0x879a, 0x879b, + 0x879c, 0x879d, 0x879e, 0x87a0, 0x87a1, 0x87a2, 0x87a3, 0x87a4, + /* 0xcf */ + 0x87a5, 0x87a6, 0x87a7, 0x87a9, 0x87aa, 0x87ae, 0x87b0, 0x87b1, + 0x87b2, 0x87b4, 0x87b6, 0x87b7, 0x87b8, 0x87b9, 0x87bb, 0x87bc, + 0x87be, 0x87bf, 0x87c1, 0x87c2, 0x87c3, 0x87c4, 0x87c5, 0x87c7, + 0x87c8, 0x87c9, 0x87cc, 0x87cd, 0x87ce, 0x87cf, 0x87d0, 0x87d4, + 0x87d5, 0x87d6, 0x87d7, 0x87d8, 0x87d9, 0x87da, 0x87dc, 0x87dd, + 0x87de, 0x87df, 0x87e1, 0x87e2, 0x87e3, 0x87e4, 0x87e6, 0x87e7, + 0x87e8, 0x87e9, 0x87eb, 0x87ec, 0x87ed, 0x87ef, 0x87f0, 0x87f1, + 0x87f2, 0x87f3, 0x87f4, 0x87f5, 0x87f6, 0x87f7, 0x87f8, 0x87fa, + 0x87fb, 0x87fc, 0x87fd, 0x87ff, 0x8800, 0x8801, 0x8802, 0x8804, + 0x8805, 0x8806, 0x8807, 0x8808, 0x8809, 0x880b, 0x880c, 0x880d, + 0x880e, 0x880f, 0x8810, 0x8811, 0x8812, 0x8814, 0x8817, 0x8818, + 0x8819, 0x881a, 0x881c, 0x881d, 0x881e, 0x881f, 0x8820, 0x8823, + /* 0xd0 */ + 0x8824, 0x8825, 0x8826, 0x8827, 0x8828, 0x8829, 0x882a, 0x882b, + 0x882c, 0x882d, 0x882e, 0x882f, 0x8830, 0x8831, 0x8833, 0x8834, + 0x8835, 0x8836, 0x8837, 0x8838, 0x883a, 0x883b, 0x883d, 0x883e, + 0x883f, 0x8841, 0x8842, 0x8843, 0x8846, 0x8847, 0x8848, 0x8849, + 0x884a, 0x884b, 0x884e, 0x884f, 0x8850, 0x8851, 0x8852, 0x8853, + 0x8855, 0x8856, 0x8858, 0x885a, 0x885b, 0x885c, 0x885d, 0x885e, + 0x885f, 0x8860, 0x8866, 0x8867, 0x886a, 0x886d, 0x886f, 0x8871, + 0x8873, 0x8874, 0x8875, 0x8876, 0x8878, 0x8879, 0x887a, 0x887b, + 0x887c, 0x8880, 0x8883, 0x8886, 0x8887, 0x8889, 0x888a, 0x888c, + 0x888e, 0x888f, 0x8890, 0x8891, 0x8893, 0x8894, 0x8895, 0x8897, + 0x8898, 0x8899, 0x889a, 0x889b, 0x889d, 0x889e, 0x889f, 0x88a0, + 0x88a1, 0x88a3, 0x88a5, 0x88a6, 0x88a7, 0x88a8, 0x88a9, 0x88aa, + /* 0xd1 */ + 0x88ac, 0x88ae, 0x88af, 0x88b0, 0x88b2, 0x88b3, 0x88b4, 0x88b5, + 0x88b6, 0x88b8, 0x88b9, 0x88ba, 0x88bb, 0x88bd, 0x88be, 0x88bf, + 0x88c0, 0x88c3, 0x88c4, 0x88c7, 0x88c8, 0x88ca, 0x88cb, 0x88cc, + 0x88cd, 0x88cf, 0x88d0, 0x88d1, 0x88d3, 0x88d6, 0x88d7, 0x88da, + 0x88db, 0x88dc, 0x88dd, 0x88de, 0x88e0, 0x88e1, 0x88e6, 0x88e7, + 0x88e9, 0x88ea, 0x88eb, 0x88ec, 0x88ed, 0x88ee, 0x88ef, 0x88f2, + 0x88f5, 0x88f6, 0x88f7, 0x88fa, 0x88fb, 0x88fd, 0x88ff, 0x8900, + 0x8901, 0x8903, 0x8904, 0x8905, 0x8906, 0x8907, 0x8908, 0x8909, + 0x890b, 0x890c, 0x890d, 0x890e, 0x890f, 0x8911, 0x8914, 0x8915, + 0x8916, 0x8917, 0x8918, 0x891c, 0x891d, 0x891e, 0x891f, 0x8920, + 0x8922, 0x8923, 0x8924, 0x8926, 0x8927, 0x8928, 0x8929, 0x892c, + 0x892d, 0x892e, 0x892f, 0x8931, 0x8932, 0x8933, 0x8935, 0x8937, + /* 0xd2 */ + 0x8938, 0x8939, 0x893a, 0x893b, 0x893c, 0x893d, 0x893e, 0x893f, + 0x8940, 0x8942, 0x8943, 0x8945, 0x8946, 0x8947, 0x8948, 0x8949, + 0x894a, 0x894b, 0x894c, 0x894d, 0x894e, 0x894f, 0x8950, 0x8951, + 0x8952, 0x8953, 0x8954, 0x8955, 0x8956, 0x8957, 0x8958, 0x8959, + 0x895a, 0x895b, 0x895c, 0x895d, 0x8960, 0x8961, 0x8962, 0x8963, + 0x8964, 0x8965, 0x8967, 0x8968, 0x8969, 0x896a, 0x896b, 0x896c, + 0x896d, 0x896e, 0x896f, 0x8970, 0x8971, 0x8972, 0x8973, 0x8974, + 0x8975, 0x8976, 0x8977, 0x8978, 0x8979, 0x897a, 0x897c, 0x897d, + 0x897e, 0x8980, 0x8982, 0x8984, 0x8985, 0x8987, 0x8988, 0x8989, + 0x898a, 0x898b, 0x898c, 0x898d, 0x898e, 0x898f, 0x8990, 0x8991, + 0x8992, 0x8993, 0x8994, 0x8995, 0x8996, 0x8997, 0x8998, 0x8999, + 0x899a, 0x899b, 0x899c, 0x899d, 0x899e, 0x899f, 0x89a0, 0x89a1, + /* 0xd3 */ + 0x89a2, 0x89a3, 0x89a4, 0x89a5, 0x89a6, 0x89a7, 0x89a8, 0x89a9, + 0x89aa, 0x89ab, 0x89ac, 0x89ad, 0x89ae, 0x89af, 0x89b0, 0x89b1, + 0x89b2, 0x89b3, 0x89b4, 0x89b5, 0x89b6, 0x89b7, 0x89b8, 0x89b9, + 0x89ba, 0x89bb, 0x89bc, 0x89bd, 0x89be, 0x89bf, 0x89c0, 0x89c3, + 0x89cd, 0x89d3, 0x89d4, 0x89d5, 0x89d7, 0x89d8, 0x89d9, 0x89db, + 0x89dd, 0x89df, 0x89e0, 0x89e1, 0x89e2, 0x89e4, 0x89e7, 0x89e8, + 0x89e9, 0x89ea, 0x89ec, 0x89ed, 0x89ee, 0x89f0, 0x89f1, 0x89f2, + 0x89f4, 0x89f5, 0x89f6, 0x89f7, 0x89f8, 0x89f9, 0x89fa, 0x89fb, + 0x89fc, 0x89fd, 0x89fe, 0x89ff, 0x8a01, 0x8a02, 0x8a03, 0x8a04, + 0x8a05, 0x8a06, 0x8a08, 0x8a09, 0x8a0a, 0x8a0b, 0x8a0c, 0x8a0d, + 0x8a0e, 0x8a0f, 0x8a10, 0x8a11, 0x8a12, 0x8a13, 0x8a14, 0x8a15, + 0x8a16, 0x8a17, 0x8a18, 0x8a19, 0x8a1a, 0x8a1b, 0x8a1c, 0x8a1d, + /* 0xd4 */ + 0x8a1e, 0x8a1f, 0x8a20, 0x8a21, 0x8a22, 0x8a23, 0x8a24, 0x8a25, + 0x8a26, 0x8a27, 0x8a28, 0x8a29, 0x8a2a, 0x8a2b, 0x8a2c, 0x8a2d, + 0x8a2e, 0x8a2f, 0x8a30, 0x8a31, 0x8a32, 0x8a33, 0x8a34, 0x8a35, + 0x8a36, 0x8a37, 0x8a38, 0x8a39, 0x8a3a, 0x8a3b, 0x8a3c, 0x8a3d, + 0x8a3f, 0x8a40, 0x8a41, 0x8a42, 0x8a43, 0x8a44, 0x8a45, 0x8a46, + 0x8a47, 0x8a49, 0x8a4a, 0x8a4b, 0x8a4c, 0x8a4d, 0x8a4e, 0x8a4f, + 0x8a50, 0x8a51, 0x8a52, 0x8a53, 0x8a54, 0x8a55, 0x8a56, 0x8a57, + 0x8a58, 0x8a59, 0x8a5a, 0x8a5b, 0x8a5c, 0x8a5d, 0x8a5e, 0x8a5f, + 0x8a60, 0x8a61, 0x8a62, 0x8a63, 0x8a64, 0x8a65, 0x8a66, 0x8a67, + 0x8a68, 0x8a69, 0x8a6a, 0x8a6b, 0x8a6c, 0x8a6d, 0x8a6e, 0x8a6f, + 0x8a70, 0x8a71, 0x8a72, 0x8a73, 0x8a74, 0x8a75, 0x8a76, 0x8a77, + 0x8a78, 0x8a7a, 0x8a7b, 0x8a7c, 0x8a7d, 0x8a7e, 0x8a7f, 0x8a80, + /* 0xd5 */ + 0x8a81, 0x8a82, 0x8a83, 0x8a84, 0x8a85, 0x8a86, 0x8a87, 0x8a88, + 0x8a8b, 0x8a8c, 0x8a8d, 0x8a8e, 0x8a8f, 0x8a90, 0x8a91, 0x8a92, + 0x8a94, 0x8a95, 0x8a96, 0x8a97, 0x8a98, 0x8a99, 0x8a9a, 0x8a9b, + 0x8a9c, 0x8a9d, 0x8a9e, 0x8a9f, 0x8aa0, 0x8aa1, 0x8aa2, 0x8aa3, + 0x8aa4, 0x8aa5, 0x8aa6, 0x8aa7, 0x8aa8, 0x8aa9, 0x8aaa, 0x8aab, + 0x8aac, 0x8aad, 0x8aae, 0x8aaf, 0x8ab0, 0x8ab1, 0x8ab2, 0x8ab3, + 0x8ab4, 0x8ab5, 0x8ab6, 0x8ab7, 0x8ab8, 0x8ab9, 0x8aba, 0x8abb, + 0x8abc, 0x8abd, 0x8abe, 0x8abf, 0x8ac0, 0x8ac1, 0x8ac2, 0x8ac3, + 0x8ac4, 0x8ac5, 0x8ac6, 0x8ac7, 0x8ac8, 0x8ac9, 0x8aca, 0x8acb, + 0x8acc, 0x8acd, 0x8ace, 0x8acf, 0x8ad0, 0x8ad1, 0x8ad2, 0x8ad3, + 0x8ad4, 0x8ad5, 0x8ad6, 0x8ad7, 0x8ad8, 0x8ad9, 0x8ada, 0x8adb, + 0x8adc, 0x8add, 0x8ade, 0x8adf, 0x8ae0, 0x8ae1, 0x8ae2, 0x8ae3, + /* 0xd6 */ + 0x8ae4, 0x8ae5, 0x8ae6, 0x8ae7, 0x8ae8, 0x8ae9, 0x8aea, 0x8aeb, + 0x8aec, 0x8aed, 0x8aee, 0x8aef, 0x8af0, 0x8af1, 0x8af2, 0x8af3, + 0x8af4, 0x8af5, 0x8af6, 0x8af7, 0x8af8, 0x8af9, 0x8afa, 0x8afb, + 0x8afc, 0x8afd, 0x8afe, 0x8aff, 0x8b00, 0x8b01, 0x8b02, 0x8b03, + 0x8b04, 0x8b05, 0x8b06, 0x8b08, 0x8b09, 0x8b0a, 0x8b0b, 0x8b0c, + 0x8b0d, 0x8b0e, 0x8b0f, 0x8b10, 0x8b11, 0x8b12, 0x8b13, 0x8b14, + 0x8b15, 0x8b16, 0x8b17, 0x8b18, 0x8b19, 0x8b1a, 0x8b1b, 0x8b1c, + 0x8b1d, 0x8b1e, 0x8b1f, 0x8b20, 0x8b21, 0x8b22, 0x8b23, 0x8b24, + 0x8b25, 0x8b27, 0x8b28, 0x8b29, 0x8b2a, 0x8b2b, 0x8b2c, 0x8b2d, + 0x8b2e, 0x8b2f, 0x8b30, 0x8b31, 0x8b32, 0x8b33, 0x8b34, 0x8b35, + 0x8b36, 0x8b37, 0x8b38, 0x8b39, 0x8b3a, 0x8b3b, 0x8b3c, 0x8b3d, + 0x8b3e, 0x8b3f, 0x8b40, 0x8b41, 0x8b42, 0x8b43, 0x8b44, 0x8b45, + /* 0xd7 */ + 0x8b46, 0x8b47, 0x8b48, 0x8b49, 0x8b4a, 0x8b4b, 0x8b4c, 0x8b4d, + 0x8b4e, 0x8b4f, 0x8b50, 0x8b51, 0x8b52, 0x8b53, 0x8b54, 0x8b55, + 0x8b56, 0x8b57, 0x8b58, 0x8b59, 0x8b5a, 0x8b5b, 0x8b5c, 0x8b5d, + 0x8b5e, 0x8b5f, 0x8b60, 0x8b61, 0x8b62, 0x8b63, 0x8b64, 0x8b65, + 0x8b67, 0x8b68, 0x8b69, 0x8b6a, 0x8b6b, 0x8b6d, 0x8b6e, 0x8b6f, + 0x8b70, 0x8b71, 0x8b72, 0x8b73, 0x8b74, 0x8b75, 0x8b76, 0x8b77, + 0x8b78, 0x8b79, 0x8b7a, 0x8b7b, 0x8b7c, 0x8b7d, 0x8b7e, 0x8b7f, + 0x8b80, 0x8b81, 0x8b82, 0x8b83, 0x8b84, 0x8b85, 0x8b86, 0x8b87, + 0x8b88, 0x8b89, 0x8b8a, 0x8b8b, 0x8b8c, 0x8b8d, 0x8b8e, 0x8b8f, + 0x8b90, 0x8b91, 0x8b92, 0x8b93, 0x8b94, 0x8b95, 0x8b96, 0x8b97, + 0x8b98, 0x8b99, 0x8b9a, 0x8b9b, 0x8b9c, 0x8b9d, 0x8b9e, 0x8b9f, + 0x8bac, 0x8bb1, 0x8bbb, 0x8bc7, 0x8bd0, 0x8bea, 0x8c09, 0x8c1e, + /* 0xd8 */ + 0x8c38, 0x8c39, 0x8c3a, 0x8c3b, 0x8c3c, 0x8c3d, 0x8c3e, 0x8c3f, + 0x8c40, 0x8c42, 0x8c43, 0x8c44, 0x8c45, 0x8c48, 0x8c4a, 0x8c4b, + 0x8c4d, 0x8c4e, 0x8c4f, 0x8c50, 0x8c51, 0x8c52, 0x8c53, 0x8c54, + 0x8c56, 0x8c57, 0x8c58, 0x8c59, 0x8c5b, 0x8c5c, 0x8c5d, 0x8c5e, + 0x8c5f, 0x8c60, 0x8c63, 0x8c64, 0x8c65, 0x8c66, 0x8c67, 0x8c68, + 0x8c69, 0x8c6c, 0x8c6d, 0x8c6e, 0x8c6f, 0x8c70, 0x8c71, 0x8c72, + 0x8c74, 0x8c75, 0x8c76, 0x8c77, 0x8c7b, 0x8c7c, 0x8c7d, 0x8c7e, + 0x8c7f, 0x8c80, 0x8c81, 0x8c83, 0x8c84, 0x8c86, 0x8c87, 0x8c88, + 0x8c8b, 0x8c8d, 0x8c8e, 0x8c8f, 0x8c90, 0x8c91, 0x8c92, 0x8c93, + 0x8c95, 0x8c96, 0x8c97, 0x8c99, 0x8c9a, 0x8c9b, 0x8c9c, 0x8c9d, + 0x8c9e, 0x8c9f, 0x8ca0, 0x8ca1, 0x8ca2, 0x8ca3, 0x8ca4, 0x8ca5, + 0x8ca6, 0x8ca7, 0x8ca8, 0x8ca9, 0x8caa, 0x8cab, 0x8cac, 0x8cad, + /* 0xd9 */ + 0x8cae, 0x8caf, 0x8cb0, 0x8cb1, 0x8cb2, 0x8cb3, 0x8cb4, 0x8cb5, + 0x8cb6, 0x8cb7, 0x8cb8, 0x8cb9, 0x8cba, 0x8cbb, 0x8cbc, 0x8cbd, + 0x8cbe, 0x8cbf, 0x8cc0, 0x8cc1, 0x8cc2, 0x8cc3, 0x8cc4, 0x8cc5, + 0x8cc6, 0x8cc7, 0x8cc8, 0x8cc9, 0x8cca, 0x8ccb, 0x8ccc, 0x8ccd, + 0x8cce, 0x8ccf, 0x8cd0, 0x8cd1, 0x8cd2, 0x8cd3, 0x8cd4, 0x8cd5, + 0x8cd6, 0x8cd7, 0x8cd8, 0x8cd9, 0x8cda, 0x8cdb, 0x8cdc, 0x8cdd, + 0x8cde, 0x8cdf, 0x8ce0, 0x8ce1, 0x8ce2, 0x8ce3, 0x8ce4, 0x8ce5, + 0x8ce6, 0x8ce7, 0x8ce8, 0x8ce9, 0x8cea, 0x8ceb, 0x8cec, 0x8ced, + 0x8cee, 0x8cef, 0x8cf0, 0x8cf1, 0x8cf2, 0x8cf3, 0x8cf4, 0x8cf5, + 0x8cf6, 0x8cf7, 0x8cf8, 0x8cf9, 0x8cfa, 0x8cfb, 0x8cfc, 0x8cfd, + 0x8cfe, 0x8cff, 0x8d00, 0x8d01, 0x8d02, 0x8d03, 0x8d04, 0x8d05, + 0x8d06, 0x8d07, 0x8d08, 0x8d09, 0x8d0a, 0x8d0b, 0x8d0c, 0x8d0d, + /* 0xda */ + 0x8d0e, 0x8d0f, 0x8d10, 0x8d11, 0x8d12, 0x8d13, 0x8d14, 0x8d15, + 0x8d16, 0x8d17, 0x8d18, 0x8d19, 0x8d1a, 0x8d1b, 0x8d1c, 0x8d20, + 0x8d51, 0x8d52, 0x8d57, 0x8d5f, 0x8d65, 0x8d68, 0x8d69, 0x8d6a, + 0x8d6c, 0x8d6e, 0x8d6f, 0x8d71, 0x8d72, 0x8d78, 0x8d79, 0x8d7a, + 0x8d7b, 0x8d7c, 0x8d7d, 0x8d7e, 0x8d7f, 0x8d80, 0x8d82, 0x8d83, + 0x8d86, 0x8d87, 0x8d88, 0x8d89, 0x8d8c, 0x8d8d, 0x8d8e, 0x8d8f, + 0x8d90, 0x8d92, 0x8d93, 0x8d95, 0x8d96, 0x8d97, 0x8d98, 0x8d99, + 0x8d9a, 0x8d9b, 0x8d9c, 0x8d9d, 0x8d9e, 0x8da0, 0x8da1, 0x8da2, + 0x8da4, 0x8da5, 0x8da6, 0x8da7, 0x8da8, 0x8da9, 0x8daa, 0x8dab, + 0x8dac, 0x8dad, 0x8dae, 0x8daf, 0x8db0, 0x8db2, 0x8db6, 0x8db7, + 0x8db9, 0x8dbb, 0x8dbd, 0x8dc0, 0x8dc1, 0x8dc2, 0x8dc5, 0x8dc7, + 0x8dc8, 0x8dc9, 0x8dca, 0x8dcd, 0x8dd0, 0x8dd2, 0x8dd3, 0x8dd4, + /* 0xdb */ + 0x8dd5, 0x8dd8, 0x8dd9, 0x8ddc, 0x8de0, 0x8de1, 0x8de2, 0x8de5, + 0x8de6, 0x8de7, 0x8de9, 0x8ded, 0x8dee, 0x8df0, 0x8df1, 0x8df2, + 0x8df4, 0x8df6, 0x8dfc, 0x8dfe, 0x8dff, 0x8e00, 0x8e01, 0x8e02, + 0x8e03, 0x8e04, 0x8e06, 0x8e07, 0x8e08, 0x8e0b, 0x8e0d, 0x8e0e, + 0x8e10, 0x8e11, 0x8e12, 0x8e13, 0x8e15, 0x8e16, 0x8e17, 0x8e18, + 0x8e19, 0x8e1a, 0x8e1b, 0x8e1c, 0x8e20, 0x8e21, 0x8e24, 0x8e25, + 0x8e26, 0x8e27, 0x8e28, 0x8e2b, 0x8e2d, 0x8e30, 0x8e32, 0x8e33, + 0x8e34, 0x8e36, 0x8e37, 0x8e38, 0x8e3b, 0x8e3c, 0x8e3e, 0x8e3f, + 0x8e43, 0x8e45, 0x8e46, 0x8e4c, 0x8e4d, 0x8e4e, 0x8e4f, 0x8e50, + 0x8e53, 0x8e54, 0x8e55, 0x8e56, 0x8e57, 0x8e58, 0x8e5a, 0x8e5b, + 0x8e5c, 0x8e5d, 0x8e5e, 0x8e5f, 0x8e60, 0x8e61, 0x8e62, 0x8e63, + 0x8e64, 0x8e65, 0x8e67, 0x8e68, 0x8e6a, 0x8e6b, 0x8e6e, 0x8e71, + /* 0xdc */ + 0x8e73, 0x8e75, 0x8e77, 0x8e78, 0x8e79, 0x8e7a, 0x8e7b, 0x8e7d, + 0x8e7e, 0x8e80, 0x8e82, 0x8e83, 0x8e84, 0x8e86, 0x8e88, 0x8e89, + 0x8e8a, 0x8e8b, 0x8e8c, 0x8e8d, 0x8e8e, 0x8e91, 0x8e92, 0x8e93, + 0x8e95, 0x8e96, 0x8e97, 0x8e98, 0x8e99, 0x8e9a, 0x8e9b, 0x8e9d, + 0x8e9f, 0x8ea0, 0x8ea1, 0x8ea2, 0x8ea3, 0x8ea4, 0x8ea5, 0x8ea6, + 0x8ea7, 0x8ea8, 0x8ea9, 0x8eaa, 0x8ead, 0x8eae, 0x8eb0, 0x8eb1, + 0x8eb3, 0x8eb4, 0x8eb5, 0x8eb6, 0x8eb7, 0x8eb8, 0x8eb9, 0x8ebb, + 0x8ebc, 0x8ebd, 0x8ebe, 0x8ebf, 0x8ec0, 0x8ec1, 0x8ec2, 0x8ec3, + 0x8ec4, 0x8ec5, 0x8ec6, 0x8ec7, 0x8ec8, 0x8ec9, 0x8eca, 0x8ecb, + 0x8ecc, 0x8ecd, 0x8ecf, 0x8ed0, 0x8ed1, 0x8ed2, 0x8ed3, 0x8ed4, + 0x8ed5, 0x8ed6, 0x8ed7, 0x8ed8, 0x8ed9, 0x8eda, 0x8edb, 0x8edc, + 0x8edd, 0x8ede, 0x8edf, 0x8ee0, 0x8ee1, 0x8ee2, 0x8ee3, 0x8ee4, + /* 0xdd */ + 0x8ee5, 0x8ee6, 0x8ee7, 0x8ee8, 0x8ee9, 0x8eea, 0x8eeb, 0x8eec, + 0x8eed, 0x8eee, 0x8eef, 0x8ef0, 0x8ef1, 0x8ef2, 0x8ef3, 0x8ef4, + 0x8ef5, 0x8ef6, 0x8ef7, 0x8ef8, 0x8ef9, 0x8efa, 0x8efb, 0x8efc, + 0x8efd, 0x8efe, 0x8eff, 0x8f00, 0x8f01, 0x8f02, 0x8f03, 0x8f04, + 0x8f05, 0x8f06, 0x8f07, 0x8f08, 0x8f09, 0x8f0a, 0x8f0b, 0x8f0c, + 0x8f0d, 0x8f0e, 0x8f0f, 0x8f10, 0x8f11, 0x8f12, 0x8f13, 0x8f14, + 0x8f15, 0x8f16, 0x8f17, 0x8f18, 0x8f19, 0x8f1a, 0x8f1b, 0x8f1c, + 0x8f1d, 0x8f1e, 0x8f1f, 0x8f20, 0x8f21, 0x8f22, 0x8f23, 0x8f24, + 0x8f25, 0x8f26, 0x8f27, 0x8f28, 0x8f29, 0x8f2a, 0x8f2b, 0x8f2c, + 0x8f2d, 0x8f2e, 0x8f2f, 0x8f30, 0x8f31, 0x8f32, 0x8f33, 0x8f34, + 0x8f35, 0x8f36, 0x8f37, 0x8f38, 0x8f39, 0x8f3a, 0x8f3b, 0x8f3c, + 0x8f3d, 0x8f3e, 0x8f3f, 0x8f40, 0x8f41, 0x8f42, 0x8f43, 0x8f44, + /* 0xde */ + 0x8f45, 0x8f46, 0x8f47, 0x8f48, 0x8f49, 0x8f4a, 0x8f4b, 0x8f4c, + 0x8f4d, 0x8f4e, 0x8f4f, 0x8f50, 0x8f51, 0x8f52, 0x8f53, 0x8f54, + 0x8f55, 0x8f56, 0x8f57, 0x8f58, 0x8f59, 0x8f5a, 0x8f5b, 0x8f5c, + 0x8f5d, 0x8f5e, 0x8f5f, 0x8f60, 0x8f61, 0x8f62, 0x8f63, 0x8f64, + 0x8f65, 0x8f6a, 0x8f80, 0x8f8c, 0x8f92, 0x8f9d, 0x8fa0, 0x8fa1, + 0x8fa2, 0x8fa4, 0x8fa5, 0x8fa6, 0x8fa7, 0x8faa, 0x8fac, 0x8fad, + 0x8fae, 0x8faf, 0x8fb2, 0x8fb3, 0x8fb4, 0x8fb5, 0x8fb7, 0x8fb8, + 0x8fba, 0x8fbb, 0x8fbc, 0x8fbf, 0x8fc0, 0x8fc3, 0x8fc6, 0x8fc9, + 0x8fca, 0x8fcb, 0x8fcc, 0x8fcd, 0x8fcf, 0x8fd2, 0x8fd6, 0x8fd7, + 0x8fda, 0x8fe0, 0x8fe1, 0x8fe3, 0x8fe7, 0x8fec, 0x8fef, 0x8ff1, + 0x8ff2, 0x8ff4, 0x8ff5, 0x8ff6, 0x8ffa, 0x8ffb, 0x8ffc, 0x8ffe, + 0x8fff, 0x9007, 0x9008, 0x900c, 0x900e, 0x9013, 0x9015, 0x9018, + /* 0xdf */ + 0x9019, 0x901c, 0x9023, 0x9024, 0x9025, 0x9027, 0x9028, 0x9029, + 0x902a, 0x902b, 0x902c, 0x9030, 0x9031, 0x9032, 0x9033, 0x9034, + 0x9037, 0x9039, 0x903a, 0x903d, 0x903f, 0x9040, 0x9043, 0x9045, + 0x9046, 0x9048, 0x9049, 0x904a, 0x904b, 0x904c, 0x904e, 0x9054, + 0x9055, 0x9056, 0x9059, 0x905a, 0x905c, 0x905d, 0x905e, 0x905f, + 0x9060, 0x9061, 0x9064, 0x9066, 0x9067, 0x9069, 0x906a, 0x906b, + 0x906c, 0x906f, 0x9070, 0x9071, 0x9072, 0x9073, 0x9076, 0x9077, + 0x9078, 0x9079, 0x907a, 0x907b, 0x907c, 0x907e, 0x9081, 0x9084, + 0x9085, 0x9086, 0x9087, 0x9089, 0x908a, 0x908c, 0x908d, 0x908e, + 0x908f, 0x9090, 0x9092, 0x9094, 0x9096, 0x9098, 0x909a, 0x909c, + 0x909e, 0x909f, 0x90a0, 0x90a4, 0x90a5, 0x90a7, 0x90a8, 0x90a9, + 0x90ab, 0x90ad, 0x90b2, 0x90b7, 0x90bc, 0x90bd, 0x90bf, 0x90c0, + /* 0xe0 */ + 0x90c2, 0x90c3, 0x90c6, 0x90c8, 0x90c9, 0x90cb, 0x90cc, 0x90cd, + 0x90d2, 0x90d4, 0x90d5, 0x90d6, 0x90d8, 0x90d9, 0x90da, 0x90de, + 0x90df, 0x90e0, 0x90e3, 0x90e4, 0x90e5, 0x90e9, 0x90ea, 0x90ec, + 0x90ee, 0x90f0, 0x90f1, 0x90f2, 0x90f3, 0x90f5, 0x90f6, 0x90f7, + 0x90f9, 0x90fa, 0x90fb, 0x90fc, 0x90ff, 0x9100, 0x9101, 0x9103, + 0x9105, 0x9106, 0x9107, 0x9108, 0x9109, 0x910a, 0x910b, 0x910c, + 0x910d, 0x910e, 0x910f, 0x9110, 0x9111, 0x9112, 0x9113, 0x9114, + 0x9115, 0x9116, 0x9117, 0x9118, 0x911a, 0x911b, 0x911c, 0x911d, + 0x911f, 0x9120, 0x9121, 0x9124, 0x9125, 0x9126, 0x9127, 0x9128, + 0x9129, 0x912a, 0x912b, 0x912c, 0x912d, 0x912e, 0x9130, 0x9132, + 0x9133, 0x9134, 0x9135, 0x9136, 0x9137, 0x9138, 0x913a, 0x913b, + 0x913c, 0x913d, 0x913e, 0x913f, 0x9140, 0x9141, 0x9142, 0x9144, + /* 0xe1 */ + 0x9145, 0x9147, 0x9148, 0x9151, 0x9153, 0x9154, 0x9155, 0x9156, + 0x9158, 0x9159, 0x915b, 0x915c, 0x915f, 0x9160, 0x9166, 0x9167, + 0x9168, 0x916b, 0x916d, 0x9173, 0x917a, 0x917b, 0x917c, 0x9180, + 0x9181, 0x9182, 0x9183, 0x9184, 0x9186, 0x9188, 0x918a, 0x918e, + 0x918f, 0x9193, 0x9194, 0x9195, 0x9196, 0x9197, 0x9198, 0x9199, + 0x919c, 0x919d, 0x919e, 0x919f, 0x91a0, 0x91a1, 0x91a4, 0x91a5, + 0x91a6, 0x91a7, 0x91a8, 0x91a9, 0x91ab, 0x91ac, 0x91b0, 0x91b1, + 0x91b2, 0x91b3, 0x91b6, 0x91b7, 0x91b8, 0x91b9, 0x91bb, 0x91bc, + 0x91bd, 0x91be, 0x91bf, 0x91c0, 0x91c1, 0x91c2, 0x91c3, 0x91c4, + 0x91c5, 0x91c6, 0x91c8, 0x91cb, 0x91d0, 0x91d2, 0x91d3, 0x91d4, + 0x91d5, 0x91d6, 0x91d7, 0x91d8, 0x91d9, 0x91da, 0x91db, 0x91dd, + 0x91de, 0x91df, 0x91e0, 0x91e1, 0x91e2, 0x91e3, 0x91e4, 0x91e5, + /* 0xe2 */ + 0x91e6, 0x91e7, 0x91e8, 0x91e9, 0x91ea, 0x91eb, 0x91ec, 0x91ed, + 0x91ee, 0x91ef, 0x91f0, 0x91f1, 0x91f2, 0x91f3, 0x91f4, 0x91f5, + 0x91f6, 0x91f7, 0x91f8, 0x91f9, 0x91fa, 0x91fb, 0x91fc, 0x91fd, + 0x91fe, 0x91ff, 0x9200, 0x9201, 0x9202, 0x9203, 0x9204, 0x9205, + 0x9206, 0x9207, 0x9208, 0x9209, 0x920a, 0x920b, 0x920c, 0x920d, + 0x920e, 0x920f, 0x9210, 0x9211, 0x9212, 0x9213, 0x9214, 0x9215, + 0x9216, 0x9217, 0x9218, 0x9219, 0x921a, 0x921b, 0x921c, 0x921d, + 0x921e, 0x921f, 0x9220, 0x9221, 0x9222, 0x9223, 0x9224, 0x9225, + 0x9226, 0x9227, 0x9228, 0x9229, 0x922a, 0x922b, 0x922c, 0x922d, + 0x922e, 0x922f, 0x9230, 0x9231, 0x9232, 0x9233, 0x9234, 0x9235, + 0x9236, 0x9237, 0x9238, 0x9239, 0x923a, 0x923b, 0x923c, 0x923d, + 0x923e, 0x923f, 0x9240, 0x9241, 0x9242, 0x9243, 0x9244, 0x9245, + /* 0xe3 */ + 0x9246, 0x9247, 0x9248, 0x9249, 0x924a, 0x924b, 0x924c, 0x924d, + 0x924e, 0x924f, 0x9250, 0x9251, 0x9252, 0x9253, 0x9254, 0x9255, + 0x9256, 0x9257, 0x9258, 0x9259, 0x925a, 0x925b, 0x925c, 0x925d, + 0x925e, 0x925f, 0x9260, 0x9261, 0x9262, 0x9263, 0x9264, 0x9265, + 0x9266, 0x9267, 0x9268, 0x9269, 0x926a, 0x926b, 0x926c, 0x926d, + 0x926e, 0x926f, 0x9270, 0x9271, 0x9272, 0x9273, 0x9275, 0x9276, + 0x9277, 0x9278, 0x9279, 0x927a, 0x927b, 0x927c, 0x927d, 0x927e, + 0x927f, 0x9280, 0x9281, 0x9282, 0x9283, 0x9284, 0x9285, 0x9286, + 0x9287, 0x9288, 0x9289, 0x928a, 0x928b, 0x928c, 0x928d, 0x928f, + 0x9290, 0x9291, 0x9292, 0x9293, 0x9294, 0x9295, 0x9296, 0x9297, + 0x9298, 0x9299, 0x929a, 0x929b, 0x929c, 0x929d, 0x929e, 0x929f, + 0x92a0, 0x92a1, 0x92a2, 0x92a3, 0x92a4, 0x92a5, 0x92a6, 0x92a7, + /* 0xe4 */ + 0x92a8, 0x92a9, 0x92aa, 0x92ab, 0x92ac, 0x92ad, 0x92af, 0x92b0, + 0x92b1, 0x92b2, 0x92b3, 0x92b4, 0x92b5, 0x92b6, 0x92b7, 0x92b8, + 0x92b9, 0x92ba, 0x92bb, 0x92bc, 0x92bd, 0x92be, 0x92bf, 0x92c0, + 0x92c1, 0x92c2, 0x92c3, 0x92c4, 0x92c5, 0x92c6, 0x92c7, 0x92c9, + 0x92ca, 0x92cb, 0x92cc, 0x92cd, 0x92ce, 0x92cf, 0x92d0, 0x92d1, + 0x92d2, 0x92d3, 0x92d4, 0x92d5, 0x92d6, 0x92d7, 0x92d8, 0x92d9, + 0x92da, 0x92db, 0x92dc, 0x92dd, 0x92de, 0x92df, 0x92e0, 0x92e1, + 0x92e2, 0x92e3, 0x92e4, 0x92e5, 0x92e6, 0x92e7, 0x92e8, 0x92e9, + 0x92ea, 0x92eb, 0x92ec, 0x92ed, 0x92ee, 0x92ef, 0x92f0, 0x92f1, + 0x92f2, 0x92f3, 0x92f4, 0x92f5, 0x92f6, 0x92f7, 0x92f8, 0x92f9, + 0x92fa, 0x92fb, 0x92fc, 0x92fd, 0x92fe, 0x92ff, 0x9300, 0x9301, + 0x9302, 0x9303, 0x9304, 0x9305, 0x9306, 0x9307, 0x9308, 0x9309, + /* 0xe5 */ + 0x930a, 0x930b, 0x930c, 0x930d, 0x930e, 0x930f, 0x9310, 0x9311, + 0x9312, 0x9313, 0x9314, 0x9315, 0x9316, 0x9317, 0x9318, 0x9319, + 0x931a, 0x931b, 0x931c, 0x931d, 0x931e, 0x931f, 0x9320, 0x9321, + 0x9322, 0x9323, 0x9324, 0x9325, 0x9326, 0x9327, 0x9328, 0x9329, + 0x932a, 0x932b, 0x932c, 0x932d, 0x932e, 0x932f, 0x9330, 0x9331, + 0x9332, 0x9333, 0x9334, 0x9335, 0x9336, 0x9337, 0x9338, 0x9339, + 0x933a, 0x933b, 0x933c, 0x933d, 0x933f, 0x9340, 0x9341, 0x9342, + 0x9343, 0x9344, 0x9345, 0x9346, 0x9347, 0x9348, 0x9349, 0x934a, + 0x934b, 0x934c, 0x934d, 0x934e, 0x934f, 0x9350, 0x9351, 0x9352, + 0x9353, 0x9354, 0x9355, 0x9356, 0x9357, 0x9358, 0x9359, 0x935a, + 0x935b, 0x935c, 0x935d, 0x935e, 0x935f, 0x9360, 0x9361, 0x9362, + 0x9363, 0x9364, 0x9365, 0x9366, 0x9367, 0x9368, 0x9369, 0x936b, + /* 0xe6 */ + 0x936c, 0x936d, 0x936e, 0x936f, 0x9370, 0x9371, 0x9372, 0x9373, + 0x9374, 0x9375, 0x9376, 0x9377, 0x9378, 0x9379, 0x937a, 0x937b, + 0x937c, 0x937d, 0x937e, 0x937f, 0x9380, 0x9381, 0x9382, 0x9383, + 0x9384, 0x9385, 0x9386, 0x9387, 0x9388, 0x9389, 0x938a, 0x938b, + 0x938c, 0x938d, 0x938e, 0x9390, 0x9391, 0x9392, 0x9393, 0x9394, + 0x9395, 0x9396, 0x9397, 0x9398, 0x9399, 0x939a, 0x939b, 0x939c, + 0x939d, 0x939e, 0x939f, 0x93a0, 0x93a1, 0x93a2, 0x93a3, 0x93a4, + 0x93a5, 0x93a6, 0x93a7, 0x93a8, 0x93a9, 0x93aa, 0x93ab, 0x93ac, + 0x93ad, 0x93ae, 0x93af, 0x93b0, 0x93b1, 0x93b2, 0x93b3, 0x93b4, + 0x93b5, 0x93b6, 0x93b7, 0x93b8, 0x93b9, 0x93ba, 0x93bb, 0x93bc, + 0x93bd, 0x93be, 0x93bf, 0x93c0, 0x93c1, 0x93c2, 0x93c3, 0x93c4, + 0x93c5, 0x93c6, 0x93c7, 0x93c8, 0x93c9, 0x93cb, 0x93cc, 0x93cd, + /* 0xe7 */ + 0x93ce, 0x93cf, 0x93d0, 0x93d1, 0x93d2, 0x93d3, 0x93d4, 0x93d5, + 0x93d7, 0x93d8, 0x93d9, 0x93da, 0x93db, 0x93dc, 0x93dd, 0x93de, + 0x93df, 0x93e0, 0x93e1, 0x93e2, 0x93e3, 0x93e4, 0x93e5, 0x93e6, + 0x93e7, 0x93e8, 0x93e9, 0x93ea, 0x93eb, 0x93ec, 0x93ed, 0x93ee, + 0x93ef, 0x93f0, 0x93f1, 0x93f2, 0x93f3, 0x93f4, 0x93f5, 0x93f6, + 0x93f7, 0x93f8, 0x93f9, 0x93fa, 0x93fb, 0x93fc, 0x93fd, 0x93fe, + 0x93ff, 0x9400, 0x9401, 0x9402, 0x9403, 0x9404, 0x9405, 0x9406, + 0x9407, 0x9408, 0x9409, 0x940a, 0x940b, 0x940c, 0x940d, 0x940e, + 0x940f, 0x9410, 0x9411, 0x9412, 0x9413, 0x9414, 0x9415, 0x9416, + 0x9417, 0x9418, 0x9419, 0x941a, 0x941b, 0x941c, 0x941d, 0x941e, + 0x941f, 0x9420, 0x9421, 0x9422, 0x9423, 0x9424, 0x9425, 0x9426, + 0x9427, 0x9428, 0x9429, 0x942a, 0x942b, 0x942c, 0x942d, 0x942e, + /* 0xe8 */ + 0x942f, 0x9430, 0x9431, 0x9432, 0x9433, 0x9434, 0x9435, 0x9436, + 0x9437, 0x9438, 0x9439, 0x943a, 0x943b, 0x943c, 0x943d, 0x943f, + 0x9440, 0x9441, 0x9442, 0x9443, 0x9444, 0x9445, 0x9446, 0x9447, + 0x9448, 0x9449, 0x944a, 0x944b, 0x944c, 0x944d, 0x944e, 0x944f, + 0x9450, 0x9451, 0x9452, 0x9453, 0x9454, 0x9455, 0x9456, 0x9457, + 0x9458, 0x9459, 0x945a, 0x945b, 0x945c, 0x945d, 0x945e, 0x945f, + 0x9460, 0x9461, 0x9462, 0x9463, 0x9464, 0x9465, 0x9466, 0x9467, + 0x9468, 0x9469, 0x946a, 0x946c, 0x946d, 0x946e, 0x946f, 0x9470, + 0x9471, 0x9472, 0x9473, 0x9474, 0x9475, 0x9476, 0x9477, 0x9478, + 0x9479, 0x947a, 0x947b, 0x947c, 0x947d, 0x947e, 0x947f, 0x9480, + 0x9481, 0x9482, 0x9483, 0x9484, 0x9491, 0x9496, 0x9498, 0x94c7, + 0x94cf, 0x94d3, 0x94d4, 0x94da, 0x94e6, 0x94fb, 0x951c, 0x9520, + /* 0xe9 */ + 0x9527, 0x9533, 0x953d, 0x9543, 0x9548, 0x954b, 0x9555, 0x955a, + 0x9560, 0x956e, 0x9574, 0x9575, 0x9577, 0x9578, 0x9579, 0x957a, + 0x957b, 0x957c, 0x957d, 0x957e, 0x9580, 0x9581, 0x9582, 0x9583, + 0x9584, 0x9585, 0x9586, 0x9587, 0x9588, 0x9589, 0x958a, 0x958b, + 0x958c, 0x958d, 0x958e, 0x958f, 0x9590, 0x9591, 0x9592, 0x9593, + 0x9594, 0x9595, 0x9596, 0x9597, 0x9598, 0x9599, 0x959a, 0x959b, + 0x959c, 0x959d, 0x959e, 0x959f, 0x95a0, 0x95a1, 0x95a2, 0x95a3, + 0x95a4, 0x95a5, 0x95a6, 0x95a7, 0x95a8, 0x95a9, 0x95aa, 0x95ab, + 0x95ac, 0x95ad, 0x95ae, 0x95af, 0x95b0, 0x95b1, 0x95b2, 0x95b3, + 0x95b4, 0x95b5, 0x95b6, 0x95b7, 0x95b8, 0x95b9, 0x95ba, 0x95bb, + 0x95bc, 0x95bd, 0x95be, 0x95bf, 0x95c0, 0x95c1, 0x95c2, 0x95c3, + 0x95c4, 0x95c5, 0x95c6, 0x95c7, 0x95c8, 0x95c9, 0x95ca, 0x95cb, + /* 0xea */ + 0x95cc, 0x95cd, 0x95ce, 0x95cf, 0x95d0, 0x95d1, 0x95d2, 0x95d3, + 0x95d4, 0x95d5, 0x95d6, 0x95d7, 0x95d8, 0x95d9, 0x95da, 0x95db, + 0x95dc, 0x95dd, 0x95de, 0x95df, 0x95e0, 0x95e1, 0x95e2, 0x95e3, + 0x95e4, 0x95e5, 0x95e6, 0x95e7, 0x95ec, 0x95ff, 0x9607, 0x9613, + 0x9618, 0x961b, 0x961e, 0x9620, 0x9623, 0x9624, 0x9625, 0x9626, + 0x9627, 0x9628, 0x9629, 0x962b, 0x962c, 0x962d, 0x962f, 0x9630, + 0x9637, 0x9638, 0x9639, 0x963a, 0x963e, 0x9641, 0x9643, 0x964a, + 0x964e, 0x964f, 0x9651, 0x9652, 0x9653, 0x9656, 0x9657, 0x9658, + 0x9659, 0x965a, 0x965c, 0x965d, 0x965e, 0x9660, 0x9663, 0x9665, + 0x9666, 0x966b, 0x966d, 0x966e, 0x966f, 0x9670, 0x9671, 0x9673, + 0x9678, 0x9679, 0x967a, 0x967b, 0x967c, 0x967d, 0x967e, 0x967f, + 0x9680, 0x9681, 0x9682, 0x9683, 0x9684, 0x9687, 0x9689, 0x968a, + /* 0xeb */ + 0x968c, 0x968e, 0x9691, 0x9692, 0x9693, 0x9695, 0x9696, 0x969a, + 0x969b, 0x969d, 0x969e, 0x969f, 0x96a0, 0x96a1, 0x96a2, 0x96a3, + 0x96a4, 0x96a5, 0x96a6, 0x96a8, 0x96a9, 0x96aa, 0x96ab, 0x96ac, + 0x96ad, 0x96ae, 0x96af, 0x96b1, 0x96b2, 0x96b4, 0x96b5, 0x96b7, + 0x96b8, 0x96ba, 0x96bb, 0x96bf, 0x96c2, 0x96c3, 0x96c8, 0x96ca, + 0x96cb, 0x96d0, 0x96d1, 0x96d3, 0x96d4, 0x96d6, 0x96d7, 0x96d8, + 0x96d9, 0x96da, 0x96db, 0x96dc, 0x96dd, 0x96de, 0x96df, 0x96e1, + 0x96e2, 0x96e3, 0x96e4, 0x96e5, 0x96e6, 0x96e7, 0x96eb, 0x96ec, + 0x96ed, 0x96ee, 0x96f0, 0x96f1, 0x96f2, 0x96f4, 0x96f5, 0x96f8, + 0x96fa, 0x96fb, 0x96fc, 0x96fd, 0x96ff, 0x9702, 0x9703, 0x9705, + 0x970a, 0x970b, 0x970c, 0x9710, 0x9711, 0x9712, 0x9714, 0x9715, + 0x9717, 0x9718, 0x9719, 0x971a, 0x971b, 0x971d, 0x971f, 0x9720, + /* 0xec */ + 0x9721, 0x9722, 0x9723, 0x9724, 0x9725, 0x9726, 0x9727, 0x9728, + 0x9729, 0x972b, 0x972c, 0x972e, 0x972f, 0x9731, 0x9733, 0x9734, + 0x9735, 0x9736, 0x9737, 0x973a, 0x973b, 0x973c, 0x973d, 0x973f, + 0x9740, 0x9741, 0x9742, 0x9743, 0x9744, 0x9745, 0x9746, 0x9747, + 0x9748, 0x9749, 0x974a, 0x974b, 0x974c, 0x974d, 0x974e, 0x974f, + 0x9750, 0x9751, 0x9754, 0x9755, 0x9757, 0x9758, 0x975a, 0x975c, + 0x975d, 0x975f, 0x9763, 0x9764, 0x9766, 0x9767, 0x9768, 0x976a, + 0x976b, 0x976c, 0x976d, 0x976e, 0x976f, 0x9770, 0x9771, 0x9772, + 0x9775, 0x9777, 0x9778, 0x9779, 0x977a, 0x977b, 0x977d, 0x977e, + 0x977f, 0x9780, 0x9781, 0x9782, 0x9783, 0x9784, 0x9786, 0x9787, + 0x9788, 0x9789, 0x978a, 0x978c, 0x978e, 0x978f, 0x9790, 0x9793, + 0x9795, 0x9796, 0x9797, 0x9799, 0x979a, 0x979b, 0x979c, 0x979d, + /* 0xed */ + 0x979e, 0x979f, 0x97a1, 0x97a2, 0x97a4, 0x97a5, 0x97a6, 0x97a7, + 0x97a8, 0x97a9, 0x97aa, 0x97ac, 0x97ae, 0x97b0, 0x97b1, 0x97b3, + 0x97b5, 0x97b6, 0x97b7, 0x97b8, 0x97b9, 0x97ba, 0x97bb, 0x97bc, + 0x97bd, 0x97be, 0x97bf, 0x97c0, 0x97c1, 0x97c2, 0x97c3, 0x97c4, + 0x97c5, 0x97c6, 0x97c7, 0x97c8, 0x97c9, 0x97ca, 0x97cb, 0x97cc, + 0x97cd, 0x97ce, 0x97cf, 0x97d0, 0x97d1, 0x97d2, 0x97d3, 0x97d4, + 0x97d5, 0x97d6, 0x97d7, 0x97d8, 0x97d9, 0x97da, 0x97db, 0x97dc, + 0x97dd, 0x97de, 0x97df, 0x97e0, 0x97e1, 0x97e2, 0x97e3, 0x97e4, + 0x97e5, 0x97e8, 0x97ee, 0x97ef, 0x97f0, 0x97f1, 0x97f2, 0x97f4, + 0x97f7, 0x97f8, 0x97f9, 0x97fa, 0x97fb, 0x97fc, 0x97fd, 0x97fe, + 0x97ff, 0x9800, 0x9801, 0x9802, 0x9803, 0x9804, 0x9805, 0x9806, + 0x9807, 0x9808, 0x9809, 0x980a, 0x980b, 0x980c, 0x980d, 0x980e, + /* 0xee */ + 0x980f, 0x9810, 0x9811, 0x9812, 0x9813, 0x9814, 0x9815, 0x9816, + 0x9817, 0x9818, 0x9819, 0x981a, 0x981b, 0x981c, 0x981d, 0x981e, + 0x981f, 0x9820, 0x9821, 0x9822, 0x9823, 0x9824, 0x9825, 0x9826, + 0x9827, 0x9828, 0x9829, 0x982a, 0x982b, 0x982c, 0x982d, 0x982e, + 0x982f, 0x9830, 0x9831, 0x9832, 0x9833, 0x9834, 0x9835, 0x9836, + 0x9837, 0x9838, 0x9839, 0x983a, 0x983b, 0x983c, 0x983d, 0x983e, + 0x983f, 0x9840, 0x9841, 0x9842, 0x9843, 0x9844, 0x9845, 0x9846, + 0x9847, 0x9848, 0x9849, 0x984a, 0x984b, 0x984c, 0x984d, 0x984e, + 0x984f, 0x9850, 0x9851, 0x9852, 0x9853, 0x9854, 0x9855, 0x9856, + 0x9857, 0x9858, 0x9859, 0x985a, 0x985b, 0x985c, 0x985d, 0x985e, + 0x985f, 0x9860, 0x9861, 0x9862, 0x9863, 0x9864, 0x9865, 0x9866, + 0x9867, 0x9868, 0x9869, 0x986a, 0x986b, 0x986c, 0x986d, 0x986e, + /* 0xef */ + 0x986f, 0x9870, 0x9871, 0x9872, 0x9873, 0x9874, 0x988b, 0x988e, + 0x9892, 0x9895, 0x9899, 0x98a3, 0x98a8, 0x98a9, 0x98aa, 0x98ab, + 0x98ac, 0x98ad, 0x98ae, 0x98af, 0x98b0, 0x98b1, 0x98b2, 0x98b3, + 0x98b4, 0x98b5, 0x98b6, 0x98b7, 0x98b8, 0x98b9, 0x98ba, 0x98bb, + 0x98bc, 0x98bd, 0x98be, 0x98bf, 0x98c0, 0x98c1, 0x98c2, 0x98c3, + 0x98c4, 0x98c5, 0x98c6, 0x98c7, 0x98c8, 0x98c9, 0x98ca, 0x98cb, + 0x98cc, 0x98cd, 0x98cf, 0x98d0, 0x98d4, 0x98d6, 0x98d7, 0x98db, + 0x98dc, 0x98dd, 0x98e0, 0x98e1, 0x98e2, 0x98e3, 0x98e4, 0x98e5, + 0x98e6, 0x98e9, 0x98ea, 0x98eb, 0x98ec, 0x98ed, 0x98ee, 0x98ef, + 0x98f0, 0x98f1, 0x98f2, 0x98f3, 0x98f4, 0x98f5, 0x98f6, 0x98f7, + 0x98f8, 0x98f9, 0x98fa, 0x98fb, 0x98fc, 0x98fd, 0x98fe, 0x98ff, + 0x9900, 0x9901, 0x9902, 0x9903, 0x9904, 0x9905, 0x9906, 0x9907, + /* 0xf0 */ + 0x9908, 0x9909, 0x990a, 0x990b, 0x990c, 0x990e, 0x990f, 0x9911, + 0x9912, 0x9913, 0x9914, 0x9915, 0x9916, 0x9917, 0x9918, 0x9919, + 0x991a, 0x991b, 0x991c, 0x991d, 0x991e, 0x991f, 0x9920, 0x9921, + 0x9922, 0x9923, 0x9924, 0x9925, 0x9926, 0x9927, 0x9928, 0x9929, + 0x992a, 0x992b, 0x992c, 0x992d, 0x992f, 0x9930, 0x9931, 0x9932, + 0x9933, 0x9934, 0x9935, 0x9936, 0x9937, 0x9938, 0x9939, 0x993a, + 0x993b, 0x993c, 0x993d, 0x993e, 0x993f, 0x9940, 0x9941, 0x9942, + 0x9943, 0x9944, 0x9945, 0x9946, 0x9947, 0x9948, 0x9949, 0x994a, + 0x994b, 0x994c, 0x994d, 0x994e, 0x994f, 0x9950, 0x9951, 0x9952, + 0x9953, 0x9956, 0x9957, 0x9958, 0x9959, 0x995a, 0x995b, 0x995c, + 0x995d, 0x995e, 0x995f, 0x9960, 0x9961, 0x9962, 0x9964, 0x9966, + 0x9973, 0x9978, 0x9979, 0x997b, 0x997e, 0x9982, 0x9983, 0x9989, + /* 0xf1 */ + 0x998c, 0x998e, 0x999a, 0x999b, 0x999c, 0x999d, 0x999e, 0x999f, + 0x99a0, 0x99a1, 0x99a2, 0x99a3, 0x99a4, 0x99a6, 0x99a7, 0x99a9, + 0x99aa, 0x99ab, 0x99ac, 0x99ad, 0x99ae, 0x99af, 0x99b0, 0x99b1, + 0x99b2, 0x99b3, 0x99b4, 0x99b5, 0x99b6, 0x99b7, 0x99b8, 0x99b9, + 0x99ba, 0x99bb, 0x99bc, 0x99bd, 0x99be, 0x99bf, 0x99c0, 0x99c1, + 0x99c2, 0x99c3, 0x99c4, 0x99c5, 0x99c6, 0x99c7, 0x99c8, 0x99c9, + 0x99ca, 0x99cb, 0x99cc, 0x99cd, 0x99ce, 0x99cf, 0x99d0, 0x99d1, + 0x99d2, 0x99d3, 0x99d4, 0x99d5, 0x99d6, 0x99d7, 0x99d8, 0x99d9, + 0x99da, 0x99db, 0x99dc, 0x99dd, 0x99de, 0x99df, 0x99e0, 0x99e1, + 0x99e2, 0x99e3, 0x99e4, 0x99e5, 0x99e6, 0x99e7, 0x99e8, 0x99e9, + 0x99ea, 0x99eb, 0x99ec, 0x99ed, 0x99ee, 0x99ef, 0x99f0, 0x99f1, + 0x99f2, 0x99f3, 0x99f4, 0x99f5, 0x99f6, 0x99f7, 0x99f8, 0x99f9, + /* 0xf2 */ + 0x99fa, 0x99fb, 0x99fc, 0x99fd, 0x99fe, 0x99ff, 0x9a00, 0x9a01, + 0x9a02, 0x9a03, 0x9a04, 0x9a05, 0x9a06, 0x9a07, 0x9a08, 0x9a09, + 0x9a0a, 0x9a0b, 0x9a0c, 0x9a0d, 0x9a0e, 0x9a0f, 0x9a10, 0x9a11, + 0x9a12, 0x9a13, 0x9a14, 0x9a15, 0x9a16, 0x9a17, 0x9a18, 0x9a19, + 0x9a1a, 0x9a1b, 0x9a1c, 0x9a1d, 0x9a1e, 0x9a1f, 0x9a20, 0x9a21, + 0x9a22, 0x9a23, 0x9a24, 0x9a25, 0x9a26, 0x9a27, 0x9a28, 0x9a29, + 0x9a2a, 0x9a2b, 0x9a2c, 0x9a2d, 0x9a2e, 0x9a2f, 0x9a30, 0x9a31, + 0x9a32, 0x9a33, 0x9a34, 0x9a35, 0x9a36, 0x9a37, 0x9a38, 0x9a39, + 0x9a3a, 0x9a3b, 0x9a3c, 0x9a3d, 0x9a3e, 0x9a3f, 0x9a40, 0x9a41, + 0x9a42, 0x9a43, 0x9a44, 0x9a45, 0x9a46, 0x9a47, 0x9a48, 0x9a49, + 0x9a4a, 0x9a4b, 0x9a4c, 0x9a4d, 0x9a4e, 0x9a4f, 0x9a50, 0x9a51, + 0x9a52, 0x9a53, 0x9a54, 0x9a55, 0x9a56, 0x9a57, 0x9a58, 0x9a59, + /* 0xf3 */ + 0x9a5a, 0x9a5b, 0x9a5c, 0x9a5d, 0x9a5e, 0x9a5f, 0x9a60, 0x9a61, + 0x9a62, 0x9a63, 0x9a64, 0x9a65, 0x9a66, 0x9a67, 0x9a68, 0x9a69, + 0x9a6a, 0x9a6b, 0x9a72, 0x9a83, 0x9a89, 0x9a8d, 0x9a8e, 0x9a94, + 0x9a95, 0x9a99, 0x9aa6, 0x9aa9, 0x9aaa, 0x9aab, 0x9aac, 0x9aad, + 0x9aae, 0x9aaf, 0x9ab2, 0x9ab3, 0x9ab4, 0x9ab5, 0x9ab9, 0x9abb, + 0x9abd, 0x9abe, 0x9abf, 0x9ac3, 0x9ac4, 0x9ac6, 0x9ac7, 0x9ac8, + 0x9ac9, 0x9aca, 0x9acd, 0x9ace, 0x9acf, 0x9ad0, 0x9ad2, 0x9ad4, + 0x9ad5, 0x9ad6, 0x9ad7, 0x9ad9, 0x9ada, 0x9adb, 0x9adc, 0x9add, + 0x9ade, 0x9ae0, 0x9ae2, 0x9ae3, 0x9ae4, 0x9ae5, 0x9ae7, 0x9ae8, + 0x9ae9, 0x9aea, 0x9aec, 0x9aee, 0x9af0, 0x9af1, 0x9af2, 0x9af3, + 0x9af4, 0x9af5, 0x9af6, 0x9af7, 0x9af8, 0x9afa, 0x9afc, 0x9afd, + 0x9afe, 0x9aff, 0x9b00, 0x9b01, 0x9b02, 0x9b04, 0x9b05, 0x9b06, + /* 0xf4 */ + 0x9b07, 0x9b09, 0x9b0a, 0x9b0b, 0x9b0c, 0x9b0d, 0x9b0e, 0x9b10, + 0x9b11, 0x9b12, 0x9b14, 0x9b15, 0x9b16, 0x9b17, 0x9b18, 0x9b19, + 0x9b1a, 0x9b1b, 0x9b1c, 0x9b1d, 0x9b1e, 0x9b20, 0x9b21, 0x9b22, + 0x9b24, 0x9b25, 0x9b26, 0x9b27, 0x9b28, 0x9b29, 0x9b2a, 0x9b2b, + 0x9b2c, 0x9b2d, 0x9b2e, 0x9b30, 0x9b31, 0x9b33, 0x9b34, 0x9b35, + 0x9b36, 0x9b37, 0x9b38, 0x9b39, 0x9b3a, 0x9b3d, 0x9b3e, 0x9b3f, + 0x9b40, 0x9b46, 0x9b4a, 0x9b4b, 0x9b4c, 0x9b4e, 0x9b50, 0x9b52, + 0x9b53, 0x9b55, 0x9b56, 0x9b57, 0x9b58, 0x9b59, 0x9b5a, 0x9b5b, + 0x9b5c, 0x9b5d, 0x9b5e, 0x9b5f, 0x9b60, 0x9b61, 0x9b62, 0x9b63, + 0x9b64, 0x9b65, 0x9b66, 0x9b67, 0x9b68, 0x9b69, 0x9b6a, 0x9b6b, + 0x9b6c, 0x9b6d, 0x9b6e, 0x9b6f, 0x9b70, 0x9b71, 0x9b72, 0x9b73, + 0x9b74, 0x9b75, 0x9b76, 0x9b77, 0x9b78, 0x9b79, 0x9b7a, 0x9b7b, + /* 0xf5 */ + 0x9b7c, 0x9b7d, 0x9b7e, 0x9b7f, 0x9b80, 0x9b81, 0x9b82, 0x9b83, + 0x9b84, 0x9b85, 0x9b86, 0x9b87, 0x9b88, 0x9b89, 0x9b8a, 0x9b8b, + 0x9b8c, 0x9b8d, 0x9b8e, 0x9b8f, 0x9b90, 0x9b91, 0x9b92, 0x9b93, + 0x9b94, 0x9b95, 0x9b96, 0x9b97, 0x9b98, 0x9b99, 0x9b9a, 0x9b9b, + 0x9b9c, 0x9b9d, 0x9b9e, 0x9b9f, 0x9ba0, 0x9ba1, 0x9ba2, 0x9ba3, + 0x9ba4, 0x9ba5, 0x9ba6, 0x9ba7, 0x9ba8, 0x9ba9, 0x9baa, 0x9bab, + 0x9bac, 0x9bad, 0x9bae, 0x9baf, 0x9bb0, 0x9bb1, 0x9bb2, 0x9bb3, + 0x9bb4, 0x9bb5, 0x9bb6, 0x9bb7, 0x9bb8, 0x9bb9, 0x9bba, 0x9bbb, + 0x9bbc, 0x9bbd, 0x9bbe, 0x9bbf, 0x9bc0, 0x9bc1, 0x9bc2, 0x9bc3, + 0x9bc4, 0x9bc5, 0x9bc6, 0x9bc7, 0x9bc8, 0x9bc9, 0x9bca, 0x9bcb, + 0x9bcc, 0x9bcd, 0x9bce, 0x9bcf, 0x9bd0, 0x9bd1, 0x9bd2, 0x9bd3, + 0x9bd4, 0x9bd5, 0x9bd6, 0x9bd7, 0x9bd8, 0x9bd9, 0x9bda, 0x9bdb, + /* 0xf6 */ + 0x9bdc, 0x9bdd, 0x9bde, 0x9bdf, 0x9be0, 0x9be1, 0x9be2, 0x9be3, + 0x9be4, 0x9be5, 0x9be6, 0x9be7, 0x9be8, 0x9be9, 0x9bea, 0x9beb, + 0x9bec, 0x9bed, 0x9bee, 0x9bef, 0x9bf0, 0x9bf1, 0x9bf2, 0x9bf3, + 0x9bf4, 0x9bf5, 0x9bf6, 0x9bf7, 0x9bf8, 0x9bf9, 0x9bfa, 0x9bfb, + 0x9bfc, 0x9bfd, 0x9bfe, 0x9bff, 0x9c00, 0x9c01, 0x9c02, 0x9c03, + 0x9c04, 0x9c05, 0x9c06, 0x9c07, 0x9c08, 0x9c09, 0x9c0a, 0x9c0b, + 0x9c0c, 0x9c0d, 0x9c0e, 0x9c0f, 0x9c10, 0x9c11, 0x9c12, 0x9c13, + 0x9c14, 0x9c15, 0x9c16, 0x9c17, 0x9c18, 0x9c19, 0x9c1a, 0x9c1b, + 0x9c1c, 0x9c1d, 0x9c1e, 0x9c1f, 0x9c20, 0x9c21, 0x9c22, 0x9c23, + 0x9c24, 0x9c25, 0x9c26, 0x9c27, 0x9c28, 0x9c29, 0x9c2a, 0x9c2b, + 0x9c2c, 0x9c2d, 0x9c2e, 0x9c2f, 0x9c30, 0x9c31, 0x9c32, 0x9c33, + 0x9c34, 0x9c35, 0x9c36, 0x9c37, 0x9c38, 0x9c39, 0x9c3a, 0x9c3b, + /* 0xf7 */ + 0x9c3c, 0x9c3d, 0x9c3e, 0x9c3f, 0x9c40, 0x9c41, 0x9c42, 0x9c43, + 0x9c44, 0x9c45, 0x9c46, 0x9c47, 0x9c48, 0x9c49, 0x9c4a, 0x9c4b, + 0x9c4c, 0x9c4d, 0x9c4e, 0x9c4f, 0x9c50, 0x9c51, 0x9c52, 0x9c53, + 0x9c54, 0x9c55, 0x9c56, 0x9c57, 0x9c58, 0x9c59, 0x9c5a, 0x9c5b, + 0x9c5c, 0x9c5d, 0x9c5e, 0x9c5f, 0x9c60, 0x9c61, 0x9c62, 0x9c63, + 0x9c64, 0x9c65, 0x9c66, 0x9c67, 0x9c68, 0x9c69, 0x9c6a, 0x9c6b, + 0x9c6c, 0x9c6d, 0x9c6e, 0x9c6f, 0x9c70, 0x9c71, 0x9c72, 0x9c73, + 0x9c74, 0x9c75, 0x9c76, 0x9c77, 0x9c78, 0x9c79, 0x9c7a, 0x9c7b, + 0x9c7d, 0x9c7e, 0x9c80, 0x9c83, 0x9c84, 0x9c89, 0x9c8a, 0x9c8c, + 0x9c8f, 0x9c93, 0x9c96, 0x9c97, 0x9c98, 0x9c99, 0x9c9d, 0x9caa, + 0x9cac, 0x9caf, 0x9cb9, 0x9cbe, 0x9cbf, 0x9cc0, 0x9cc1, 0x9cc2, + 0x9cc8, 0x9cc9, 0x9cd1, 0x9cd2, 0x9cda, 0x9cdb, 0x9ce0, 0x9ce1, + /* 0xf8 */ + 0x9ce3, 0x9ce4, 0x9ce5, 0x9ce6, 0x9ce7, 0x9ce8, 0x9ce9, 0x9cea, + 0x9ceb, 0x9cec, 0x9ced, 0x9cee, 0x9cef, 0x9cf0, 0x9cf1, 0x9cf2, + 0x9cf3, 0x9cf4, 0x9cf5, 0x9cf6, 0x9cf7, 0x9cf8, 0x9cf9, 0x9cfa, + 0x9cfb, 0x9cfc, 0x9cfd, 0x9cfe, 0x9cff, 0x9d00, 0x9d01, 0x9d02, + 0x9d03, 0x9d04, 0x9d05, 0x9d06, 0x9d07, 0x9d08, 0x9d09, 0x9d0a, + 0x9d0b, 0x9d0c, 0x9d0d, 0x9d0e, 0x9d0f, 0x9d10, 0x9d11, 0x9d12, + 0x9d13, 0x9d14, 0x9d15, 0x9d16, 0x9d17, 0x9d18, 0x9d19, 0x9d1a, + 0x9d1b, 0x9d1c, 0x9d1d, 0x9d1e, 0x9d1f, 0x9d20, 0x9d21, 0x9d22, + 0x9d23, 0x9d24, 0x9d25, 0x9d26, 0x9d27, 0x9d28, 0x9d29, 0x9d2a, + 0x9d2b, 0x9d2c, 0x9d2d, 0x9d2e, 0x9d2f, 0x9d30, 0x9d31, 0x9d32, + 0x9d33, 0x9d34, 0x9d35, 0x9d36, 0x9d37, 0x9d38, 0x9d39, 0x9d3a, + 0x9d3b, 0x9d3c, 0x9d3d, 0x9d3e, 0x9d3f, 0x9d40, 0x9d41, 0x9d42, + /* 0xf9 */ + 0x9d43, 0x9d44, 0x9d45, 0x9d46, 0x9d47, 0x9d48, 0x9d49, 0x9d4a, + 0x9d4b, 0x9d4c, 0x9d4d, 0x9d4e, 0x9d4f, 0x9d50, 0x9d51, 0x9d52, + 0x9d53, 0x9d54, 0x9d55, 0x9d56, 0x9d57, 0x9d58, 0x9d59, 0x9d5a, + 0x9d5b, 0x9d5c, 0x9d5d, 0x9d5e, 0x9d5f, 0x9d60, 0x9d61, 0x9d62, + 0x9d63, 0x9d64, 0x9d65, 0x9d66, 0x9d67, 0x9d68, 0x9d69, 0x9d6a, + 0x9d6b, 0x9d6c, 0x9d6d, 0x9d6e, 0x9d6f, 0x9d70, 0x9d71, 0x9d72, + 0x9d73, 0x9d74, 0x9d75, 0x9d76, 0x9d77, 0x9d78, 0x9d79, 0x9d7a, + 0x9d7b, 0x9d7c, 0x9d7d, 0x9d7e, 0x9d7f, 0x9d80, 0x9d81, 0x9d82, + 0x9d83, 0x9d84, 0x9d85, 0x9d86, 0x9d87, 0x9d88, 0x9d89, 0x9d8a, + 0x9d8b, 0x9d8c, 0x9d8d, 0x9d8e, 0x9d8f, 0x9d90, 0x9d91, 0x9d92, + 0x9d93, 0x9d94, 0x9d95, 0x9d96, 0x9d97, 0x9d98, 0x9d99, 0x9d9a, + 0x9d9b, 0x9d9c, 0x9d9d, 0x9d9e, 0x9d9f, 0x9da0, 0x9da1, 0x9da2, + /* 0xfa */ + 0x9da3, 0x9da4, 0x9da5, 0x9da6, 0x9da7, 0x9da8, 0x9da9, 0x9daa, + 0x9dab, 0x9dac, 0x9dad, 0x9dae, 0x9daf, 0x9db0, 0x9db1, 0x9db2, + 0x9db3, 0x9db4, 0x9db5, 0x9db6, 0x9db7, 0x9db8, 0x9db9, 0x9dba, + 0x9dbb, 0x9dbc, 0x9dbd, 0x9dbe, 0x9dbf, 0x9dc0, 0x9dc1, 0x9dc2, + 0x9dc3, 0x9dc4, 0x9dc5, 0x9dc6, 0x9dc7, 0x9dc8, 0x9dc9, 0x9dca, + 0x9dcb, 0x9dcc, 0x9dcd, 0x9dce, 0x9dcf, 0x9dd0, 0x9dd1, 0x9dd2, + 0x9dd3, 0x9dd4, 0x9dd5, 0x9dd6, 0x9dd7, 0x9dd8, 0x9dd9, 0x9dda, + 0x9ddb, 0x9ddc, 0x9ddd, 0x9dde, 0x9ddf, 0x9de0, 0x9de1, 0x9de2, + 0x9de3, 0x9de4, 0x9de5, 0x9de6, 0x9de7, 0x9de8, 0x9de9, 0x9dea, + 0x9deb, 0x9dec, 0x9ded, 0x9dee, 0x9def, 0x9df0, 0x9df1, 0x9df2, + 0x9df3, 0x9df4, 0x9df5, 0x9df6, 0x9df7, 0x9df8, 0x9df9, 0x9dfa, + 0x9dfb, 0x9dfc, 0x9dfd, 0x9dfe, 0x9dff, 0x9e00, 0x9e01, 0x9e02, + /* 0xfb */ + 0x9e03, 0x9e04, 0x9e05, 0x9e06, 0x9e07, 0x9e08, 0x9e09, 0x9e0a, + 0x9e0b, 0x9e0c, 0x9e0d, 0x9e0e, 0x9e0f, 0x9e10, 0x9e11, 0x9e12, + 0x9e13, 0x9e14, 0x9e15, 0x9e16, 0x9e17, 0x9e18, 0x9e19, 0x9e1a, + 0x9e1b, 0x9e1c, 0x9e1d, 0x9e1e, 0x9e24, 0x9e27, 0x9e2e, 0x9e30, + 0x9e34, 0x9e3b, 0x9e3c, 0x9e40, 0x9e4d, 0x9e50, 0x9e52, 0x9e53, + 0x9e54, 0x9e56, 0x9e59, 0x9e5d, 0x9e5f, 0x9e60, 0x9e61, 0x9e62, + 0x9e65, 0x9e6e, 0x9e6f, 0x9e72, 0x9e74, 0x9e75, 0x9e76, 0x9e77, + 0x9e78, 0x9e79, 0x9e7a, 0x9e7b, 0x9e7c, 0x9e7d, 0x9e80, 0x9e81, + 0x9e83, 0x9e84, 0x9e85, 0x9e86, 0x9e89, 0x9e8a, 0x9e8c, 0x9e8d, + 0x9e8e, 0x9e8f, 0x9e90, 0x9e91, 0x9e94, 0x9e95, 0x9e96, 0x9e97, + 0x9e98, 0x9e99, 0x9e9a, 0x9e9b, 0x9e9c, 0x9e9e, 0x9ea0, 0x9ea1, + 0x9ea2, 0x9ea3, 0x9ea4, 0x9ea5, 0x9ea7, 0x9ea8, 0x9ea9, 0x9eaa, + /* 0xfc */ + 0x9eab, 0x9eac, 0x9ead, 0x9eae, 0x9eaf, 0x9eb0, 0x9eb1, 0x9eb2, + 0x9eb3, 0x9eb5, 0x9eb6, 0x9eb7, 0x9eb9, 0x9eba, 0x9ebc, 0x9ebf, + 0x9ec0, 0x9ec1, 0x9ec2, 0x9ec3, 0x9ec5, 0x9ec6, 0x9ec7, 0x9ec8, + 0x9eca, 0x9ecb, 0x9ecc, 0x9ed0, 0x9ed2, 0x9ed3, 0x9ed5, 0x9ed6, + 0x9ed7, 0x9ed9, 0x9eda, 0x9ede, 0x9ee1, 0x9ee3, 0x9ee4, 0x9ee6, + 0x9ee8, 0x9eeb, 0x9eec, 0x9eed, 0x9eee, 0x9ef0, 0x9ef1, 0x9ef2, + 0x9ef3, 0x9ef4, 0x9ef5, 0x9ef6, 0x9ef7, 0x9ef8, 0x9efa, 0x9efd, + 0x9eff, 0x9f00, 0x9f01, 0x9f02, 0x9f03, 0x9f04, 0x9f05, 0x9f06, + 0x9f07, 0x9f08, 0x9f09, 0x9f0a, 0x9f0c, 0x9f0f, 0x9f11, 0x9f12, + 0x9f14, 0x9f15, 0x9f16, 0x9f18, 0x9f1a, 0x9f1b, 0x9f1c, 0x9f1d, + 0x9f1e, 0x9f1f, 0x9f21, 0x9f23, 0x9f24, 0x9f25, 0x9f26, 0x9f27, + 0x9f28, 0x9f29, 0x9f2a, 0x9f2b, 0x9f2d, 0x9f2e, 0x9f30, 0x9f31, + /* 0xfd */ + 0x9f32, 0x9f33, 0x9f34, 0x9f35, 0x9f36, 0x9f38, 0x9f3a, 0x9f3c, + 0x9f3f, 0x9f40, 0x9f41, 0x9f42, 0x9f43, 0x9f45, 0x9f46, 0x9f47, + 0x9f48, 0x9f49, 0x9f4a, 0x9f4b, 0x9f4c, 0x9f4d, 0x9f4e, 0x9f4f, + 0x9f52, 0x9f53, 0x9f54, 0x9f55, 0x9f56, 0x9f57, 0x9f58, 0x9f59, + 0x9f5a, 0x9f5b, 0x9f5c, 0x9f5d, 0x9f5e, 0x9f5f, 0x9f60, 0x9f61, + 0x9f62, 0x9f63, 0x9f64, 0x9f65, 0x9f66, 0x9f67, 0x9f68, 0x9f69, + 0x9f6a, 0x9f6b, 0x9f6c, 0x9f6d, 0x9f6e, 0x9f6f, 0x9f70, 0x9f71, + 0x9f72, 0x9f73, 0x9f74, 0x9f75, 0x9f76, 0x9f77, 0x9f78, 0x9f79, + 0x9f7a, 0x9f7b, 0x9f7c, 0x9f7d, 0x9f7e, 0x9f81, 0x9f82, 0x9f8d, + 0x9f8e, 0x9f8f, 0x9f90, 0x9f91, 0x9f92, 0x9f93, 0x9f94, 0x9f95, + 0x9f96, 0x9f97, 0x9f98, 0x9f9c, 0x9f9d, 0x9f9e, 0x9fa1, 0x9fa2, + 0x9fa3, 0x9fa4, 0x9fa5, 0xf92c, 0xf979, 0xf995, 0xf9e7, 0xf9f1, + /* 0xfe */ + 0xfa0c, 0xfa0d, 0xfa0e, 0xfa0f, 0xfa11, 0xfa13, 0xfa14, 0xfa18, + 0xfa1f, 0xfa20, 0xfa21, 0xfa23, 0xfa24, 0xfa27, 0xfa28, 0xfa29, +}; + +static const u16 cp936ext_2uni_pagea6[181-159] = { + /* 0xa6 */ + 0xfe35, + 0xfe36, 0xfe39, 0xfe3a, 0xfe3f, 0xfe40, 0xfe3d, 0xfe3e, 0xfe41, + 0xfe42, 0xfe43, 0xfe44, 0xfffd, 0xfffd, 0xfe3b, 0xfe3c, 0xfe37, + 0xfe38, 0xfe31, 0xfffd, 0xfe33, 0xfe34, +}; +static const u16 cp936ext_2uni_pagea8[128-122] = { + /* 0xa8 */ + 0x0251, 0xfffd, 0x0144, 0x0148, 0xfffd, 0x0261, +}; + +static int gb2312_mbtowc(ucs4_t *pwc, const u8 *s, int n) +{ + u8 c1 = s[0]; + if ((c1 >= 0x21 && c1 <= 0x29) || (c1 >= 0x30 && c1 <= 0x77)) { + if (n >= 2) { + u8 c2 = s[1]; + if (c2 >= 0x21 && c2 < 0x7f) { + u32 i = 94 * (c1 - 0x21) + (c2 - 0x21); + u16 wc = 0xfffd; + if (i < 1410) { + if (i < 831) + wc = gb2312_2uni_page21[i]; + } else { + if (i < 8178) + wc = gb2312_2uni_page30[i-1410]; + } + if (wc != 0xfffd) { + *pwc = (ucs4_t) wc; + return 2; + } + } + return RET_ILSEQ; + } + return RET_TOOFEW(0); + } + return RET_ILSEQ; +} + + + +static int cp936ext_mbtowc(ucs4_t *pwc, const u8 *s, int n) +{ + u8 c1 = s[0]; + if ((c1 == 0xa6) || (c1 == 0xa8)) { + if (n >= 2) { + u8 c2 = s[1]; + if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0x80 && c2 < 0xff)) { + u32 i = 190 * (c1 - 0x81) + (c2 - (c2 >= 0x80 ? 0x41 : 0x40)); + u16 wc = 0xfffd; + if (i < 7410) { + if (i >= 7189 && i < 7211) + wc = cp936ext_2uni_pagea6[i-7189]; + } else { + if (i >= 7532 && i < 7538) + wc = cp936ext_2uni_pagea8[i-7532]; + } + if (wc != 0xfffd) { + *pwc = (ucs4_t) wc; + return 2; + } + } + return RET_ILSEQ; + } + return RET_TOOFEW(0); + } + return RET_ILSEQ; +} + +/* unicode <-> cjk */ +static int gbkext1_mbtowc(ucs4_t *pwc, const u8 *s, int n) +{ + u8 c1 = s[0]; + if ((c1 >= 0x81 && c1 <= 0xa0)) { + if (n >= 2) { + u8 c2 = s[1]; + if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0x80 && c2 < 0xff)) { + u32 i = 190 * (c1 - 0x81) + (c2 - (c2 >= 0x80 ? 0x41 : 0x40)); + u16 wc = 0xfffd; + { + if (i < 6080) + wc = gbkext1_2uni_page81[i]; + } + if (wc != 0xfffd) { + *pwc = (ucs4_t) wc; + return 2; + } + } + return RET_ILSEQ; + } + return RET_TOOFEW(0); + } + return RET_ILSEQ; +} + +static int gbkext2_mbtowc(ucs4_t *pwc, const u8 *s, int n) +{ + u8 c1 = s[0]; + if ((c1 >= 0xa8 && c1 <= 0xfe)) { + if (n >= 2) { + u8 c2 = s[1]; + if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0x80 && c2 < 0xa1)) { + u32 i = 96 * (c1 - 0x81) + (c2 - (c2 >= 0x80 ? 0x41 : 0x40)); + u16 wc = 0xfffd; + { + if (i < 12016) + wc = gbkext2_2uni_pagea8[i-3744]; + } + if (wc != 0xfffd) { + *pwc = (ucs4_t) wc; + return 2; + } + } + return RET_ILSEQ; + } + return RET_TOOFEW(0); + } + return RET_ILSEQ; +} + +static int _gbk_mbtowc(ucs4_t *pwc, const u8 *s, int n) +{ + u8 c = *s; + + if (c >= 0x81 && c < 0xff) { + if (n < 2) + return RET_TOOFEW(0); + if (c >= 0xa1 && c <= 0xf7) { + u8 c2 = s[1]; + if (c == 0xa1) { + if (c2 == 0xa4) { + *pwc = 0x00b7; + return 2; + } + if (c2 == 0xaa) { + *pwc = 0x2014; + return 2; + } + } + if (c2 >= 0xa1 && c2 < 0xff) { + u8 buf[2]; + int ret; + buf[0] = c-0x80; buf[1] = c2-0x80; + ret = gb2312_mbtowc(pwc,buf,2); + if (ret != RET_ILSEQ) + return ret; + buf[0] = c; buf[1] = c2; + ret = cp936ext_mbtowc(pwc,buf,2); + if (ret != RET_ILSEQ) + return ret; + } + } + if (c >= 0x81 && c <= 0xa0) + return gbkext1_mbtowc(pwc,s,2); + if (c >= 0xa8 && c <= 0xfe) + return gbkext2_mbtowc(pwc,s,2); + if (c == 0xa2) { + u8 c2 = s[1]; + if (c2 >= 0xa1 && c2 <= 0xaa) { + *pwc = 0x2170+(c2-0xa1); + return 2; + } + } + } + return RET_ILSEQ; +} + +static int ascii_mbtowc ( ucs4_t *pwc, const u8 *s, int n __attribute__((unused))) +{ + u8 c = *s; + if (c < 0x80) { + *pwc = (ucs4_t) c; + return 1; + } + return RET_ILSEQ; +} + + +static int gbk_mbtowc(ucs4_t *pwc, const u8 *s, int n) +{ + u8 c = *s; + + /* Code set 0 (ASCII or GB 1988-89) */ + if (c < 0x80) + return ascii_mbtowc(pwc,s,n); + /* Code set 1 (GBK) */ + if (c >= 0x81 && c < 0xff) { + if (n < 2) + return RET_TOOFEW(0); + return _gbk_mbtowc(pwc,s,2); + } + return RET_ILSEQ; +} + +u16 charsets_gbk_to_ucs(const u8 * cjk) +{ + ucs4_t u; + if(gbk_mbtowc(&u, cjk, 2) < 1) + u = 0x1FFF; + return (u16) u; +} + diff --git a/JGE/src/JAnimator.cpp b/JGE/src/JAnimator.cpp index 6c4c16700..08f704c6c 100644 --- a/JGE/src/JAnimator.cpp +++ b/JGE/src/JAnimator.cpp @@ -1,411 +1,411 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#include "../include/JGE.h" -#include "../include/JResourceManager.h" -#include "../include/JFileSystem.h" -#include "../include/JRenderer.h" -#include "../include/JSprite.h" -#include "../include/JAnimator.h" - -#include "tinyxml/tinyxml.h" - - -////////////////////////////////////////////////////////////////////////// -JAnimator::JAnimator(JResourceManager* resourceMgr) -{ - mResource = resourceMgr; - mActive = false; - mAnimating = false; -} - -JAnimator::~JAnimator() -{ - while (mFrames.size()>0) - { - JAnimatorFrame* frame = mFrames.back(); - mFrames.pop_back(); - delete frame; - } - - mFrames.clear(); -} - -bool JAnimator::Load(const char* scriptFile) -{ - - JFileSystem *fileSystem = JFileSystem::GetInstance(); - if (fileSystem == NULL) return false; - - if (!fileSystem->OpenFile(scriptFile)) return false; - - int size = fileSystem->GetFileSize(); - char *xmlBuffer = new char[size]; - fileSystem->ReadFile(xmlBuffer, size); - - TiXmlDocument doc; - doc.Parse(xmlBuffer); - - TiXmlNode* script = 0; - TiXmlNode* frame = 0; - TiXmlNode* obj = 0; - TiXmlNode* param = 0; - TiXmlElement* element = 0; - - float defaultTime = 0.033f; - - script = doc.FirstChild("script"); - if (script) - { - element = script->ToElement(); - printf("---- Loading %s:%s\n", element->Value(), element->Attribute("name")); - - const char *type[] = - { - "ANIMATION_TYPE_LOOPING", - "ANIMATION_TYPE_ONCE_AND_STAY", - "ANIMATION_TYPE_ONCE_AND_BACK", - "ANIMATION_TYPE_ONCE_AND_GONE", - "ANIMATION_TYPE_PINGPONG" - }; - - const char* aniType = element->Attribute("type"); - for (int i=0;i<5;i++) - if (strcmp(type[i], aniType)==0) - { - SetAnimationType(i); - break; - } - - float fps; - if (element->QueryFloatAttribute("framerate", &fps) != TIXML_SUCCESS) - fps = 30.0f; - - defaultTime = 1/fps; - - for (frame = script->FirstChild("frame"); frame; frame = frame->NextSibling()) - { - JAnimatorFrame *aniFrame = new JAnimatorFrame(this); - - float duration; - element = frame->ToElement(); - if (element->QueryFloatAttribute("time", &duration) != TIXML_SUCCESS) - duration = defaultTime; - aniFrame->SetFrameTime(duration); - - for (obj = frame->FirstChild(); obj; obj = obj->NextSibling()) - { - for (param = obj->FirstChild(); param; param = param->NextSibling()) - { - - element = param->ToElement(); - if (element != NULL) - { - if (strcmp(element->Value(), "settings")==0) - { - const char* quadName = element->Attribute("quad"); - JQuad* quad = mResource->GetQuad(quadName); - - float x, y; - float vsize, hsize; - float angle; - int a, r, g, b; - int value; - bool flipped = false; - - if (element->QueryFloatAttribute("x", &x) != TIXML_SUCCESS) - x = 0.0f; - - if (element->QueryFloatAttribute("y", &y) != TIXML_SUCCESS) - y = 0.0f; - - if (element->QueryFloatAttribute("hsize", &hsize) != TIXML_SUCCESS) - hsize = 1.0f; - - if (element->QueryFloatAttribute("vsize", &vsize) != TIXML_SUCCESS) - vsize = 1.0f; - - if (element->QueryFloatAttribute("rotation", &angle) != TIXML_SUCCESS) - angle = 0.0f; - - if (element->QueryIntAttribute("a", &a) != TIXML_SUCCESS) - a = 255; - - if (element->QueryIntAttribute("r", &r) != TIXML_SUCCESS) - r = 255; - - if (element->QueryIntAttribute("g", &g) != TIXML_SUCCESS) - g = 255; - - if (element->QueryIntAttribute("b", &b) != TIXML_SUCCESS) - b = 255; - - if (element->QueryIntAttribute("flip", &value) == TIXML_SUCCESS) - flipped = (value==1); - - - JAnimatorObject *object = new JAnimatorObject(); - object->SetQuad(quad); - object->SetPosition(x, y); - object->SetHScale(hsize); - object->SetVScale(vsize); - object->SetRotation(angle); - object->SetColor(ARGB(a,r,g,b)); - object->SetFlip(flipped); - - aniFrame->AddObject(object); - - } - } - } - - } - - mFrames.push_back(aniFrame); - } - - } - - fileSystem->CloseFile(); - delete[] xmlBuffer; - - return true; - -} - -void JAnimator::Start() -{ - mFrameDelta = 1; - mAnimating = true; - mActive = true; - mCurrentFrame = 0; - - mFrames[mCurrentFrame]->Start(); -} - -void JAnimator::Stop() -{ - mAnimating = false; - mActive = false; -} - -void JAnimator::Pause() -{ - mAnimating = false; -} - -void JAnimator::Resume() -{ - mAnimating = true; -} - -void JAnimator::Update(float dt) -{ - if (!mAnimating) return; - - if (mFrames[mCurrentFrame]->Update(dt)) - { - mCurrentFrame+=mFrameDelta; - - int frameCount = mFrames.size(); - if (mCurrentFrame >= frameCount) - { - if (mAnimationType == JSprite::ANIMATION_TYPE_LOOPING) - mCurrentFrame = 0; - else if (mAnimationType == JSprite::ANIMATION_TYPE_ONCE_AND_GONE) - { - mAnimating = false; - mActive = false; - } - else if (mAnimationType == JSprite::ANIMATION_TYPE_ONCE_AND_STAY) - { - mCurrentFrame = frameCount-1; - mAnimating = false; - } - else if (mAnimationType == JSprite::ANIMATION_TYPE_ONCE_AND_BACK) - { - mCurrentFrame = 0; - mAnimating = false; - } - else // ping pong - { - mFrameDelta *= -1; - mCurrentFrame += mFrameDelta; - } - } - else if (mCurrentFrame < 0) - { - if (mAnimationType == JSprite::ANIMATION_TYPE_PINGPONG) - { - mFrameDelta *= -1; - mCurrentFrame += mFrameDelta; - } - } - - if (mAnimating) - mFrames[mCurrentFrame]->Start(); - } - -} - - -void JAnimator::Render() -{ - if (!mActive) - return; - - mFrames[mCurrentFrame]->Render(mX-mHotSpotX, mY-mHotSpotY); - -} - - -bool JAnimator::IsActive() -{ - return mActive; -} - -bool JAnimator::IsAnimating() -{ - return mAnimating; -} - - -int JAnimator::GetCurrentFrameIndex() -{ - return mCurrentFrame; -} - - -void JAnimator::SetCurrentFrameIndex(int index) -{ - if (index < (int)mFrames.size()) - mCurrentFrame = index; -} - - -void JAnimator::SetAnimationType(int type) -{ - mAnimationType = type; -} - - -JResourceManager* JAnimator::GetResourceManager() -{ - return mResource; -} - - -void JAnimator::SetPosition(float x, float y) -{ - mX = x; - mY = y; -} - - -void JAnimator::SetHotSpot(float x, float y) -{ - mHotSpotX = x; - mHotSpotY = y; -} - - -////////////////////////////////////////////////////////////////////////// -JAnimatorFrame::JAnimatorFrame(JAnimator* parent __attribute__((unused))) -{ - mTimer = 0.0f; - mFrameTime = 100.0f; -} - -JAnimatorFrame::~JAnimatorFrame() -{ - while (mObjects.size()>0) - { - JAnimatorObject* obj = mObjects.back(); - mObjects.pop_back(); - delete obj; - } - - mObjects.clear(); - -} - -void JAnimatorFrame::AddObject(JAnimatorObject *obj) -{ - mObjects.push_back(obj); -} - -bool JAnimatorFrame::Update(float dt) -{ - mTimer += dt; - if (mTimer >= mFrameTime) - return true; - else - { - int size = mObjects.size(); - for (int i=0;iUpdate(dt); - - return false; - } -} - -void JAnimatorFrame::Render(float x, float y) -{ - int size = mObjects.size(); - for (int i=0;iRender(x, y); -} - -void JAnimatorFrame::Start() -{ - mTimer = 0.0f; -} - -// bool JAnimatorFrame::IsDone() -// { -// return false; -// } - -void JAnimatorFrame::SetFrameTime(float duration) -{ - mFrameTime = duration; -} - -////////////////////////////////////////////////////////////////////////// -JAnimatorObject::JAnimatorObject() -{ - mRenderer = JRenderer::GetInstance(); - mFlipped = false; -} - -JAnimatorObject::~JAnimatorObject() -{ - -} - -void JAnimatorObject::Update(float dt __attribute__((unused))) -{ -} - - -void JAnimatorObject::Render(float x, float y) -{ - mQuad->SetHFlip(mFlipped); - mQuad->SetColor(mColor); - mRenderer->RenderQuad(mQuad, x+mX, y+mY, mRotation, mHScale, mVScale); -} - -void JAnimatorObject::SetQuad(JQuad *quad) { mQuad = quad; } -void JAnimatorObject::SetPosition(float x, float y) { mX = x; mY = y; } -void JAnimatorObject::SetRotation(float angle) { mRotation = angle; } -void JAnimatorObject::SetHScale(float scale) { mHScale = scale; } -void JAnimatorObject::SetVScale(float scale) { mVScale = scale; } -void JAnimatorObject::SetColor(PIXEL_TYPE color) { mColor = color; } -void JAnimatorObject::SetFlip(bool flag) { mFlipped = flag; } +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#include "../include/JGE.h" +#include "../include/JResourceManager.h" +#include "../include/JFileSystem.h" +#include "../include/JRenderer.h" +#include "../include/JSprite.h" +#include "../include/JAnimator.h" + +#include "tinyxml/tinyxml.h" + + +////////////////////////////////////////////////////////////////////////// +JAnimator::JAnimator(JResourceManager* resourceMgr) +{ + mResource = resourceMgr; + mActive = false; + mAnimating = false; +} + +JAnimator::~JAnimator() +{ + while (mFrames.size()>0) + { + JAnimatorFrame* frame = mFrames.back(); + mFrames.pop_back(); + delete frame; + } + + mFrames.clear(); +} + +bool JAnimator::Load(const char* scriptFile) +{ + + JFileSystem *fileSystem = JFileSystem::GetInstance(); + if (fileSystem == NULL) return false; + + if (!fileSystem->OpenFile(scriptFile)) return false; + + int size = fileSystem->GetFileSize(); + char *xmlBuffer = new char[size]; + fileSystem->ReadFile(xmlBuffer, size); + + TiXmlDocument doc; + doc.Parse(xmlBuffer); + + TiXmlNode* script = 0; + TiXmlNode* frame = 0; + TiXmlNode* obj = 0; + TiXmlNode* param = 0; + TiXmlElement* element = 0; + + float defaultTime = 0.033f; + + script = doc.FirstChild("script"); + if (script) + { + element = script->ToElement(); + printf("---- Loading %s:%s\n", element->Value(), element->Attribute("name")); + + const char *type[] = + { + "ANIMATION_TYPE_LOOPING", + "ANIMATION_TYPE_ONCE_AND_STAY", + "ANIMATION_TYPE_ONCE_AND_BACK", + "ANIMATION_TYPE_ONCE_AND_GONE", + "ANIMATION_TYPE_PINGPONG" + }; + + const char* aniType = element->Attribute("type"); + for (int i=0;i<5;i++) + if (strcmp(type[i], aniType)==0) + { + SetAnimationType(i); + break; + } + + float fps; + if (element->QueryFloatAttribute("framerate", &fps) != TIXML_SUCCESS) + fps = 30.0f; + + defaultTime = 1/fps; + + for (frame = script->FirstChild("frame"); frame; frame = frame->NextSibling()) + { + JAnimatorFrame *aniFrame = new JAnimatorFrame(this); + + float duration; + element = frame->ToElement(); + if (element->QueryFloatAttribute("time", &duration) != TIXML_SUCCESS) + duration = defaultTime; + aniFrame->SetFrameTime(duration); + + for (obj = frame->FirstChild(); obj; obj = obj->NextSibling()) + { + for (param = obj->FirstChild(); param; param = param->NextSibling()) + { + + element = param->ToElement(); + if (element != NULL) + { + if (strcmp(element->Value(), "settings")==0) + { + const char* quadName = element->Attribute("quad"); + JQuad* quad = mResource->GetQuad(quadName); + + float x, y; + float vsize, hsize; + float angle; + int a, r, g, b; + int value; + bool flipped = false; + + if (element->QueryFloatAttribute("x", &x) != TIXML_SUCCESS) + x = 0.0f; + + if (element->QueryFloatAttribute("y", &y) != TIXML_SUCCESS) + y = 0.0f; + + if (element->QueryFloatAttribute("hsize", &hsize) != TIXML_SUCCESS) + hsize = 1.0f; + + if (element->QueryFloatAttribute("vsize", &vsize) != TIXML_SUCCESS) + vsize = 1.0f; + + if (element->QueryFloatAttribute("rotation", &angle) != TIXML_SUCCESS) + angle = 0.0f; + + if (element->QueryIntAttribute("a", &a) != TIXML_SUCCESS) + a = 255; + + if (element->QueryIntAttribute("r", &r) != TIXML_SUCCESS) + r = 255; + + if (element->QueryIntAttribute("g", &g) != TIXML_SUCCESS) + g = 255; + + if (element->QueryIntAttribute("b", &b) != TIXML_SUCCESS) + b = 255; + + if (element->QueryIntAttribute("flip", &value) == TIXML_SUCCESS) + flipped = (value==1); + + + JAnimatorObject *object = new JAnimatorObject(); + object->SetQuad(quad); + object->SetPosition(x, y); + object->SetHScale(hsize); + object->SetVScale(vsize); + object->SetRotation(angle); + object->SetColor(ARGB(a,r,g,b)); + object->SetFlip(flipped); + + aniFrame->AddObject(object); + + } + } + } + + } + + mFrames.push_back(aniFrame); + } + + } + + fileSystem->CloseFile(); + delete[] xmlBuffer; + + return true; + +} + +void JAnimator::Start() +{ + mFrameDelta = 1; + mAnimating = true; + mActive = true; + mCurrentFrame = 0; + + mFrames[mCurrentFrame]->Start(); +} + +void JAnimator::Stop() +{ + mAnimating = false; + mActive = false; +} + +void JAnimator::Pause() +{ + mAnimating = false; +} + +void JAnimator::Resume() +{ + mAnimating = true; +} + +void JAnimator::Update(float dt) +{ + if (!mAnimating) return; + + if (mFrames[mCurrentFrame]->Update(dt)) + { + mCurrentFrame+=mFrameDelta; + + int frameCount = mFrames.size(); + if (mCurrentFrame >= frameCount) + { + if (mAnimationType == JSprite::ANIMATION_TYPE_LOOPING) + mCurrentFrame = 0; + else if (mAnimationType == JSprite::ANIMATION_TYPE_ONCE_AND_GONE) + { + mAnimating = false; + mActive = false; + } + else if (mAnimationType == JSprite::ANIMATION_TYPE_ONCE_AND_STAY) + { + mCurrentFrame = frameCount-1; + mAnimating = false; + } + else if (mAnimationType == JSprite::ANIMATION_TYPE_ONCE_AND_BACK) + { + mCurrentFrame = 0; + mAnimating = false; + } + else // ping pong + { + mFrameDelta *= -1; + mCurrentFrame += mFrameDelta; + } + } + else if (mCurrentFrame < 0) + { + if (mAnimationType == JSprite::ANIMATION_TYPE_PINGPONG) + { + mFrameDelta *= -1; + mCurrentFrame += mFrameDelta; + } + } + + if (mAnimating) + mFrames[mCurrentFrame]->Start(); + } + +} + + +void JAnimator::Render() +{ + if (!mActive) + return; + + mFrames[mCurrentFrame]->Render(mX-mHotSpotX, mY-mHotSpotY); + +} + + +bool JAnimator::IsActive() +{ + return mActive; +} + +bool JAnimator::IsAnimating() +{ + return mAnimating; +} + + +int JAnimator::GetCurrentFrameIndex() +{ + return mCurrentFrame; +} + + +void JAnimator::SetCurrentFrameIndex(int index) +{ + if (index < (int)mFrames.size()) + mCurrentFrame = index; +} + + +void JAnimator::SetAnimationType(int type) +{ + mAnimationType = type; +} + + +JResourceManager* JAnimator::GetResourceManager() +{ + return mResource; +} + + +void JAnimator::SetPosition(float x, float y) +{ + mX = x; + mY = y; +} + + +void JAnimator::SetHotSpot(float x, float y) +{ + mHotSpotX = x; + mHotSpotY = y; +} + + +////////////////////////////////////////////////////////////////////////// +JAnimatorFrame::JAnimatorFrame(JAnimator* parent __attribute__((unused))) +{ + mTimer = 0.0f; + mFrameTime = 100.0f; +} + +JAnimatorFrame::~JAnimatorFrame() +{ + while (mObjects.size()>0) + { + JAnimatorObject* obj = mObjects.back(); + mObjects.pop_back(); + delete obj; + } + + mObjects.clear(); + +} + +void JAnimatorFrame::AddObject(JAnimatorObject *obj) +{ + mObjects.push_back(obj); +} + +bool JAnimatorFrame::Update(float dt) +{ + mTimer += dt; + if (mTimer >= mFrameTime) + return true; + else + { + int size = mObjects.size(); + for (int i=0;iUpdate(dt); + + return false; + } +} + +void JAnimatorFrame::Render(float x, float y) +{ + int size = mObjects.size(); + for (int i=0;iRender(x, y); +} + +void JAnimatorFrame::Start() +{ + mTimer = 0.0f; +} + +// bool JAnimatorFrame::IsDone() +// { +// return false; +// } + +void JAnimatorFrame::SetFrameTime(float duration) +{ + mFrameTime = duration; +} + +////////////////////////////////////////////////////////////////////////// +JAnimatorObject::JAnimatorObject() +{ + mRenderer = JRenderer::GetInstance(); + mFlipped = false; +} + +JAnimatorObject::~JAnimatorObject() +{ + +} + +void JAnimatorObject::Update(float dt __attribute__((unused))) +{ +} + + +void JAnimatorObject::Render(float x, float y) +{ + mQuad->SetHFlip(mFlipped); + mQuad->SetColor(mColor); + mRenderer->RenderQuad(mQuad, x+mX, y+mY, mRotation, mHScale, mVScale); +} + +void JAnimatorObject::SetQuad(JQuad *quad) { mQuad = quad; } +void JAnimatorObject::SetPosition(float x, float y) { mX = x; mY = y; } +void JAnimatorObject::SetRotation(float angle) { mRotation = angle; } +void JAnimatorObject::SetHScale(float scale) { mHScale = scale; } +void JAnimatorObject::SetVScale(float scale) { mVScale = scale; } +void JAnimatorObject::SetColor(PIXEL_TYPE color) { mColor = color; } +void JAnimatorObject::SetFlip(bool flag) { mFlipped = flag; } diff --git a/JGE/src/JCooleyesMP3.cpp b/JGE/src/JCooleyesMP3.cpp index 16b845999..d2896b933 100644 --- a/JGE/src/JCooleyesMP3.cpp +++ b/JGE/src/JCooleyesMP3.cpp @@ -1,331 +1,331 @@ -#include -#include -#include -#include -#include -#include - -#include "../include/JAudio.h" -#include "../include/JFileSystem.h" -#include "../include/JCooleyesMP3.h" - - -JCooleyesMP3::JCooleyesMP3() -{ - mPlaying = false; - mp3_handle = 0; - mFileBuffer = NULL; - mMP3FirstFramePointer = NULL; - mFileSize = 0; - mCurrFramePointer = NULL; - mDataPointer = 0; - mSamplesPending = 0; - mAllMP3DataProcessed = true; - mUpdateCounter = 0; - - mLooping = false; - - mChannelCount = 2; - mSampleRate = 44100; // this is mp3 file's sample rate, also can be 48000,.... - mSamplePerFrame = SAMPLE_PER_FRAME; // default value for MPEG1, Layer3 - - mOutputBufferIndex = 0; -} - -JCooleyesMP3::~JCooleyesMP3() -{ - -} - - -bool JCooleyesMP3::IsPlaying() -{ - return mPlaying; -} - - -void JCooleyesMP3::InitBuffers(unsigned long *MP3CodecBuffer, short* decoderBuffer, short* decodedDataOutputBuffer) -{ - - mMP3CodecBuffer = MP3CodecBuffer; - mDecoderBuffer = decoderBuffer; - mDecodedDataOutputBuffer = decodedDataOutputBuffer; - -} - - -bool JCooleyesMP3::Load(const char *filename) -{ - if (!g_MP3DecoderOK) - return false; - - bool ret = true; - - JFileSystem* fileSys = JFileSystem::GetInstance(); - - //mp3_handle = sceIoOpen(filename, PSP_O_RDONLY, 0777); - if (fileSys->OpenFile(filename)) - { - mFileSize = fileSys->GetFileSize();// sceIoLseek32(mp3_handle, 0, PSP_SEEK_END); - //sceIoLseek32(mp3_handle, 0, PSP_SEEK_SET); - - mFileBuffer = (u8*)memalign(64, mFileSize); - if (mFileBuffer) - { - if (fileSys->ReadFile(mFileBuffer, mFileSize ) != mFileSize) - ret = false; - } - else - ret = false; - - //sceIoClose(mp3_handle); - fileSys->CloseFile(); - - if (ret) - { - mMP3FirstFramePointer = mFileBuffer; - - // skip ID3v2.x header - if (mFileBuffer[0]=='I' && mFileBuffer[1]=='D' && mFileBuffer[2]=='3') - { - u32 size = mFileBuffer[9]; - u32 n = mFileBuffer[8]; - size |= (n<<7); - - n = mFileBuffer[7]; - size |= (n<<14); - - n = mFileBuffer[6]; - size |= (n<<21); - - size += 10; - - mMP3FirstFramePointer += size; - - } - } - } - - mAllMP3DataProcessed = !ret; - - return ret; -} - -void JCooleyesMP3::Release() -{ - mAllMP3DataProcessed = true; - - if (mFileBuffer) - { - free(mFileBuffer); - mFileBuffer = NULL; - } -} - - -bool JCooleyesMP3::Play(bool looping) -{ - if (!mAllMP3DataProcessed) - { - mOutputBufferIndex = 0; - mLooping = looping; - - mUpdateCounter = 0; - mSamplesPending = 0; - mDataPointer = 0; - mCurrFramePointer = mMP3FirstFramePointer; - - mPlaying = true; - - - - - Decode(); - //MP3Decode(); - //MP3Decode(); - //MP3Decode(); - - - - } - else - mPlaying = false; - - return mPlaying; -} - - -// bool JCooleyesMP3::PlaybackDone() -// { -// return (mAllMP3DataProcessed && mSamplesPending==0); -// } - - -void JCooleyesMP3::FeedAudioData(void* buf, unsigned int length/*, bool mixing*/) -{ - if (mPlaying) - { - if (mSamplesPending > 0) - { - short *dest = (short *)buf; - - if ((int)length > mSamplesPending) - length = mSamplesPending; - - int i; - int count = length<<1;//*2 - int bufferMax = mSamplePerFrame<<2; //1152 * 2 * 4 - for (i=0;i>= 1; -// dest[i] |= (mDecodedDataOutputBuffer[mDataPointer]>>1); -// } -// else - - dest[i] = mDecodedDataOutputBuffer[mDataPointer]; - - mDataPointer++; - if (mDataPointer >= bufferMax) - mDataPointer = 0; - } - - mSamplesPending -= length; - - } - - Decode(); - - if (mAllMP3DataProcessed && mSamplesPending<=0) - { - if (mLooping) - { - mSamplesPending = 0; - mAllMP3DataProcessed = false; - mUpdateCounter = 0; - mCurrFramePointer = mMP3FirstFramePointer; - - Decode(); - - } - else - mPlaying = false; - } - } -} - - - -void JCooleyesMP3::Decode() -{ - if (mAllMP3DataProcessed) - return; - - - // get offset to current decoding buffer - int dest = mOutputBufferIndex*(mSamplePerFrame<<1);//*2; - - if (mSamplesPending == 0 || dest > mDataPointer || (dest + (int)(mSamplePerFrame<<1) < mDataPointer)) //1152*2; - { - - memset(mDecoderBuffer, 0, mSamplePerFrame<<2);//*2*2); - - unsigned int mp3_header = mCurrFramePointer[0]; - mp3_header = (mp3_header<<8) | mCurrFramePointer[1]; - mp3_header = (mp3_header<<8) | mCurrFramePointer[2]; - mp3_header = (mp3_header<<8) | mCurrFramePointer[3]; - - int bitrate = (mp3_header & 0xf000) >> 12; - int padding = (mp3_header & 0x200) >> 9; - - int bitrates[] = {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320}; - int frame_size = 144000*bitrates[bitrate]/mSampleRate + padding; - - - // skip 1 frame - -// mCurrFramePointer += frame_size; -// mUpdateCounter += frame_size; -// -// mp3_header = mCurrFramePointer[0]; -// mp3_header = (mp3_header<<8) | mCurrFramePointer[1]; -// mp3_header = (mp3_header<<8) | mCurrFramePointer[2]; -// mp3_header = (mp3_header<<8) | mCurrFramePointer[3]; -// -// bitrate = (mp3_header & 0xf000) >> 12; -// padding = (mp3_header & 0x200) >> 9; -// -// frame_size = 144000*bitrates[bitrate]/mSampleRate + padding; - - - - ////////////////////////////////////////////////////////////////////////// - #if defined (FORCE_BUFFER_ALIGNMENT) - - u8* mp3_data_buffer = (u8*)memalign(64, frame_size); - memcpy(mp3_data_buffer, mCurrFramePointer, frame_size); - mMP3CodecBuffer[6] = (unsigned long)mp3_data_buffer; - - ////////////////////////////////////////////////////////////////////////// - #else - - mMP3CodecBuffer[6] = (unsigned long)mCurrFramePointer; - - #endif - ////////////////////////////////////////////////////////////////////////// - - mMP3CodecBuffer[8] = (unsigned long)mDecoderBuffer; - - mMP3CodecBuffer[7] = mMP3CodecBuffer[10] = frame_size; - mMP3CodecBuffer[9] = mSamplePerFrame << 2;//* 4; - - int res = sceAudiocodecDecode(mMP3CodecBuffer, 0x1002); - - ////////////////////////////////////////////////////////////////////////// - #if defined (FORCE_BUFFER_ALIGNMENT) - - free (mp3_data_buffer); - - #endif - ////////////////////////////////////////////////////////////////////////// - - if ( res < 0 ) - { - - mAllMP3DataProcessed = true; - return; - } - short *buffer = mDecodedDataOutputBuffer+dest;//mOutputBufferIndex*1152*2; - - memcpy(buffer, mDecoderBuffer, mSamplePerFrame<<2);//1152*4); - - mOutputBufferIndex = (mOutputBufferIndex+1)%DECODING_BUFFER_COUNT; - - mSamplesPending += mSamplePerFrame; - - mCurrFramePointer += frame_size; - mUpdateCounter += frame_size; - - if (mUpdateCounter >= mFileSize) - { - - mAllMP3DataProcessed = true; - } - - } - -} - - -void JCooleyesMP3::Stop() -{ - mPlaying = false; -} - - -void JCooleyesMP3::Resume() -{ - if (!mAllMP3DataProcessed) - mPlaying = true; -} +#include +#include +#include +#include +#include +#include + +#include "../include/JAudio.h" +#include "../include/JFileSystem.h" +#include "../include/JCooleyesMP3.h" + + +JCooleyesMP3::JCooleyesMP3() +{ + mPlaying = false; + mp3_handle = 0; + mFileBuffer = NULL; + mMP3FirstFramePointer = NULL; + mFileSize = 0; + mCurrFramePointer = NULL; + mDataPointer = 0; + mSamplesPending = 0; + mAllMP3DataProcessed = true; + mUpdateCounter = 0; + + mLooping = false; + + mChannelCount = 2; + mSampleRate = 44100; // this is mp3 file's sample rate, also can be 48000,.... + mSamplePerFrame = SAMPLE_PER_FRAME; // default value for MPEG1, Layer3 + + mOutputBufferIndex = 0; +} + +JCooleyesMP3::~JCooleyesMP3() +{ + +} + + +bool JCooleyesMP3::IsPlaying() +{ + return mPlaying; +} + + +void JCooleyesMP3::InitBuffers(unsigned long *MP3CodecBuffer, short* decoderBuffer, short* decodedDataOutputBuffer) +{ + + mMP3CodecBuffer = MP3CodecBuffer; + mDecoderBuffer = decoderBuffer; + mDecodedDataOutputBuffer = decodedDataOutputBuffer; + +} + + +bool JCooleyesMP3::Load(const char *filename) +{ + if (!g_MP3DecoderOK) + return false; + + bool ret = true; + + JFileSystem* fileSys = JFileSystem::GetInstance(); + + //mp3_handle = sceIoOpen(filename, PSP_O_RDONLY, 0777); + if (fileSys->OpenFile(filename)) + { + mFileSize = fileSys->GetFileSize();// sceIoLseek32(mp3_handle, 0, PSP_SEEK_END); + //sceIoLseek32(mp3_handle, 0, PSP_SEEK_SET); + + mFileBuffer = (u8*)memalign(64, mFileSize); + if (mFileBuffer) + { + if (fileSys->ReadFile(mFileBuffer, mFileSize ) != mFileSize) + ret = false; + } + else + ret = false; + + //sceIoClose(mp3_handle); + fileSys->CloseFile(); + + if (ret) + { + mMP3FirstFramePointer = mFileBuffer; + + // skip ID3v2.x header + if (mFileBuffer[0]=='I' && mFileBuffer[1]=='D' && mFileBuffer[2]=='3') + { + u32 size = mFileBuffer[9]; + u32 n = mFileBuffer[8]; + size |= (n<<7); + + n = mFileBuffer[7]; + size |= (n<<14); + + n = mFileBuffer[6]; + size |= (n<<21); + + size += 10; + + mMP3FirstFramePointer += size; + + } + } + } + + mAllMP3DataProcessed = !ret; + + return ret; +} + +void JCooleyesMP3::Release() +{ + mAllMP3DataProcessed = true; + + if (mFileBuffer) + { + free(mFileBuffer); + mFileBuffer = NULL; + } +} + + +bool JCooleyesMP3::Play(bool looping) +{ + if (!mAllMP3DataProcessed) + { + mOutputBufferIndex = 0; + mLooping = looping; + + mUpdateCounter = 0; + mSamplesPending = 0; + mDataPointer = 0; + mCurrFramePointer = mMP3FirstFramePointer; + + mPlaying = true; + + + + + Decode(); + //MP3Decode(); + //MP3Decode(); + //MP3Decode(); + + + + } + else + mPlaying = false; + + return mPlaying; +} + + +// bool JCooleyesMP3::PlaybackDone() +// { +// return (mAllMP3DataProcessed && mSamplesPending==0); +// } + + +void JCooleyesMP3::FeedAudioData(void* buf, unsigned int length/*, bool mixing*/) +{ + if (mPlaying) + { + if (mSamplesPending > 0) + { + short *dest = (short *)buf; + + if ((int)length > mSamplesPending) + length = mSamplesPending; + + int i; + int count = length<<1;//*2 + int bufferMax = mSamplePerFrame<<2; //1152 * 2 * 4 + for (i=0;i>= 1; +// dest[i] |= (mDecodedDataOutputBuffer[mDataPointer]>>1); +// } +// else + + dest[i] = mDecodedDataOutputBuffer[mDataPointer]; + + mDataPointer++; + if (mDataPointer >= bufferMax) + mDataPointer = 0; + } + + mSamplesPending -= length; + + } + + Decode(); + + if (mAllMP3DataProcessed && mSamplesPending<=0) + { + if (mLooping) + { + mSamplesPending = 0; + mAllMP3DataProcessed = false; + mUpdateCounter = 0; + mCurrFramePointer = mMP3FirstFramePointer; + + Decode(); + + } + else + mPlaying = false; + } + } +} + + + +void JCooleyesMP3::Decode() +{ + if (mAllMP3DataProcessed) + return; + + + // get offset to current decoding buffer + int dest = mOutputBufferIndex*(mSamplePerFrame<<1);//*2; + + if (mSamplesPending == 0 || dest > mDataPointer || (dest + (int)(mSamplePerFrame<<1) < mDataPointer)) //1152*2; + { + + memset(mDecoderBuffer, 0, mSamplePerFrame<<2);//*2*2); + + unsigned int mp3_header = mCurrFramePointer[0]; + mp3_header = (mp3_header<<8) | mCurrFramePointer[1]; + mp3_header = (mp3_header<<8) | mCurrFramePointer[2]; + mp3_header = (mp3_header<<8) | mCurrFramePointer[3]; + + int bitrate = (mp3_header & 0xf000) >> 12; + int padding = (mp3_header & 0x200) >> 9; + + int bitrates[] = {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320}; + int frame_size = 144000*bitrates[bitrate]/mSampleRate + padding; + + + // skip 1 frame + +// mCurrFramePointer += frame_size; +// mUpdateCounter += frame_size; +// +// mp3_header = mCurrFramePointer[0]; +// mp3_header = (mp3_header<<8) | mCurrFramePointer[1]; +// mp3_header = (mp3_header<<8) | mCurrFramePointer[2]; +// mp3_header = (mp3_header<<8) | mCurrFramePointer[3]; +// +// bitrate = (mp3_header & 0xf000) >> 12; +// padding = (mp3_header & 0x200) >> 9; +// +// frame_size = 144000*bitrates[bitrate]/mSampleRate + padding; + + + + ////////////////////////////////////////////////////////////////////////// + #if defined (FORCE_BUFFER_ALIGNMENT) + + u8* mp3_data_buffer = (u8*)memalign(64, frame_size); + memcpy(mp3_data_buffer, mCurrFramePointer, frame_size); + mMP3CodecBuffer[6] = (unsigned long)mp3_data_buffer; + + ////////////////////////////////////////////////////////////////////////// + #else + + mMP3CodecBuffer[6] = (unsigned long)mCurrFramePointer; + + #endif + ////////////////////////////////////////////////////////////////////////// + + mMP3CodecBuffer[8] = (unsigned long)mDecoderBuffer; + + mMP3CodecBuffer[7] = mMP3CodecBuffer[10] = frame_size; + mMP3CodecBuffer[9] = mSamplePerFrame << 2;//* 4; + + int res = sceAudiocodecDecode(mMP3CodecBuffer, 0x1002); + + ////////////////////////////////////////////////////////////////////////// + #if defined (FORCE_BUFFER_ALIGNMENT) + + free (mp3_data_buffer); + + #endif + ////////////////////////////////////////////////////////////////////////// + + if ( res < 0 ) + { + + mAllMP3DataProcessed = true; + return; + } + short *buffer = mDecodedDataOutputBuffer+dest;//mOutputBufferIndex*1152*2; + + memcpy(buffer, mDecoderBuffer, mSamplePerFrame<<2);//1152*4); + + mOutputBufferIndex = (mOutputBufferIndex+1)%DECODING_BUFFER_COUNT; + + mSamplesPending += mSamplePerFrame; + + mCurrFramePointer += frame_size; + mUpdateCounter += frame_size; + + if (mUpdateCounter >= mFileSize) + { + + mAllMP3DataProcessed = true; + } + + } + +} + + +void JCooleyesMP3::Stop() +{ + mPlaying = false; +} + + +void JCooleyesMP3::Resume() +{ + if (!mAllMP3DataProcessed) + mPlaying = true; +} diff --git a/JGE/src/JDistortionMesh.cpp b/JGE/src/JDistortionMesh.cpp index 2c3433d26..b7c4ea477 100644 --- a/JGE/src/JDistortionMesh.cpp +++ b/JGE/src/JDistortionMesh.cpp @@ -1,121 +1,121 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#include "../include/JDistortionMesh.h" - - -JRenderer* JDistortionMesh::mRenderer = NULL; - -JDistortionMesh::JDistortionMesh(JTexture *tex, float x, float y, float width, float height, int cols, int rows) -{ - mRenderer = JRenderer::GetInstance(); - - mCols = cols; - mRows = rows; - - mCellWidth = width/(mCols-1); - mCellHeight = height/(mRows-1); - - mTexX = x; - mTexY = y; - mTexWidth = width; - mTexHeight = height; - - mQuad = new JQuad(tex, x, y, mCellWidth, mCellHeight); - - mVertices = new Vertex[mCols*mRows]; - - for(int j=0; jmBlend = GU_TFX_ADD; - - VertexColor points[4]; - - int index; - - for(int j=0; jSetTextureRect(mVertices[index].u, mVertices[index].v, mCellWidth, mCellHeight); - - points[0].x = x+mVertices[index].x; - points[0].y = y+mVertices[index].y; - points[0].z = mVertices[index].z; - points[0].color = mVertices[index].color; - - points[1].x = x+mVertices[index+1].x; - points[1].y = y+mVertices[index+1].y; - points[1].z = mVertices[index+1].z; - points[1].color = mVertices[index+1].color; - - points[2].x = x+mVertices[index+mCols].x; - points[2].y = y+mVertices[index+mCols].y; - points[2].z = mVertices[index+mCols].z; - points[2].color = mVertices[index+mCols].color; - - points[3].x = x+mVertices[index+mCols+1].x; - points[3].y = y+mVertices[index+mCols+1].y; - points[3].z = mVertices[index+mCols+1].z; - points[3].color = mVertices[index+mCols+1].color; - - mRenderer->RenderQuad(mQuad, points); - } - } - - -} - - -void JDistortionMesh::SetColor(int col, int row, PIXEL_TYPE color) -{ - mVertices[row*mCols+col].color = color; - -} - - -void JDistortionMesh::SetDisplacement(int col, int row, float dx, float dy) -{ - dx += col*mCellWidth; - dy += row*mCellHeight; - - mVertices[row*mCols+col].x = dx; - mVertices[row*mCols+col].y = dy; -} +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#include "../include/JDistortionMesh.h" + + +JRenderer* JDistortionMesh::mRenderer = NULL; + +JDistortionMesh::JDistortionMesh(JTexture *tex, float x, float y, float width, float height, int cols, int rows) +{ + mRenderer = JRenderer::GetInstance(); + + mCols = cols; + mRows = rows; + + mCellWidth = width/(mCols-1); + mCellHeight = height/(mRows-1); + + mTexX = x; + mTexY = y; + mTexWidth = width; + mTexHeight = height; + + mQuad = new JQuad(tex, x, y, mCellWidth, mCellHeight); + + mVertices = new Vertex[mCols*mRows]; + + for(int j=0; jmBlend = GU_TFX_ADD; + + VertexColor points[4]; + + int index; + + for(int j=0; jSetTextureRect(mVertices[index].u, mVertices[index].v, mCellWidth, mCellHeight); + + points[0].x = x+mVertices[index].x; + points[0].y = y+mVertices[index].y; + points[0].z = mVertices[index].z; + points[0].color = mVertices[index].color; + + points[1].x = x+mVertices[index+1].x; + points[1].y = y+mVertices[index+1].y; + points[1].z = mVertices[index+1].z; + points[1].color = mVertices[index+1].color; + + points[2].x = x+mVertices[index+mCols].x; + points[2].y = y+mVertices[index+mCols].y; + points[2].z = mVertices[index+mCols].z; + points[2].color = mVertices[index+mCols].color; + + points[3].x = x+mVertices[index+mCols+1].x; + points[3].y = y+mVertices[index+mCols+1].y; + points[3].z = mVertices[index+mCols+1].z; + points[3].color = mVertices[index+mCols+1].color; + + mRenderer->RenderQuad(mQuad, points); + } + } + + +} + + +void JDistortionMesh::SetColor(int col, int row, PIXEL_TYPE color) +{ + mVertices[row*mCols+col].color = color; + +} + + +void JDistortionMesh::SetDisplacement(int col, int row, float dx, float dy) +{ + dx += col*mCellWidth; + dy += row*mCellHeight; + + mVertices[row*mCols+col].x = dx; + mVertices[row*mCols+col].y = dy; +} diff --git a/JGE/src/JGBKFont.cpp b/JGE/src/JGBKFont.cpp index c22914513..382db5701 100644 --- a/JGE/src/JGBKFont.cpp +++ b/JGE/src/JGBKFont.cpp @@ -1,647 +1,647 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// Copyright (c) 2007 Sijiu Duan (a.k.a. Chi80) -// -//------------------------------------------------------------------------------------- - -#include - -#include "../include/JGBKFont.h" -#include "../include/JFileSystem.h" - -JRenderer* JGBKFont::mRenderer = NULL; - -JGBKFont::JGBKFont() -{ - mRenderer = JRenderer::GetInstance(); - - mChnFont = NULL; - mEngFont = NULL; - - mCurr = 0; - - mColor = ARGB(255,255,255,255); - mBgColor = ARGB(0,0,0,0); - - mScale = 1.0f; - - mRotation = 0.0f; - - mCount = 0; - mTexture = NULL; - mSprites = NULL; - mGBCode = NULL; - - mCharBuffer = NULL; -} - - - -JGBKFont::~JGBKFont() -{ - SAFE_DELETE_ARRAY(mEngFont); - - SAFE_DELETE_ARRAY(mChnFont); - - SAFE_DELETE(mTexture); - - if (mSprites) - { - for (int i=0;iCreateTexture(mCacheImageWidth, mCacheImageHeight, true); - - int index = 0; - for (int y=0;ySetHotSpot(mFontSize/2, mFontSize/2); - - index++; - } - } - - int size; - - JFileSystem *fileSys = JFileSystem::GetInstance(); - if (!fileSys->OpenFile(engFileName)) - return false; - - size = fileSys->GetFileSize(); - mEngFont = new BYTE[size]; - - fileSys->ReadFile(mEngFont, size); - fileSys->CloseFile(); - - - if (!fileSys->OpenFile(chnFileName)) - return false; - - size = fileSys->GetFileSize(); - - mChnFont = new BYTE[size]; - - fileSys->ReadFile(mChnFont, size); - fileSys->CloseFile(); - - return true; -} - - -#if defined (WIN32) || defined (LINUX) -#else -void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width) -{ - unsigned int rowblocks = (width >> 4); - - unsigned int blockx = (i >> 4); - unsigned int blocky = (j >> 3); - - unsigned int x = (i - (blockx<<4)); - unsigned int y = (j - (blocky<<3)); - unsigned int block_index = blockx + ((blocky) * rowblocks); - unsigned int block_address = block_index << 7; - - u8* p = out + (block_address + x + (y << 4)); - PIXEL_TYPE* dest = (PIXEL_TYPE *)p; - *dest = color; - -} -#endif - -int JGBKFont::PreCacheChar(const BYTE *ch) -{ - int code; - BOOL isChinese = true; - if (*ch > 0x80) - { - // get offset to the proper character bits (GBK encoding) - code = (((DWORD)(*ch - 0x81)) * 0xBF + ((DWORD)(*(ch + 1) - 0x40))); - } - else - { - code = ((DWORD)*ch)|0x10000; - isChinese = false; - } - - if (mGBCode[mCurr] != -1) - { - - for (int i=0;i= mCacheSize) - mCurr = 0; - -#if defined (WIN32) || defined (LINUX) || defined (IOS) - int x = 0; - int y = 0; - - memset(mCharBuffer, 0, sizeof(DWORD)*mFontSize*mFontSize); -#else - u8* pTexture = (u8*) mTexture->mBits; - int x; - int y = (int)mSprites[index]->mY; -#endif - - - BYTE* src; - BYTE bits; - int bitCount; - - if (isChinese) - { - - src = mChnFont + code * mBytesPerChar; - for (int i=0;imX; -#endif - - for (int j=0;jmTexWidth*PIXEL_SIZE); - else - SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE); -#endif - bitMask >>= 1; - x++; - - bitCount--; - - } - - } - y++; - } - } - else - { - int size = (mFontSize <= 16)?mFontSize:mFontSize*2; - src = mEngFont + (code-0x10000) * size; - - int n; - - for (int i=0;imX; -#endif - // width of the English fonts is only half of the Chinese ones - // put char in the middle - if (mFontSize <= 16) - { - - for (n=0;n<(mFontSize-8)/2;n++) - { - #if defined (WIN32) || defined (LINUX) || defined (IOS) - mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0); - #else - SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE); - #endif - x++; - } - } - - int count = (mFontSize <= 16)?1:2; - bitCount = mFontSize; - for (int k=0;kmTexWidth*PIXEL_SIZE); - else - SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE); - #endif - x++; - bitMask >>= 1; - bitCount--; - } - } - - if (mFontSize <= 16) - { - - for (n=0;n<(mFontSize-8)/2;n++) - { - #if defined (WIN32) || defined (LINUX) || defined (IOS) - mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0); - #else - SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE); - #endif - x++; - } - } - - y++; - - } - } - - mGBCode[index] = code; - -#if defined (WIN32) || defined (LINUX) || defined (IOS) - x = (int)mSprites[index]->mX; - y = (int)mSprites[index]->mY; - - glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, mFontSize, mFontSize, GL_RGBA, GL_UNSIGNED_BYTE, mCharBuffer); - -#else - sceKernelDcacheWritebackAll(); - //sceKernelDcacheWritebackInvalidateAll(); -#endif - return index; -} - - -int JGBKFont::PrepareString(BYTE* str, int* dest) -{ - mRenderer->BindTexture(mTexture); - - BYTE* src = str; - int count = 0; - while (*src != 0) - { - if (*src > 0x80) - { - dest[count++] = PreCacheChar(src); - src += 2; - } - else if (*src >= ' ') - { - dest[count++] = PreCacheChar(src); - src += 1; - } - else // control characters - { - dest[count++] = 0x80000 | *src; - src += 1; - } - } - - return count; -} - - -void JGBKFont::RenderEncodedString(const int* text, int count, float x, float y) -{ - int n = 0; - float xx = x; - float yy = y; - bool isChinese; - - for (int i=0;iSetColor(mColor); - mRenderer->RenderQuad(mSprites[text[n]], xx, yy, mRotation, mScale, mScale); - if (mSmallEnglishFont && !isChinese) - xx += (mFontSize*mScale)/2; - else - xx += (mFontSize*mScale); - if (xx >= 480) - { - xx = x; - yy += (mFontSize*mScale); - } - } - n++; - } -} -int JGBKFont::GetStringWidth( BYTE* str ) -{ - int w=0; - int h=0; - GetStringArea(str, &w, &h); - return w; -} - -int JGBKFont::GetStringHeight( BYTE* str ) -{ - int w=0; - int h=0; - GetStringArea(str, &w, &h); - return h; -} -void JGBKFont::GetStringArea( BYTE* str, int *w, int *h) -{ - BYTE* src = str; - float len= 0; - float xx = 0; - float yy = mFontSize*mScale; - bool isChinese=true; - - while (*src != 0) - { - if (yy + mFontSize < 0.0f) // don't render when outside viewport - { - if (*src < ' ') // control characters - { - if (*src == 0x0a) // NEWLINE - { - if(xx>len) - len=xx; - xx = 0; - yy += (mFontSize*mScale); - } - src += 1; - } - else - { - if (*src > 0x80) - { - src += 2; - } - else if (*src >= ' ') - { - src += 1; - } - - xx += (mFontSize*mScale); - - if (xx >= 480) - { - if(xx>len) - len=xx; - xx = 0; - yy += (mFontSize*mScale); - } - } - } - else if (yy > SCREEN_HEIGHT_F) - { - break; - } - else - { - - if (*src < ' ') // control characters - { - if (*src == 0x0a) // NEWLINE - { - if(xx>len) - len=xx; - xx = 0; - yy += (mFontSize*mScale); - } - src += 1; - } - else - { - if (*src > 0x80) - { - //index = PreCacheChar(src); - src += 2; - if (isChinese==false) - xx+=5*(mFontSize*mScale)/16; - isChinese = true; - } - else if (*src >= ' ') - { - src += 1; - if(isChinese==true) - xx-=3*(mFontSize*mScale)/16; - isChinese = false; - } - - if (mSmallEnglishFont && !isChinese) - xx += (mFontSize*mScale)/2; - else - xx += (mFontSize*mScale); - - if (xx >= 480) - { - if(xx>len) - len=xx; - xx = 0; - yy += (mFontSize*mScale); - } - } - } - - } - if (xx>len) - { - len=xx; - } - *w=(int)len; - *h=(int)yy; - -} - -void JGBKFont::RenderString(BYTE* str, float x, float y, int alignment) -{ - int w=0; - int h=0; - - switch(alignment) - { - case JGETEXT_RIGHT: - GetStringArea(str,&w,&h); - x-=w; - break; - case JGETEXT_CENTER: - GetStringArea(str,&w,&h); - x-=w/2; - break; - case JGETEXT_LEFT: - default: - break; - } - - - mRenderer->BindTexture(mTexture); - - BYTE* src = str; - float xx = x; - float yy = y; - int index; - - bool isChinese=true; - - while (*src != 0) - { - if (yy + mFontSize < 0.0f) // don't render when outside viewport - { - if (*src < ' ') // control characters - { - if (*src == 0x0a) // NEWLINE - { - xx = x; - yy += (mFontSize*mScale); - } - src += 1; - } - else - { - if (*src > 0x80) - { - src += 2; - } - else if (*src >= ' ') - { - src += 1; - } - - xx += (mFontSize*mScale); - - if (xx >= 480) - { - xx = x; - yy += (mFontSize*mScale); - } - } - } - else if (yy > SCREEN_HEIGHT_F) - { - return; - } - else - { - - if (*src < ' ') // control characters - { - if (*src == 0x0a) // NEWLINE - { - xx = x; - yy += (mFontSize*mScale); - } - src += 1; - } - else - { - if (*src > 0x80) - { - index = PreCacheChar(src); - src += 2; - if (isChinese==false) - xx+=5*(mFontSize*mScale)/16; - isChinese = true; - } - else if (*src >= ' ') - { - index = PreCacheChar(src); - src += 1; - if(isChinese==true) - xx-=3*(mFontSize*mScale)/16; - isChinese = false; - } - - mSprites[index]->SetColor(mColor); - mRenderer->RenderQuad(mSprites[index], xx, yy, mRotation, mScale, mScale); - if (mSmallEnglishFont && !isChinese) - xx += (mFontSize*mScale)/2; - else - xx += (mFontSize*mScale); - - if (xx >= 480) - { - xx = x; - yy += (mFontSize*mScale); - } - } - } - } - -} - -void JGBKFont::SetScale(float scale) { mScale = scale; } -void JGBKFont::SetRotation(float rot) { mRotation = rot; } -void JGBKFont::SetColor(PIXEL_TYPE color) { mColor = color; } -void JGBKFont::SetBgColor(PIXEL_TYPE color) { mBgColor = color; } - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// Copyright (c) 2007 Sijiu Duan (a.k.a. Chi80) +// +//------------------------------------------------------------------------------------- + +#include + +#include "../include/JGBKFont.h" +#include "../include/JFileSystem.h" + +JRenderer* JGBKFont::mRenderer = NULL; + +JGBKFont::JGBKFont() +{ + mRenderer = JRenderer::GetInstance(); + + mChnFont = NULL; + mEngFont = NULL; + + mCurr = 0; + + mColor = ARGB(255,255,255,255); + mBgColor = ARGB(0,0,0,0); + + mScale = 1.0f; + + mRotation = 0.0f; + + mCount = 0; + mTexture = NULL; + mSprites = NULL; + mGBCode = NULL; + + mCharBuffer = NULL; +} + + + +JGBKFont::~JGBKFont() +{ + SAFE_DELETE_ARRAY(mEngFont); + + SAFE_DELETE_ARRAY(mChnFont); + + SAFE_DELETE(mTexture); + + if (mSprites) + { + for (int i=0;iCreateTexture(mCacheImageWidth, mCacheImageHeight, true); + + int index = 0; + for (int y=0;ySetHotSpot(mFontSize/2, mFontSize/2); + + index++; + } + } + + int size; + + JFileSystem *fileSys = JFileSystem::GetInstance(); + if (!fileSys->OpenFile(engFileName)) + return false; + + size = fileSys->GetFileSize(); + mEngFont = new BYTE[size]; + + fileSys->ReadFile(mEngFont, size); + fileSys->CloseFile(); + + + if (!fileSys->OpenFile(chnFileName)) + return false; + + size = fileSys->GetFileSize(); + + mChnFont = new BYTE[size]; + + fileSys->ReadFile(mChnFont, size); + fileSys->CloseFile(); + + return true; +} + + +#if defined (WIN32) || defined (LINUX) +#else +void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width) +{ + unsigned int rowblocks = (width >> 4); + + unsigned int blockx = (i >> 4); + unsigned int blocky = (j >> 3); + + unsigned int x = (i - (blockx<<4)); + unsigned int y = (j - (blocky<<3)); + unsigned int block_index = blockx + ((blocky) * rowblocks); + unsigned int block_address = block_index << 7; + + u8* p = out + (block_address + x + (y << 4)); + PIXEL_TYPE* dest = (PIXEL_TYPE *)p; + *dest = color; + +} +#endif + +int JGBKFont::PreCacheChar(const BYTE *ch) +{ + int code; + BOOL isChinese = true; + if (*ch > 0x80) + { + // get offset to the proper character bits (GBK encoding) + code = (((DWORD)(*ch - 0x81)) * 0xBF + ((DWORD)(*(ch + 1) - 0x40))); + } + else + { + code = ((DWORD)*ch)|0x10000; + isChinese = false; + } + + if (mGBCode[mCurr] != -1) + { + + for (int i=0;i= mCacheSize) + mCurr = 0; + +#if defined (WIN32) || defined (LINUX) || defined (IOS) + int x = 0; + int y = 0; + + memset(mCharBuffer, 0, sizeof(DWORD)*mFontSize*mFontSize); +#else + u8* pTexture = (u8*) mTexture->mBits; + int x; + int y = (int)mSprites[index]->mY; +#endif + + + BYTE* src; + BYTE bits; + int bitCount; + + if (isChinese) + { + + src = mChnFont + code * mBytesPerChar; + for (int i=0;imX; +#endif + + for (int j=0;jmTexWidth*PIXEL_SIZE); + else + SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE); +#endif + bitMask >>= 1; + x++; + + bitCount--; + + } + + } + y++; + } + } + else + { + int size = (mFontSize <= 16)?mFontSize:mFontSize*2; + src = mEngFont + (code-0x10000) * size; + + int n; + + for (int i=0;imX; +#endif + // width of the English fonts is only half of the Chinese ones + // put char in the middle + if (mFontSize <= 16) + { + + for (n=0;n<(mFontSize-8)/2;n++) + { + #if defined (WIN32) || defined (LINUX) || defined (IOS) + mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0); + #else + SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE); + #endif + x++; + } + } + + int count = (mFontSize <= 16)?1:2; + bitCount = mFontSize; + for (int k=0;kmTexWidth*PIXEL_SIZE); + else + SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE); + #endif + x++; + bitMask >>= 1; + bitCount--; + } + } + + if (mFontSize <= 16) + { + + for (n=0;n<(mFontSize-8)/2;n++) + { + #if defined (WIN32) || defined (LINUX) || defined (IOS) + mCharBuffer[y*mFontSize+x] = ARGB(0,0,0,0); + #else + SwizzlePlot(pTexture, ARGB(0,0,0,0), x*PIXEL_SIZE, y, mTexture->mTexWidth*PIXEL_SIZE); + #endif + x++; + } + } + + y++; + + } + } + + mGBCode[index] = code; + +#if defined (WIN32) || defined (LINUX) || defined (IOS) + x = (int)mSprites[index]->mX; + y = (int)mSprites[index]->mY; + + glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, mFontSize, mFontSize, GL_RGBA, GL_UNSIGNED_BYTE, mCharBuffer); + +#else + sceKernelDcacheWritebackAll(); + //sceKernelDcacheWritebackInvalidateAll(); +#endif + return index; +} + + +int JGBKFont::PrepareString(BYTE* str, int* dest) +{ + mRenderer->BindTexture(mTexture); + + BYTE* src = str; + int count = 0; + while (*src != 0) + { + if (*src > 0x80) + { + dest[count++] = PreCacheChar(src); + src += 2; + } + else if (*src >= ' ') + { + dest[count++] = PreCacheChar(src); + src += 1; + } + else // control characters + { + dest[count++] = 0x80000 | *src; + src += 1; + } + } + + return count; +} + + +void JGBKFont::RenderEncodedString(const int* text, int count, float x, float y) +{ + int n = 0; + float xx = x; + float yy = y; + bool isChinese; + + for (int i=0;iSetColor(mColor); + mRenderer->RenderQuad(mSprites[text[n]], xx, yy, mRotation, mScale, mScale); + if (mSmallEnglishFont && !isChinese) + xx += (mFontSize*mScale)/2; + else + xx += (mFontSize*mScale); + if (xx >= 480) + { + xx = x; + yy += (mFontSize*mScale); + } + } + n++; + } +} +int JGBKFont::GetStringWidth( BYTE* str ) +{ + int w=0; + int h=0; + GetStringArea(str, &w, &h); + return w; +} + +int JGBKFont::GetStringHeight( BYTE* str ) +{ + int w=0; + int h=0; + GetStringArea(str, &w, &h); + return h; +} +void JGBKFont::GetStringArea( BYTE* str, int *w, int *h) +{ + BYTE* src = str; + float len= 0; + float xx = 0; + float yy = mFontSize*mScale; + bool isChinese=true; + + while (*src != 0) + { + if (yy + mFontSize < 0.0f) // don't render when outside viewport + { + if (*src < ' ') // control characters + { + if (*src == 0x0a) // NEWLINE + { + if(xx>len) + len=xx; + xx = 0; + yy += (mFontSize*mScale); + } + src += 1; + } + else + { + if (*src > 0x80) + { + src += 2; + } + else if (*src >= ' ') + { + src += 1; + } + + xx += (mFontSize*mScale); + + if (xx >= 480) + { + if(xx>len) + len=xx; + xx = 0; + yy += (mFontSize*mScale); + } + } + } + else if (yy > SCREEN_HEIGHT_F) + { + break; + } + else + { + + if (*src < ' ') // control characters + { + if (*src == 0x0a) // NEWLINE + { + if(xx>len) + len=xx; + xx = 0; + yy += (mFontSize*mScale); + } + src += 1; + } + else + { + if (*src > 0x80) + { + //index = PreCacheChar(src); + src += 2; + if (isChinese==false) + xx+=5*(mFontSize*mScale)/16; + isChinese = true; + } + else if (*src >= ' ') + { + src += 1; + if(isChinese==true) + xx-=3*(mFontSize*mScale)/16; + isChinese = false; + } + + if (mSmallEnglishFont && !isChinese) + xx += (mFontSize*mScale)/2; + else + xx += (mFontSize*mScale); + + if (xx >= 480) + { + if(xx>len) + len=xx; + xx = 0; + yy += (mFontSize*mScale); + } + } + } + + } + if (xx>len) + { + len=xx; + } + *w=(int)len; + *h=(int)yy; + +} + +void JGBKFont::RenderString(BYTE* str, float x, float y, int alignment) +{ + int w=0; + int h=0; + + switch(alignment) + { + case JGETEXT_RIGHT: + GetStringArea(str,&w,&h); + x-=w; + break; + case JGETEXT_CENTER: + GetStringArea(str,&w,&h); + x-=w/2; + break; + case JGETEXT_LEFT: + default: + break; + } + + + mRenderer->BindTexture(mTexture); + + BYTE* src = str; + float xx = x; + float yy = y; + int index; + + bool isChinese=true; + + while (*src != 0) + { + if (yy + mFontSize < 0.0f) // don't render when outside viewport + { + if (*src < ' ') // control characters + { + if (*src == 0x0a) // NEWLINE + { + xx = x; + yy += (mFontSize*mScale); + } + src += 1; + } + else + { + if (*src > 0x80) + { + src += 2; + } + else if (*src >= ' ') + { + src += 1; + } + + xx += (mFontSize*mScale); + + if (xx >= 480) + { + xx = x; + yy += (mFontSize*mScale); + } + } + } + else if (yy > SCREEN_HEIGHT_F) + { + return; + } + else + { + + if (*src < ' ') // control characters + { + if (*src == 0x0a) // NEWLINE + { + xx = x; + yy += (mFontSize*mScale); + } + src += 1; + } + else + { + if (*src > 0x80) + { + index = PreCacheChar(src); + src += 2; + if (isChinese==false) + xx+=5*(mFontSize*mScale)/16; + isChinese = true; + } + else if (*src >= ' ') + { + index = PreCacheChar(src); + src += 1; + if(isChinese==true) + xx-=3*(mFontSize*mScale)/16; + isChinese = false; + } + + mSprites[index]->SetColor(mColor); + mRenderer->RenderQuad(mSprites[index], xx, yy, mRotation, mScale, mScale); + if (mSmallEnglishFont && !isChinese) + xx += (mFontSize*mScale)/2; + else + xx += (mFontSize*mScale); + + if (xx >= 480) + { + xx = x; + yy += (mFontSize*mScale); + } + } + } + } + +} + +void JGBKFont::SetScale(float scale) { mScale = scale; } +void JGBKFont::SetRotation(float rot) { mRotation = rot; } +void JGBKFont::SetColor(PIXEL_TYPE color) { mColor = color; } +void JGBKFont::SetBgColor(PIXEL_TYPE color) { mBgColor = color; } + diff --git a/JGE/src/JGameObject.cpp b/JGE/src/JGameObject.cpp index 85e62e6f7..d05a60f37 100644 --- a/JGE/src/JGameObject.cpp +++ b/JGE/src/JGameObject.cpp @@ -1,334 +1,334 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - - -#include "../include/JGE.h" -#include "../include/JApp.h" - -#include "../include/JGameObject.h" - - -//JRenderer* JGameObject::mRenderer = NULL; - - - -JGameObject::JGameObject(JTexture *tex, float x, float y, float width, float height) - :JSprite(tex, x, y, width, height) -{ - //mRenderer = JRenderer::GetInstance(); - - //mX = 0.0f; - //mY = 0.0f; - - mRenderFlags = 0; - //mSize = 1.0f; - //mAngle = 0.0f; - - mOriginalBlood = 1; - mBlood = 1; - mHitPoint = 1; - - mCollided = false; - mCollisionTarget = NULL; - mFlashing = false; - - //mActive = false; - - mRotationDelta = 0.0f; - mDoRotation = false; - - mAlphaDelta = 0.0f; - mDoAlpha = false; - - mDoScaling = false; - mScaleDelta = 0.0f; - - SetBBox(x, y, width, height); - -} - - -JGameObject::~JGameObject() -{ -// JGERelease(); -} - - -void JGameObject::Update(float dt) -{ - JSprite::Update(dt); - - if (mFlashing) - { - mFlashTimer += dt; - if (mFlashTimer > FLASH_TIME) - { - mFlashTimer = 0; - mFlashCounter++; - if (mFlashCounter > FLASHING_COUNT) - mFlashing = false; - } - } - - if (mDoAlpha) - { - mAlpha += mAlphaDelta*dt; - if (mAlpha < 0.0f) - { - mAlpha = 0.0f; - if (mAnimationType == ANIMATION_TYPE_ONCE_AND_GONE) - mActive = false; - } - else if (mAlpha > 255.0f) - { - mAlpha = 255.0f; - } - - } - - if (mDoRotation || mDoScaling) - { - mRotation += mRotationDelta*dt; - mHScale += mScaleDelta*dt; - mVScale += mScaleDelta*dt; - } - -} - - -void JGameObject::Render() -{ - /* - if (mQuad != NULL) - { - //mEngine->RenderQuad(mQuad, mX, mY); - if (mFlashing && (mFlashCounter&1)==0) - { - mRenderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE); - } - - float angle = 0.0f; - if ((mRenderFlags & RENDER_FLAG_ANGLE)==RENDER_FLAG_ANGLE) - angle = mAngle; - if ((mRenderFlags & RENDER_FLAG_ROTATION)==RENDER_FLAG_ROTATION) - angle = mRotation; - float scale = 1.0f; - if ((mRenderFlags & RENDER_FLAG_SIZE)==RENDER_FLAG_SIZE) - scale = mSize; - - mRenderer->RenderQuad(mQuad, mX, mY, angle, scale, scale); - - mRenderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); - } - */ - - if (!mActive) return; - - if ((mRenderFlags & RENDER_FLAG_ANGLE)==RENDER_FLAG_ANGLE) - mRotation = mDirection; - - if (mFlashing && (mFlashCounter&1)==0) - mRenderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE); - -// if ((mRenderFlags & RENDER_FLAG_SIZE)==RENDER_FLAG_SIZE) -// { -// mHScale = mSize; -// mVScale = mSize; -// } -// else -// { -// mHScale = 1.0f; -// mVScale = 1.0f; -// } - - JSprite::Render(); - - if (mFlashing) - mRenderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); - -} - - -// void JGameObject::SetPosition(float x, float y) -// { -// // mPos = Vector2D(x, y); -// mX = x; -// mY = y; -// } - - -//void JGameObject::SetQuad(JQuad *quad) { mQuad = quad; } - - - - -//void JParticle::ResetVelocity() -//{ -// float xx = mSpeed * cosf(mAngle); -// float yy = mSpeed * sinf(mAngle); -// mVelocity = Vector2D(xx, yy); -//} - - -void JGameObject::SetBBox(float x, float y, float width, float height) -{ - mUseBoundingBox = true; - - mBBoxX = x; - mBBoxY = y; - mBBoxWidth = width; - mBBoxHeight = height; -} - -void JGameObject::GetBBox(float x, float y, float* xNow, float* yNow, float* width, float *height) -{ - *xNow = x + mBBoxX; - *yNow = y + mBBoxY; - *width = mBBoxWidth; - *height = mBBoxHeight; -} - - -bool JGameObject::Collide(JGameObject *target) -{ - if (mUseBoundingBox) - { - // bounding box collision detection - if ((target->mX+target->mBBoxX)-(mX+mBBoxX) < -target->mBBoxWidth) return false; - if ((target->mX+target->mBBoxX)-(mX+mBBoxX) > mBBoxWidth) return false; - if ((target->mY+target->mBBoxY)-(mY+mBBoxY) < -target->mBBoxHeight) return false; - if ((target->mY+target->mBBoxY)-(mY+mBBoxY) > mBBoxHeight) return false; - - } - else - { - // Circle-Circle collision detection - float dx = (mX+mCenterX)-(target->mX+target->mCenterX); - float dy = (mY+mCenterY)-(target->mY+target->mCenterY); - float dr = mRadius+target->mRadius; - if (dx*dx + dy*dy > dr*dr) - return false; - } - - //mCollided = true; - //mCollisionTarget = target; - SetCollisionTarget(target); - target->SetCollisionTarget(this); - - return true; // collision!!! -} - - -void JGameObject::SetCollisionTarget(JGameObject *target) -{ - mBlood -= target->GetHitPoint(); - if (mBlood < 0) - { -// mActive = false; - mBlood = 0; - } - - mCollided = true; - mCollisionTarget = target; -} - - - -int JGameObject::GetHitPoint() -{ - return mHitPoint; -} - - -void JGameObject::SetHitPoint(int pt) -{ - mHitPoint = pt; -} - - -void JGameObject::SetBlood(int pt) -{ - mOriginalBlood = pt; - mBlood = pt; -} - -int JGameObject::GetBlood() -{ - return mBlood; -} - - -void JGameObject::OnCollide() -{ - -} - - -void JGameObject::StartFlashing() -{ - mFlashing = true; - mFlashTimer = 0.0f; - mFlashCounter = 0; -} - - -void JGameObject::StopFlashing() -{ - mFlashing = false; -} - - -bool JGameObject::IsFlashing() -{ - return mFlashing; -} - -void JGameObject::SetRenderFlags(int flags) -{ - mRenderFlags = flags; -} - -// void JGameObject::SetSize(float size) -// { -// mSize = size; -// } -// -// -// void JGameObject::SetAngle(float angle) -// { -// mAngle = angle; -// } - -void JGameObject::EnableAlpha(bool flag, float delta) { mDoAlpha = flag; mAlphaDelta = delta; } -void JGameObject::EnableScaling(bool flag, float delta) { mDoScaling = flag; mScaleDelta = delta; } -void JGameObject::EnableRotation(bool flag, float delta) { mDoRotation = flag; mRotationDelta = delta; } - - - -void JGameObject::SetCollisionCircle(float cx, float cy, float radius) -{ - mUseBoundingBox = false; - - mCenterX = cx; - mCenterY = cy; - mRadius = radius; -} - -JGameObject *JGameObject::GetCollisionTarget() -{ - return mCollisionTarget; -} - -// void JGameObject::SetSize(float size) -// { -// mSize = size; -// //mHScale = size; -// //mVScale = size; -// } +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + + +#include "../include/JGE.h" +#include "../include/JApp.h" + +#include "../include/JGameObject.h" + + +//JRenderer* JGameObject::mRenderer = NULL; + + + +JGameObject::JGameObject(JTexture *tex, float x, float y, float width, float height) + :JSprite(tex, x, y, width, height) +{ + //mRenderer = JRenderer::GetInstance(); + + //mX = 0.0f; + //mY = 0.0f; + + mRenderFlags = 0; + //mSize = 1.0f; + //mAngle = 0.0f; + + mOriginalBlood = 1; + mBlood = 1; + mHitPoint = 1; + + mCollided = false; + mCollisionTarget = NULL; + mFlashing = false; + + //mActive = false; + + mRotationDelta = 0.0f; + mDoRotation = false; + + mAlphaDelta = 0.0f; + mDoAlpha = false; + + mDoScaling = false; + mScaleDelta = 0.0f; + + SetBBox(x, y, width, height); + +} + + +JGameObject::~JGameObject() +{ +// JGERelease(); +} + + +void JGameObject::Update(float dt) +{ + JSprite::Update(dt); + + if (mFlashing) + { + mFlashTimer += dt; + if (mFlashTimer > FLASH_TIME) + { + mFlashTimer = 0; + mFlashCounter++; + if (mFlashCounter > FLASHING_COUNT) + mFlashing = false; + } + } + + if (mDoAlpha) + { + mAlpha += mAlphaDelta*dt; + if (mAlpha < 0.0f) + { + mAlpha = 0.0f; + if (mAnimationType == ANIMATION_TYPE_ONCE_AND_GONE) + mActive = false; + } + else if (mAlpha > 255.0f) + { + mAlpha = 255.0f; + } + + } + + if (mDoRotation || mDoScaling) + { + mRotation += mRotationDelta*dt; + mHScale += mScaleDelta*dt; + mVScale += mScaleDelta*dt; + } + +} + + +void JGameObject::Render() +{ + /* + if (mQuad != NULL) + { + //mEngine->RenderQuad(mQuad, mX, mY); + if (mFlashing && (mFlashCounter&1)==0) + { + mRenderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE); + } + + float angle = 0.0f; + if ((mRenderFlags & RENDER_FLAG_ANGLE)==RENDER_FLAG_ANGLE) + angle = mAngle; + if ((mRenderFlags & RENDER_FLAG_ROTATION)==RENDER_FLAG_ROTATION) + angle = mRotation; + float scale = 1.0f; + if ((mRenderFlags & RENDER_FLAG_SIZE)==RENDER_FLAG_SIZE) + scale = mSize; + + mRenderer->RenderQuad(mQuad, mX, mY, angle, scale, scale); + + mRenderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); + } + */ + + if (!mActive) return; + + if ((mRenderFlags & RENDER_FLAG_ANGLE)==RENDER_FLAG_ANGLE) + mRotation = mDirection; + + if (mFlashing && (mFlashCounter&1)==0) + mRenderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE); + +// if ((mRenderFlags & RENDER_FLAG_SIZE)==RENDER_FLAG_SIZE) +// { +// mHScale = mSize; +// mVScale = mSize; +// } +// else +// { +// mHScale = 1.0f; +// mVScale = 1.0f; +// } + + JSprite::Render(); + + if (mFlashing) + mRenderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); + +} + + +// void JGameObject::SetPosition(float x, float y) +// { +// // mPos = Vector2D(x, y); +// mX = x; +// mY = y; +// } + + +//void JGameObject::SetQuad(JQuad *quad) { mQuad = quad; } + + + + +//void JParticle::ResetVelocity() +//{ +// float xx = mSpeed * cosf(mAngle); +// float yy = mSpeed * sinf(mAngle); +// mVelocity = Vector2D(xx, yy); +//} + + +void JGameObject::SetBBox(float x, float y, float width, float height) +{ + mUseBoundingBox = true; + + mBBoxX = x; + mBBoxY = y; + mBBoxWidth = width; + mBBoxHeight = height; +} + +void JGameObject::GetBBox(float x, float y, float* xNow, float* yNow, float* width, float *height) +{ + *xNow = x + mBBoxX; + *yNow = y + mBBoxY; + *width = mBBoxWidth; + *height = mBBoxHeight; +} + + +bool JGameObject::Collide(JGameObject *target) +{ + if (mUseBoundingBox) + { + // bounding box collision detection + if ((target->mX+target->mBBoxX)-(mX+mBBoxX) < -target->mBBoxWidth) return false; + if ((target->mX+target->mBBoxX)-(mX+mBBoxX) > mBBoxWidth) return false; + if ((target->mY+target->mBBoxY)-(mY+mBBoxY) < -target->mBBoxHeight) return false; + if ((target->mY+target->mBBoxY)-(mY+mBBoxY) > mBBoxHeight) return false; + + } + else + { + // Circle-Circle collision detection + float dx = (mX+mCenterX)-(target->mX+target->mCenterX); + float dy = (mY+mCenterY)-(target->mY+target->mCenterY); + float dr = mRadius+target->mRadius; + if (dx*dx + dy*dy > dr*dr) + return false; + } + + //mCollided = true; + //mCollisionTarget = target; + SetCollisionTarget(target); + target->SetCollisionTarget(this); + + return true; // collision!!! +} + + +void JGameObject::SetCollisionTarget(JGameObject *target) +{ + mBlood -= target->GetHitPoint(); + if (mBlood < 0) + { +// mActive = false; + mBlood = 0; + } + + mCollided = true; + mCollisionTarget = target; +} + + + +int JGameObject::GetHitPoint() +{ + return mHitPoint; +} + + +void JGameObject::SetHitPoint(int pt) +{ + mHitPoint = pt; +} + + +void JGameObject::SetBlood(int pt) +{ + mOriginalBlood = pt; + mBlood = pt; +} + +int JGameObject::GetBlood() +{ + return mBlood; +} + + +void JGameObject::OnCollide() +{ + +} + + +void JGameObject::StartFlashing() +{ + mFlashing = true; + mFlashTimer = 0.0f; + mFlashCounter = 0; +} + + +void JGameObject::StopFlashing() +{ + mFlashing = false; +} + + +bool JGameObject::IsFlashing() +{ + return mFlashing; +} + +void JGameObject::SetRenderFlags(int flags) +{ + mRenderFlags = flags; +} + +// void JGameObject::SetSize(float size) +// { +// mSize = size; +// } +// +// +// void JGameObject::SetAngle(float angle) +// { +// mAngle = angle; +// } + +void JGameObject::EnableAlpha(bool flag, float delta) { mDoAlpha = flag; mAlphaDelta = delta; } +void JGameObject::EnableScaling(bool flag, float delta) { mDoScaling = flag; mScaleDelta = delta; } +void JGameObject::EnableRotation(bool flag, float delta) { mDoRotation = flag; mRotationDelta = delta; } + + + +void JGameObject::SetCollisionCircle(float cx, float cy, float radius) +{ + mUseBoundingBox = false; + + mCenterX = cx; + mCenterY = cy; + mRadius = radius; +} + +JGameObject *JGameObject::GetCollisionTarget() +{ + return mCollisionTarget; +} + +// void JGameObject::SetSize(float size) +// { +// mSize = size; +// //mHScale = size; +// //mVScale = size; +// } diff --git a/JGE/src/JGfx.cpp b/JGE/src/JGfx.cpp index c173d7909..8297426db 100644 --- a/JGE/src/JGfx.cpp +++ b/JGE/src/JGfx.cpp @@ -1,2260 +1,2260 @@ -//------------------------------------------------------------------------------------- -// -// JGE is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "../include/vram.h" -#include "../include/JLogger.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#ifdef __cplusplus -} -#endif - -#include "../include/JGE.h" -#include "../include/JRenderer.h" -#include "../include/JFileSystem.h" - -static unsigned int __attribute__((aligned(16))) list[262144]; - - -extern void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width); - -void Swap(float *a, float *b) -{ - float n=*a; - *a = *b; - *b = n; -} - -JQuad::JQuad(JTexture *tex, float x, float y, float width, float height) - :mTex(tex), mX(x), mY(y), mWidth(width), mHeight(height) -{ - mHotSpotX = 0.0f; - mHotSpotY = 0.0f; - mBlend = DEFAULT_BLEND; //GU_TFX_MODULATE; - for (int i=0;i<4;i++) - mColor[i] = ARGB(255,255,255,255); - - mHFlipped = false; - mVFlipped = false; -} - - -void JQuad::GetTextureRect(float *x, float *y, float *w, float *h) -{ - *x=mX; *y=mY; *w=mWidth; *h=mHeight; -} - - -void JQuad::SetTextureRect(float x, float y, float w, float h) -{ - mX = x; mY = y; mWidth = w; mHeight = h; -} - - -void JQuad::SetColor(PIXEL_TYPE color) -{ - for (int i=0;i<4;i++) - mColor[i] = color; -} - - -void JQuad::SetHotSpot(float x, float y) -{ - mHotSpotX = x; - mHotSpotY = y; -} - -////////////////////////////////////////////////////////////////////////// - -JTexture::JTexture() -{ - mBits = NULL; - mInVideoRAM = false; - mTextureFormat = TEXTURE_FORMAT; -} - -JTexture::~JTexture() -{ - if (mBits) - { - if (mInVideoRAM) - vfree(mBits); - else - free(mBits); - } -} - - -void JTexture::UpdateBits(int x, int y, int width, int height, PIXEL_TYPE* bits) -{ - for (int i=0;iInitRenderer(); - } - - return mInstance; -} - - -void JRenderer::Destroy() -{ - if (mInstance) - { - mInstance->DestroyRenderer(); - delete mInstance; - mInstance = NULL; - } -} - -JRenderer::JRenderer() -{ -} - - -JRenderer::~JRenderer() -{ - -} - - -void JRenderer::InitRenderer() -{ - - mCurrentRenderMode = MODE_2D; - -#ifdef USING_MATH_TABLE - for (int i=0;i<360;i++) - { - mSinTable[i] = sinf(i*DEG2RAD); - mCosTable[i] = cosf(i*DEG2RAD); - } -#endif - - mCurrTexBlendSrc = BLEND_SRC_ALPHA; - mCurrTexBlendDest = BLEND_ONE_MINUS_SRC_ALPHA; - - mSwizzle = 1; - mVsync = false; - - mTexCounter = 0; - mCurrentTex = -1; - mCurrentBlend = -1; - mCurrentTextureFormat = TEXTURE_FORMAT; - - mFOV = 75.0f; - - mImageFilter = NULL; - - mCurrentTextureFilter = TEX_FILTER_LINEAR; - - sceGuInit(); - - fbp0 = ( u32* ) valloc ( FRAME_BUFFER_SIZE ) ; - fbp1 = ( u32* ) valloc ( FRAME_BUFFER_SIZE ); - zbp = NULL; - - // setup GU - sceGuStart(GU_DIRECT,list); - - sceGuDrawBuffer(BUFFER_FORMAT, vrelptr (fbp0), FRAME_BUFFER_WIDTH); - sceGuDispBuffer(SCREEN_WIDTH, SCREEN_HEIGHT, vrelptr (fbp1), FRAME_BUFFER_WIDTH); - if (m3DEnabled) - { - zbp = ( u16* ) valloc ( FRAME_BUFFER_WIDTH*SCREEN_HEIGHT*2); - sceGuDepthBuffer(vrelptr (zbp), FRAME_BUFFER_WIDTH); - } - - sceGuOffset(2048 - (SCREEN_WIDTH/2), 2048 - (SCREEN_HEIGHT/2)); - sceGuViewport(2048, 2048, SCREEN_WIDTH, SCREEN_HEIGHT); - sceGuScissor(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); - sceGuEnable(GU_SCISSOR_TEST); - //sceGuFrontFace(GU_CW); - sceGuFrontFace(GU_CCW); - sceGuEnable(GU_TEXTURE_2D); - - sceGuShadeModel(GU_SMOOTH); - - sceGuTexWrap(GU_REPEAT, GU_REPEAT); - - // enable alpha channel - sceGuEnable(GU_BLEND); - sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0); - - sceGuTexFilter(GU_LINEAR,GU_LINEAR); - - if (m3DEnabled) - { - - sceGuDepthRange(65535,0); - sceGuEnable(GU_DEPTH_TEST); - sceGuDepthFunc(GU_GEQUAL); - - sceGuEnable(GU_CULL_FACE); - sceGuEnable(GU_CLIP_PLANES); - - sceGuClearColor(0x00ff0000); - sceGuClearDepth(0); - - sceGuTexEnvColor(0xffffffff); - - sceGuTexScale(1.0f,1.0f); - sceGuTexOffset(0.0f,0.0f); - sceGuAmbientColor(0xffffffff); - - sceGumMatrixMode(GU_PROJECTION); - sceGumLoadIdentity(); - sceGumPerspective(mFOV,16.0f/9.0f,0.5f,1000.0f); - //sceGumPerspective(90.0f,480.0f/272.0f,0.5f,1000.0f); - - } - - //sceGuClear(GU_COLOR_BUFFER_BIT); - sceGuFinish(); - sceGuSync(0,0); - - sceDisplayWaitVblankStart(); - sceGuDisplay(1); - -} - -void JRenderer::SetTexBlend(int src, int dest) -{ - - if (src != mCurrTexBlendSrc || dest != mCurrTexBlendDest) - { - mCurrTexBlendSrc = src; - mCurrTexBlendDest = dest; - - int fixSrc = 0; - int fixDest = 0; - if (src == BLEND_ZERO) - src = GU_FIX; - else if (src == BLEND_ONE) - { - src = GU_FIX; - fixSrc = 0x00FFFFFF; - } - if (dest == BLEND_ZERO) - dest = GU_FIX; - else if (dest == BLEND_ONE) - { - dest = GU_FIX; - fixDest = 0x00FFFFFF; - } - - //glBlendFunc(src, dest); - sceGuBlendFunc(GU_ADD, src, dest, fixSrc, fixDest); - } -} - - -void JRenderer::EnableTextureFilter(bool flag) -{ - if (flag) - mCurrentTextureFilter = TEX_FILTER_LINEAR; - else - mCurrentTextureFilter = TEX_FILTER_NEAREST; -} - - -void JRenderer::DestroyRenderer() -{ - sceGuDisplay(GU_FALSE); - sceGuTerm(); - vfree(fbp0); - vfree(fbp1); - //debugged = 0; - if (zbp) vfree(zbp); -} - - -void JRenderer::BeginScene() -{ - sceGuStart(GU_DIRECT, list); - - if (m3DEnabled) - { - //if (mMode3D) - sceGuClear(GU_DEPTH_BUFFER_BIT|GU_COLOR_BUFFER_BIT); - } - - sceGuTexMode(TEXTURE_FORMAT, 0, 0, mSwizzle); - mCurrentTextureFormat = TEXTURE_FORMAT; - - if (mCurrentTextureFilter == TEX_FILTER_NEAREST) - sceGuTexFilter(GU_NEAREST, GU_NEAREST); // GU_NEAREST good for tile-map - else - sceGuTexFilter(GU_LINEAR, GU_LINEAR); // GU_LINEAR good for scaling - - //Keep this until we get rev 2489 (or better) of the SDK - //See http://code.google.com/p/wagic/issues/detail?id=92 - sceGuSendCommandi(210,BUFFER_FORMAT); -} - - -void JRenderer::EndScene() -{ - sceGuFinish(); - - sceGuSync(0,0); - - if (mVsync) - sceDisplayWaitVblankStart(); - - sceGuSwapBuffers(); - - mCurrentTex = -1; - mCurrentBlend = -1; -} - - -void JRenderer::EnableVSync(bool flag) -{ - mVsync = flag; -} - - -void JRenderer::ClearScreen(PIXEL_TYPE color) -{ - sceGuClearColor(color); - //sceGuClearStencil( 0 ); - sceGuClear(GU_COLOR_BUFFER_BIT); - //sceGuClear( GU_COLOR_BUFFER_BIT | GU_STENCIL_BUFFER_BIT ); -} - - -void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE color) -{ - struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(2 * sizeof(struct VertexColor)); - - vertices[0].color = color; - vertices[0].x = x; - vertices[0].y = y; - vertices[0].z = 0.0f; - - vertices[1].color = color; - vertices[1].x = x + width; - vertices[1].y = y + height; - vertices[1].z = 0.0f; - - sceGuDisable(GU_TEXTURE_2D); - sceGuShadeModel(GU_SMOOTH); - sceGuAmbientColor(0xffffffff); - sceGuDrawArray(GU_SPRITES, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices); - sceGuEnable(GU_TEXTURE_2D); - -} - - -void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE* colors) -{ - struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(4 * sizeof(struct VertexColor)); - - - vertices[0].color = colors[0]; - vertices[0].x = x; - vertices[0].y = y; - vertices[0].z = 0.0f; - - vertices[1].color = colors[1]; - vertices[1].x = x + width; - vertices[1].y = y; - vertices[1].z = 0.0f; - - vertices[2].color = colors[2]; - vertices[2].x = x; - vertices[2].y = y + height; - vertices[2].z = 0.0f; - - vertices[3].color = colors[3]; - vertices[3].x = x + width; - vertices[3].y = y + height; - vertices[3].z = 0.0f; - - sceGuDisable(GU_TEXTURE_2D); - sceGuShadeModel(GU_SMOOTH); - sceGuAmbientColor(0xffffffff); - sceGuDrawArray(GU_TRIANGLE_STRIP, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 4, 0, vertices); - sceGuEnable(GU_TEXTURE_2D); - -} - - -void JRenderer::DrawRect(float x, float y, float width, float height, PIXEL_TYPE color) -{ - struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(5 * sizeof(struct VertexColor)); - - vertices[0].color = color; - vertices[0].x = x; - vertices[0].y = y; - vertices[0].z = 0.0f; - - vertices[1].color = color; - vertices[1].x = x; - vertices[1].y = y + height; - vertices[1].z = 0.0f; - - vertices[2].color = color; - vertices[2].x = x + width; - vertices[2].y = y + height; - vertices[2].z = 0.0f; - - vertices[3].color = color; - vertices[3].x = x + width; - vertices[3].y = y; - vertices[3].z = 0.0f; - - vertices[4].color = color; - vertices[4].x = x; - vertices[4].y = y; - vertices[4].z = 0.0f; - - sceGuDisable(GU_TEXTURE_2D); - sceGuShadeModel(GU_SMOOTH); - sceGuAmbientColor(0xffffffff); - sceGuDrawArray(GU_LINE_STRIP, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 5, 0, vertices); - sceGuEnable(GU_TEXTURE_2D); - -} - - -void JRenderer::DrawLine(float x1, float y1, float x2, float y2, PIXEL_TYPE color) -{ - struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(2 * sizeof(struct VertexColor)); - - vertices[0].color = color; - vertices[0].x = x1; - vertices[0].y = y1; - vertices[0].z = 0.0f; - - vertices[1].color = color; - vertices[1].x = x2; - vertices[1].y = y2; - vertices[1].z = 0.0f; - - sceGuDisable(GU_TEXTURE_2D); - sceGuShadeModel(GU_SMOOTH); - sceGuAmbientColor(0xffffffff); - sceGuDrawArray(GU_LINES, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices); - sceGuEnable(GU_TEXTURE_2D); - -} - - -void JRenderer::Plot(float x, float y, PIXEL_TYPE color) -{ - struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(1 * sizeof(struct VertexColor)); - - vertices[0].color = color; - vertices[0].x = x; - vertices[0].y = y; - vertices[0].z = 0.0f; - - sceGuDisable(GU_TEXTURE_2D); - sceGuShadeModel(GU_SMOOTH); - sceGuAmbientColor(0xffffffff); - sceGuDrawArray(GU_POINTS, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 1, 0, vertices); - sceGuEnable(GU_TEXTURE_2D); - -} - - -void JRenderer::PlotArray(float *x, float *y, int count, PIXEL_TYPE color) -{ - struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(count * sizeof(struct VertexColor)); - - for (int i=0;imTex == NULL) - { - JLOG("JRenderer::RenderQuad:: invalid texture!"); - return; - } - - if (mCurrentTextureFormat != quad->mTex->mTextureFormat) - { - mCurrentTextureFormat = quad->mTex->mTextureFormat; - sceGuTexMode(mCurrentTextureFormat, 0, 0, mSwizzle); - } - - if (mCurrentTex != quad->mTex->mTexId) - { - sceGuTexImage(0, quad->mTex->mTexWidth, quad->mTex->mTexHeight, quad->mTex->mTexWidth, quad->mTex->mBits); - mCurrentTex = quad->mTex->mTexId; - } - - if (mCurrentBlend != quad->mBlend) - { - sceGuTexFunc(quad->mBlend, GU_TCC_RGBA); - mCurrentBlend = quad->mBlend; - } - - //float destWidth = quad->mWidth*quad->mScaleX; - float destHeight = quad->mHeight*yScale; - float x = xo - quad->mHotSpotX*xScale; - float y = yo - quad->mHotSpotY*yScale; - - float start, end; - - float width; - float destWidth; - float fixedWidth = SLICE_SIZE_F*xScale; - float xx, yy; - float cosAngle = cosf(angle); - float sinAngle = sinf(angle); - - if (quad->mHFlipped)// || quad->mVFlipped) - { - - for (end = quad->mX, start = quad->mX+quad->mWidth; start > end; start -= SLICE_SIZE_F) - { - // allocate memory on the current display list for temporary storage - // in order to rotate, we use 4 vertices this time - struct Vertex* vertices = (struct Vertex*)sceGuGetMemory(4 * sizeof(struct Vertex)); - if ((start - SLICE_SIZE_F) > end) - { - width = SLICE_SIZE_F; - destWidth = fixedWidth; - } - else - { - width = start-end; - destWidth = width*xScale; - } - - vertices[0].u = start; - vertices[0].v = quad->mY; - vertices[0].color = quad->mColor[0];//.color; - vertices[0].x = x; - vertices[0].y = y; - vertices[0].z = 0.0f; - - vertices[2].u = start - width; - vertices[2].v = quad->mY; - vertices[2].color = quad->mColor[2];//.color; - vertices[2].x = x + destWidth; - vertices[2].y = y; - vertices[2].z = 0.0f; - - vertices[1].u = start; - vertices[1].v = quad->mY + quad->mHeight; - vertices[1].color = quad->mColor[1];//.color; - vertices[1].x = x; - vertices[1].y = y + destHeight; - vertices[1].z = 0.0f; - - vertices[3].u = start - width; - vertices[3].v = quad->mY + quad->mHeight; - vertices[3].color = quad->mColor[3];//.color; - vertices[3].x = x + destWidth; - vertices[3].y = y + destHeight; - vertices[3].z = 0.0f; - - if (quad->mVFlipped) - { - Swap(&vertices[0].v, &vertices[2].v); - Swap(&vertices[1].v, &vertices[3].v); - } - - if (angle != 0.0f) - { - for (int i=0;i<4;i++) - { - xx = (cosAngle*(vertices[i].x-xo) - sinAngle*(vertices[i].y-yo) + xo); - yy = (sinAngle*(vertices[i].x-xo) + cosAngle*(vertices[i].y-yo) + yo); - vertices[i].x = xx; - vertices[i].y = yy; - } - } - - x += destWidth; - - sceGuDrawArray(GU_TRIANGLE_STRIP,GU_TEXTURE_32BITF|TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 4, 0, vertices); - } - } - else - { - for (start = quad->mX, end = quad->mX+quad->mWidth; start < end; start += SLICE_SIZE_F) - { - // allocate memory on the current display list for temporary storage - // in order to rotate, we use 4 vertices this time - struct Vertex* vertices = (struct Vertex*)sceGuGetMemory(4 * sizeof(struct Vertex)); - if ((start + SLICE_SIZE_F) < end) - { - width = SLICE_SIZE_F; - destWidth = fixedWidth; - } - else - { - width = end-start; - destWidth = width*xScale; - } - - vertices[0].u = start; - vertices[0].v = quad->mY; - vertices[0].color = quad->mColor[0];//.color; - vertices[0].x = x; - vertices[0].y = y; - vertices[0].z = 0.0f; - - vertices[2].u = start + width; - vertices[2].v = quad->mY; - vertices[2].color = quad->mColor[2];//.color; - vertices[2].x = x + destWidth; - vertices[2].y = y; - vertices[2].z = 0.0f; - - vertices[1].u = start; - vertices[1].v = quad->mY + quad->mHeight; - vertices[1].color = quad->mColor[1];//.color; - vertices[1].x = x; - vertices[1].y = y + destHeight; - vertices[1].z = 0.0f; - - vertices[3].u = start + width; - vertices[3].v = quad->mY + quad->mHeight; - vertices[3].color = quad->mColor[3];//.color; - vertices[3].x = x + destWidth; - vertices[3].y = y + destHeight; - vertices[3].z = 0.0f; - - if (quad->mVFlipped) - { - Swap(&vertices[0].v, &vertices[2].v); - Swap(&vertices[1].v, &vertices[3].v); - } - - if (angle != 0.0f) - { - for (int i=0;i<4;i++) - { - xx = (cosAngle*(vertices[i].x-xo) - sinAngle*(vertices[i].y-yo) + xo); - yy = (sinAngle*(vertices[i].x-xo) + cosAngle*(vertices[i].y-yo) + yo); - vertices[i].x = xx; - vertices[i].y = yy; - } - } - - x += destWidth; - - sceGuDrawArray(GU_TRIANGLE_STRIP,GU_TEXTURE_32BITF|TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 4, 0, vertices); - } - } -} - - -void JRenderer::RenderQuad(JQuad* quad, VertexColor* points) -{ - if (mCurrentTextureFormat != quad->mTex->mTextureFormat){ - mCurrentTextureFormat = quad->mTex->mTextureFormat; - sceGuTexMode(mCurrentTextureFormat, 0, 0, mSwizzle); - } - - if (mCurrentTex != quad->mTex->mTexId) - { - sceGuTexImage(0, quad->mTex->mTexWidth, quad->mTex->mTexHeight, quad->mTex->mTexWidth, quad->mTex->mBits); - mCurrentTex = quad->mTex->mTexId; - } - - if (mCurrentBlend != quad->mBlend) - { - sceGuTexFunc(quad->mBlend, GU_TCC_RGBA); - mCurrentBlend = quad->mBlend; - } - - - - // allocate memory on the current display list for temporary storage - // in order to rotate, we use 4 vertices this time - struct Vertex* vertices = (struct Vertex*)sceGuGetMemory(4 * sizeof(struct Vertex)); - - vertices[0].u = quad->mX; - vertices[0].v = quad->mY; - - vertices[1].u = quad->mX; - vertices[1].v = quad->mY + quad->mHeight; - - vertices[2].u = quad->mX + quad->mWidth; - vertices[2].v = quad->mY; - - vertices[3].u = quad->mX + quad->mWidth; - vertices[3].v = quad->mY + quad->mHeight; - - vertices[0].color = points[3].color; - vertices[0].x = points[3].x; - vertices[0].y = points[3].y; - vertices[0].z = points[3].z; - - vertices[1].color = points[0].color; - vertices[1].x = points[0].x; - vertices[1].y = points[0].y; - vertices[1].z = points[0].z; - - vertices[2].color = points[2].color; - vertices[2].x = points[2].x; - vertices[2].y = points[2].y; - vertices[2].z = points[2].z; - - vertices[3].color = points[1].color; - vertices[3].x = points[1].x; - vertices[3].y = points[1].y; - vertices[3].z = points[1].z; - - - sceGuDrawArray(GU_TRIANGLE_STRIP,GU_TEXTURE_32BITF|TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 4, 0, vertices); - - -} - -/* -** No-op on PSP. This is purely a PC openGL utility. -*/ -void JRenderer::TransferTextureToGLContext(JTexture& inTexture) -{ - -} - - -//------------------------------------------------------------------------------------------------ -// Taken from: -// http://svn.ps2dev.org/filedetails.php?repname=psp&path=/trunk/libpng/screenshot/main.c&rev=0&sc=0 -// Save current visible screen as PNG -//------------------------------------------------------------------------------------------------ -void JRenderer::ScreenShot(const char* filename) -{ - u32* vram32; - u16* vram16; - void* temp; - int bufferwidth; - int pixelformat; - int i, x, y; - png_structp png_ptr; - png_infop info_ptr; - FILE* fp; - u8* line; - - fp = fopen(filename, "wb"); - if (!fp) return; - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (!png_ptr) - { - fclose(fp); - return; - } - info_ptr = png_create_info_struct(png_ptr); - if (!info_ptr) { - png_destroy_write_struct(&png_ptr, (png_infopp)NULL); - fclose(fp); - return; - } - png_init_io(png_ptr, fp); - png_set_IHDR(png_ptr, info_ptr, SCREEN_WIDTH, SCREEN_HEIGHT, - 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, - PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); - png_write_info(png_ptr, info_ptr); - line = (u8*) malloc(SCREEN_WIDTH * 3); - sceDisplayWaitVblankStart(); // if framebuf was set with PSP_DISPLAY_SETBUF_NEXTFRAME, wait until it is changed - sceDisplayGetFrameBuf(&temp, &bufferwidth, &pixelformat, PSP_DISPLAY_SETBUF_NEXTFRAME); - //temp = (void*)(0x04000000+0x40000000); - vram32 = (u32*) temp; - vram16 = (u16*) vram32; - for (y = 0; y < SCREEN_HEIGHT; y++) { - for (i = 0, x = 0; x < SCREEN_WIDTH; x++) { - u32 color = 0; - u8 r = 0, g = 0, b = 0; - switch (pixelformat) { - case PSP_DISPLAY_PIXEL_FORMAT_565: - color = vram16[x + y * bufferwidth]; - r = (color & 0x1f) << 3; - g = ((color >> 5) & 0x3f) << 2 ; - b = ((color >> 11) & 0x1f) << 3 ; - break; - case PSP_DISPLAY_PIXEL_FORMAT_5551: - color = vram16[x + y * bufferwidth]; - r = (color & 0x1f) << 3; - g = ((color >> 5) & 0x1f) << 3 ; - b = ((color >> 10) & 0x1f) << 3 ; - break; - case PSP_DISPLAY_PIXEL_FORMAT_4444: - color = vram16[x + y * bufferwidth]; - r = (color & 0xf) << 4; - g = ((color >> 4) & 0xf) << 4 ; - b = ((color >> 8) & 0xf) << 4 ; - break; - case PSP_DISPLAY_PIXEL_FORMAT_8888: - color = vram32[x + y * bufferwidth]; - r = color & 0xff; - g = (color >> 8) & 0xff; - b = (color >> 16) & 0xff; - break; - } - line[i++] = r; - line[i++] = g; - line[i++] = b; - } - png_write_row(png_ptr, line); - } - free(line); - png_write_end(png_ptr, info_ptr); - png_destroy_write_struct(&png_ptr, (png_infopp)NULL); - fclose(fp); -} - - -static void PNGCustomWarningFn(png_structp png_ptr, png_const_charp warning_msg) -{ - JLOG("PNG error callback fired!"); - JLOG(warning_msg); -} - -static void PNGCustomReadDataFn(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_size_t check; - - JFileSystem *fileSystem = (JFileSystem*)png_ptr->io_ptr; - - check = fileSystem->ReadFile(data, length); - - if (check != length) - { - png_error(png_ptr, "Read Error!"); - } -} - - - -static int getNextPower2(int width) -{ - int b = width; - int n; - for (n = 0; b != 0; n++) b >>= 1; - b = 1 << n; - if (b == 2 * width) b >>= 1; - return b; -} - -/* -** Alternate swizzle function that can handle any number of lines (as opposed to swizzle_fast, which is -** hardcoded to do 8 at a time) -*/ -static void swizzle_lines(const u8* inSrc, u8* inDst, unsigned int inWidth, unsigned int inLines) -{ - unsigned int rowblocks = (inWidth * sizeof(u32) / 16); - for (unsigned int j = 0; j < inLines; ++j) - { - for (unsigned int i = 0; i < inWidth * sizeof(u32); ++i) - { - unsigned int blockx = i / 16; - unsigned int blocky = j / 8; - - unsigned int x = (i - blockx * 16); - unsigned int y = (j - blocky * 8); - unsigned int block_index = blockx + ((blocky) * rowblocks); - unsigned int block_address = block_index * 16 * 8; - - inDst[block_address + x + y * 16] = inSrc[i + j * inWidth * sizeof(u32)]; - } - } -} - - -typedef u32* u32_ptr; -static void swizzle_row(const u8* inSrc, u32_ptr& inDst, unsigned int inBlockWidth, unsigned int inPitch) -{ - for (unsigned int blockx = 0; blockx < inBlockWidth; ++blockx) - { - const u32* src = (u32*)inSrc; - for (unsigned int j = 0; j < 8; ++j) - { - *(inDst++) = *(src++); - *(inDst++) = *(src++); - *(inDst++) = *(src++); - *(inDst++) = *(src++); - src += inPitch; - } - inSrc += 16; - } -} - - -static void swizzle_fast(u8* out, const u8* in, unsigned int width, unsigned int height) -{ - unsigned int width_blocks = (width / 16); - unsigned int height_blocks = (height / 8); - - unsigned int src_pitch = (width-16)/4; - unsigned int src_row = width * 8; - - const u8* ysrc = in; - u32* dst = (u32*)out; - - for (unsigned int blocky = 0; blocky < height_blocks; ++blocky) - { - const u8* xsrc = ysrc; - swizzle_row(xsrc, dst, width_blocks, src_pitch); - ysrc += src_row; - } -} - - -static void jpg_null(j_decompress_ptr cinfo) -{ -} - -static boolean jpg_fill_input_buffer(j_decompress_ptr cinfo) -{ - return 1; -} - -static void jpg_skip_input_data(j_decompress_ptr cinfo, long num_bytes) -{ - - cinfo->src->next_input_byte += (size_t) num_bytes; - cinfo->src->bytes_in_buffer -= (size_t) num_bytes; - -} - -static void jpeg_mem_src(j_decompress_ptr cinfo, u8 *mem, int len) -{ - cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small)((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(struct jpeg_source_mgr)); - cinfo->src->init_source = jpg_null; - cinfo->src->fill_input_buffer = jpg_fill_input_buffer; - cinfo->src->skip_input_data = jpg_skip_input_data; - cinfo->src->resync_to_restart = jpeg_resync_to_restart; - cinfo->src->term_source = jpg_null; - cinfo->src->bytes_in_buffer = len; - cinfo->src->next_input_byte = mem; -} - - -int JRenderer::PixelSize(int textureMode){ - switch (textureMode) { - case GU_PSM_5650: - case GU_PSM_5551: - case GU_PSM_4444: - return 2; - case GU_PSM_8888: - return 4; - } - return PIXEL_SIZE; -} - -void JRenderer::LoadJPG(TextureInfo &textureInfo, const char *filename, int mode, int textureMode) -{ - JLOG("JRenderer::LoadJPG"); - textureInfo.mBits = NULL; - char filenamenew[4096]; - sprintf(filenamenew, JGE_GET_RES(filename).c_str()); - - bool useVideoRAM = (mode == TEX_TYPE_USE_VRAM); - - struct jpeg_decompress_struct cinfo; - struct jpeg_error_mgr jerr; - u8 *rawdata, *scanline, *p; - u16 *rgbadata16, *q16, *bits16; - u32 *rgbadata32, *q32, *bits32; - int rawsize, i; - int pixelSize = PixelSize(textureMode); - bits16 = NULL; - bits32 = NULL; - - JFileSystem* fileSystem = JFileSystem::GetInstance(); - if (!fileSystem->OpenFile(filename)) - { - return; - } - - rawsize = fileSystem->GetFileSize(); - - rawdata = new u8[rawsize]; - - if (!rawdata) - { - fileSystem->CloseFile(); - return; - } - - fileSystem->ReadFile(rawdata, rawsize); - fileSystem->CloseFile(); - - - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_decompress(&cinfo); - - jpeg_mem_src(&cinfo, rawdata, rawsize); - - - jpeg_read_header(&cinfo, true); - - jpeg_start_decompress(&cinfo); - - if(cinfo.output_components != 3 && cinfo.output_components != 4) - { - jpeg_destroy_decompress(&cinfo); - return; - } - - int tw = getNextPower2(cinfo.output_width); - int th = getNextPower2(cinfo.output_height); - - - bool videoRAMUsed = false; - - int size = tw * th * pixelSize; - - if (useVideoRAM) - { - - if (pixelSize == 2) - { - bits16 = (u16*)valloc(size); - } - else - { - bits32 = (u32*)valloc(size); - } - videoRAMUsed = true; - } - - //else - if (bits16 == NULL && bits32 == NULL) - { - videoRAMUsed = false; - if (pixelSize == 2) - { - bits16 = (u16*)memalign(16, size); - } - else - { - bits32 = (u32*)memalign(16, size); - } - } - - - rgbadata16 = bits16; - rgbadata32 = bits32; - if (mSwizzle) - { - if (rgbadata16) rgbadata16 = (u16*) memalign(16, size); - if (rgbadata32) rgbadata32 = (u32*) memalign(16, size); - if(!rgbadata16 && !rgbadata32) - { - jpeg_destroy_decompress(&cinfo); - if (videoRAMUsed) - { - if (bits16) vfree(bits16); - if (bits32) vfree(bits32); - } - else - { - if (bits16) free(bits16); - if (bits32) free(bits32); - } - return; - } - } - - scanline = (u8 *)malloc(cinfo.output_width * 3); - if(!scanline) - { - jpeg_destroy_decompress(&cinfo); - - if (videoRAMUsed) - { - if (bits16) vfree(bits16); - if (bits32) vfree(bits32); - } - else - { - if (bits16) free(bits16); - if (bits32) free(bits32); - } - if (mSwizzle) - { - if (rgbadata16) - free(rgbadata16); - if (rgbadata32) - free(rgbadata32); - } - return; - } - - u16 * currRow16 = rgbadata16; - u32 * currRow32 = rgbadata32; - u16 color16; - u32 color32; - while(cinfo.output_scanline < cinfo.output_height) - { - p = scanline; - jpeg_read_scanlines(&cinfo, &scanline, 1); - - q16 = currRow16; - q32 = currRow32; - for (i=0; i<(int)cinfo.output_width; ++i) - { - int a = 255; - int r = p[0]; - int g = p[1]; - int b = p[2]; - switch (textureMode) - { - case GU_PSM_5650: - color16 = (r >> 3) | ((g >> 2) << 5) | ((b >> 3) << 11); - *(q16) = color16; - break; - case GU_PSM_5551: - color16 = (r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10) | ((a >> 7) << 15); - *(q16) = color16; - break; - case GU_PSM_4444: - color16 = (r >> 4) | ((g >> 4) << 4) | ((b >> 4) << 8) | ((a >> 4) << 12); - *(q16) = color16; - break; - case GU_PSM_8888: - color32 = r | (g << 8) | (b << 16) | (a << 24); - *(q32) = color32; - break; - } - - p+=3; - if (q16) q16+=1; - if (q32) q32+=1; - } - if (currRow32) currRow32+= tw; - if (currRow16) currRow16+= tw; - } - - free(scanline); - - try - { - jpeg_finish_decompress(&cinfo); - } - catch(...) - {} - - if (mSwizzle) - { - if (rgbadata16){ - swizzle_fast((u8*)bits16, (const u8*)rgbadata16, tw*pixelSize, th/*cinfo.output_height*/); - free (rgbadata16); - } - if (rgbadata32){ - swizzle_fast((u8*)bits32, (const u8*)rgbadata32, tw*pixelSize, th/*cinfo.output_height*/); - free (rgbadata32); - } - } - - - - if (bits16) textureInfo.mBits = (u8 *)bits16; - else textureInfo.mBits = (u8 *)bits32; - textureInfo.mWidth = cinfo.output_width; - textureInfo.mHeight = cinfo.output_height; - textureInfo.mTexWidth = tw; - textureInfo.mTexHeight = th; - textureInfo.mVRAM =videoRAMUsed; - - jpeg_destroy_decompress(&cinfo); - delete [] rawdata; - JLOG("-- OK -- JRenderer::LoadJPG"); -} - - -JTexture* JRenderer::LoadTexture(const char* filename, int mode, int textureMode) -{ - JLOG("JRenderer::LoadTexture"); - TextureInfo textureInfo; - textureInfo.mVRAM = false; - textureInfo.mBits = NULL; - - int ret = 0; - - if (strstr(filename, ".jpg")!=NULL || strstr(filename, ".JPG")!=NULL) - LoadJPG(textureInfo, filename, mode, textureMode); - else if(strstr(filename, ".gif")!=NULL || strstr(filename, ".GIF")!=NULL) - { - textureMode = TEXTURE_FORMAT; //textureMode not supported in Gif yet - LoadGIF(textureInfo,filename, mode, textureMode); - } - else if(strstr(filename, ".png")!=NULL || strstr(filename, ".PNG")!=NULL) - { - textureMode = TEXTURE_FORMAT; //textureMode not supported in PNG yet - ret = LoadPNG(textureInfo, filename, mode, textureMode); - if (ret < 0) - { - char buf[512]; - sprintf(buf, "--LoadPNG sent error code: %i for file %s", ret, filename); - JLOG(buf); - } - } - - if (textureInfo.mBits == NULL) - return NULL; - - - bool done = false; - JTexture* tex = new JTexture(); - if (tex) - { - if (mImageFilter != NULL) - mImageFilter->ProcessImage((PIXEL_TYPE*)textureInfo.mBits, textureInfo.mWidth, textureInfo.mHeight); - - tex->mTexId = mTexCounter++; - tex->mTextureFormat = textureMode; - tex->mWidth = textureInfo.mWidth; - tex->mHeight = textureInfo.mHeight; - tex->mTexWidth = textureInfo.mTexWidth; - tex->mTexHeight = textureInfo.mTexHeight; - tex->mInVideoRAM = textureInfo.mVRAM; - tex->mBits = (PIXEL_TYPE *)textureInfo.mBits; - - done = true; - } - - if (!done) - { - SAFE_DELETE(tex); - } - - JLOG("-- OK -- JRenderer::LoadTexture"); - return tex; - -} - -/* -** Helper function for LoadPNG -*/ -void ReadPngLine( png_structp& png_ptr, u32_ptr& line, png_uint_32 width, int pixelformat, u16* p16, u32* p32 ) -{ - png_read_row(png_ptr, (u8*) line, png_bytep_NULL); - for (int x = 0; x < (int)width; ++x) - { - u32 color32 = line[x]; - u16 color16; - int a = (color32 >> 24) & 0xff; - int r = color32 & 0xff; - int g = (color32 >> 8) & 0xff; - int b = (color32 >> 16) & 0xff; - switch (pixelformat) { - case PSP_DISPLAY_PIXEL_FORMAT_565: - color16 = (r >> 3) | ((g >> 2) << 5) | ((b >> 3) << 11); - *(p16+x) = color16; - break; - case PSP_DISPLAY_PIXEL_FORMAT_5551: - color16 = (r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10) | ((a >> 7) << 15); - *(p16+x) = color16; - break; - case PSP_DISPLAY_PIXEL_FORMAT_4444: - color16 = (r >> 4) | ((g >> 4) << 4) | ((b >> 4) << 8) | ((a >> 4) << 12); - *(p16+x) = color16; - break; - case PSP_DISPLAY_PIXEL_FORMAT_8888: - color32 = r | (g << 8) | (b << 16) | (a << 24); - *(p32+x) = color32; - break; - } - } -} - - - -//------------------------------------------------------------------------------------------------ -// Based on: -// http://svn.ps2dev.org/filedetails.php?repname=psp&path=/trunk/libpng/screenshot/main.c&rev=0&sc=0 -// Load PNG as texture -//------------------------------------------------------------------------------------------------ -int JRenderer::LoadPNG(TextureInfo &textureInfo, const char* filename, int mode, int textureMode) -{ - //JLOG("JRenderer::LoadPNG: "); - //JLOG(filename); - textureInfo.mBits = NULL; - - bool useVideoRAM = (mode == TEX_TYPE_USE_VRAM); - int pixelformat = PIXEL_FORMAT; - - u32* p32; - u16* p16; - png_structp png_ptr; - png_infop info_ptr; - unsigned int sig_read = 0; - png_uint_32 width, height; - int bit_depth, color_type, interlace_type; - u32* line; - - JFileSystem* fileSystem = JFileSystem::GetInstance(); - if (!fileSystem->OpenFile(filename)) return JGE_ERR_CANT_OPEN_FILE; - - //JLOG("PNG opened - creating read struct"); - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (png_ptr == NULL) { - fileSystem->CloseFile(); - return JGE_ERR_PNG; - } - //JLOG("Setting error callback func"); - png_set_error_fn(png_ptr, (png_voidp) NULL, (png_error_ptr) NULL, PNGCustomWarningFn); - info_ptr = png_create_info_struct(png_ptr); - if (info_ptr == NULL) { - fileSystem->CloseFile(); - png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); - return JGE_ERR_PNG; - } - png_init_io(png_ptr, NULL); - png_set_read_fn(png_ptr, (png_voidp)fileSystem, PNGCustomReadDataFn); - - png_set_sig_bytes(png_ptr, sig_read); - png_read_info(png_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, int_p_NULL, int_p_NULL); - png_set_strip_16(png_ptr); - png_set_packing(png_ptr); - if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr); - if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr); - if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); - png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); - line = (u32*) malloc(width * 4); - if (!line) { - fileSystem->CloseFile(); - png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); - return JGE_ERR_MALLOC_FAILED; - } - - int texWidth = getNextPower2(width); - int texHeight = getNextPower2(height); - - bool done = false; - PIXEL_TYPE* bits = NULL; - bool videoRAMUsed = false; - int size = texWidth * texHeight * sizeof(PIXEL_TYPE); - - { - if (useVideoRAM) - { - bits = (PIXEL_TYPE*) valloc(size); - videoRAMUsed = true; - } - - if (bits == NULL) - { - videoRAMUsed = false; - bits = (PIXEL_TYPE*) memalign(16, size); - } - - PIXEL_TYPE* buffer = bits; - const unsigned int kVerticalBlockSize = 8; - if (mSwizzle) - { - //JLOG("allocating swizzle buffer"); - buffer = (PIXEL_TYPE*) memalign(16, texWidth * kVerticalBlockSize * sizeof(PIXEL_TYPE)); - if (!buffer) - { - JLOG("failed to allocate destination swizzle buffer!"); - std::ostringstream stream; - stream << "Alloc failed for: Tex Width: " << texWidth << " Tex Height: " << kVerticalBlockSize << ", total bytes: " << texWidth * kVerticalBlockSize * sizeof(PIXEL_TYPE); - JLOG(stream.str().c_str()); - fileSystem->CloseFile(); - png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); - return JGE_ERR_MALLOC_FAILED; - } - } - - if (buffer) - { - unsigned int src_row = texWidth * 8; - u32* dst = (u32*)bits; - u32* ysrc = (u32*) buffer; - unsigned int totalVerticalBlocksToProcess = height / kVerticalBlockSize; - - p32 = (u32*) buffer; - p16 = (u16*) p32; - for (unsigned int block = 0; block < totalVerticalBlocksToProcess; ++block) - { - for (unsigned int y = 0; y < kVerticalBlockSize; ++y) - { - ReadPngLine(png_ptr, line, width, pixelformat, p16, p32); - - p32 += texWidth; - p16 += texWidth; - } - - if (mSwizzle) - { - swizzle_fast((u8*) dst, (const u8*) buffer, texWidth * sizeof(PIXEL_TYPE), kVerticalBlockSize); - dst += src_row; - - // if we're swizzling, reset the read pointers to the top of the buffer, as we re-read into an 8 line - // block of memory (if we're not swizzling, we're reading directly into the destination, so we - // want to continue iterating through) - p32 = (u32*) buffer; - p16 = (u16*) p32; - } - } - - //now the last remaining lines (ie if the height wasn't evenly divisible by 8) - { - if (mSwizzle) - { - //clear the conversion buffer so that leftover scan lines are transparent - memset(buffer, 255, texWidth * kVerticalBlockSize * sizeof(PIXEL_TYPE)); - } - unsigned int remainingLines = height % kVerticalBlockSize; - for (unsigned int y = 0; y < remainingLines; ++y) - { - ReadPngLine(png_ptr, line, width, pixelformat, p16, p32); - - p32 += texWidth; - p16 += texWidth; - } - - if (mSwizzle) - { - // swizzle_fast only can handle eight lines at a time, and will overrun memory in our destination, - // which only has remainingLines to fill - use the swizzle_lines function instead - swizzle_lines((const u8*) buffer, (u8*) dst, texWidth, remainingLines); - } - } - - free(buffer); - done = true; - } - } - - //JLOG("Freeing line"); - free (line); - //JLOG("Reading end"); - png_read_end(png_ptr, info_ptr); - //JLOG("Destroying read struct"); - png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); - - //JLOG("Closing PNG"); - fileSystem->CloseFile(); - - if (done) - { - textureInfo.mBits = (u8 *)bits; - textureInfo.mWidth = width; - textureInfo.mHeight = height; - textureInfo.mTexWidth = texWidth; - textureInfo.mTexHeight = texHeight; - textureInfo.mVRAM = videoRAMUsed; - JLOG("-- OK -- JRenderer::LoadPNG"); - return 1; - - } - else - { - JLOG("LoadPNG failure - deallocating bits"); - textureInfo.mBits = NULL; - - if (videoRAMUsed) - vfree(bits); - else - free(bits); - return JGE_ERR_GENERIC; - } - -} - - - - -////////////////////////////////////////////////////////////////////////// -/// GIF Support -int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bgcolor, InputFunc readFunc,int mode, int textureMode) -{ - bool useVideoRAM = (mode == TEX_TYPE_USE_VRAM); - // pixel ** image_data=NULL; - DWORD *p32=NULL; - //#define gif_color(c) RGB(palette->Colors[c].Red, palette->Colors[c].Green, palette->Colors[c].Blue) -#define gif_color32(c) ARGB(255,palette->Colors[c].Red,palette->Colors[c].Green, palette->Colors[c].Blue) - GifRecordType RecordType; - GifByteType *Extension; - GifRowType LineIn = NULL; - GifFileType *GifFileIn = NULL; - ColorMapObject *palette; - int ExtCode; - int i, j; - if ((GifFileIn = DGifOpen(handle, readFunc)) == NULL) - return 1; - *bgcolor = 0; - textureInfo.mWidth = 0; - textureInfo.mHeight = 0; - //*image_data = NULL; - bool videoRAMUsed = false; - int size = 0; - - do { - if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR) - { - DGifCloseFile(GifFileIn); - return 1; - } - - switch (RecordType) { - case IMAGE_DESC_RECORD_TYPE: - { - if (DGifGetImageDesc(GifFileIn) == GIF_ERROR) - { - DGifCloseFile(GifFileIn); - return 1; - } - if((palette = (GifFileIn->SColorMap != NULL) ? GifFileIn->SColorMap : GifFileIn->Image.ColorMap) == NULL) - { - DGifCloseFile(GifFileIn); - return 1; - } - textureInfo.mWidth = GifFileIn->Image.Width; - textureInfo.mHeight = GifFileIn->Image.Height; - *bgcolor = gif_color32(GifFileIn->SBackGroundColor); - if((LineIn = (GifRowType) malloc(GifFileIn->Image.Width * sizeof(GifPixelType))) == NULL) - { - DGifCloseFile(GifFileIn); - return 1; - } - - //--------------------------------------- - textureInfo.mTexWidth = getNextPower2(GifFileIn->Image.Width); - textureInfo.mTexHeight = getNextPower2(GifFileIn->Image.Height); - - bool done = false; - PIXEL_TYPE* bits = NULL; - - size = textureInfo.mTexWidth * textureInfo.mTexHeight * sizeof(PIXEL_TYPE); - - if (useVideoRAM)// && (mCurrentPointer+size)<0x200000) - { - //bits = (PIXEL_TYPE*) (0x04000000+0x40000000+mCurrentPointer); - //mCurrentPointer += size; - - bits = (PIXEL_TYPE*) valloc(size); - videoRAMUsed = true; - } - //else - - if (bits == NULL) - { - videoRAMUsed = false; - bits = (PIXEL_TYPE*) memalign(16, size); - } - - PIXEL_TYPE* buffer = bits; - - if (mSwizzle) - buffer = (PIXEL_TYPE*) memalign(16, textureInfo.mTexWidth * textureInfo.mTexHeight * sizeof(PIXEL_TYPE)); - - if (buffer) - { - p32 = (DWORD*) buffer; - } - - //if((*image_data = (pixel *)malloc(sizeof(pixel) * GifFileIn->Image.Width * GifFileIn->Image.Height)) == NULL) - if(p32 == NULL) - { - free((void *)LineIn); - DGifCloseFile(GifFileIn); - return 1; - } - - DWORD * curr = p32; - DWORD * imgdata = p32; - for (i = 0; i < GifFileIn->Image.Height; i ++) - { - imgdata = curr; - if (DGifGetLine(GifFileIn, LineIn, GifFileIn->Image.Width) == GIF_ERROR) - { - if (videoRAMUsed) - vfree(bits); - else - free(bits); - - if (mSwizzle) - free((void *)p32); - free((void *)LineIn); - DGifCloseFile(GifFileIn); - return 1; - } - for(j = 0; j < GifFileIn->Image.Width; j ++) - { - DWORD color32 = gif_color32(LineIn[j]); - - - *imgdata++ = color32; - } - - curr += textureInfo.mTexWidth; - } - - if (mSwizzle) - { - swizzle_fast((u8*)bits, (const u8*)buffer, textureInfo.mTexWidth*sizeof(PIXEL_TYPE), textureInfo.mTexHeight/*GifFileIn->Image.Height*/); - free (buffer); - } - - done = true; - - textureInfo.mBits = (u8 *)bits; - textureInfo.mVRAM = videoRAMUsed; - break; - } - case EXTENSION_RECORD_TYPE: - if (DGifGetExtension(GifFileIn, &ExtCode, &Extension) == GIF_ERROR) - { - if(textureInfo.mBits != NULL) - { - if (videoRAMUsed) - vfree(textureInfo.mBits); - else - free((void *)textureInfo.mBits); - textureInfo.mBits = NULL; - } - if(LineIn != NULL) - free((void *)LineIn); - DGifCloseFile(GifFileIn); - return 1; - } - while (Extension != NULL) { - if (DGifGetExtensionNext(GifFileIn, &Extension) == GIF_ERROR) - { - if(textureInfo.mBits != NULL) - { - if (videoRAMUsed) - vfree(textureInfo.mBits); - else - free((void *)textureInfo.mBits); - textureInfo.mBits = NULL; - } - if(LineIn != NULL) - free((void *)LineIn); - DGifCloseFile(GifFileIn); - return 1; - } - } - break; - case TERMINATE_RECORD_TYPE: - break; - default: - break; - } - } - while (RecordType != TERMINATE_RECORD_TYPE); - - if(LineIn != NULL) - free((void *)LineIn); - DGifCloseFile(GifFileIn); - - return 0; -} - -int image_gif_read(GifFileType * ft, GifByteType * buf, int size) -{ - - JFileSystem *fileSys = (JFileSystem *)ft->UserData; - if (fileSys->ReadFile(buf, size)) - return size; - else - return 0; - -} - -void JRenderer::LoadGIF(TextureInfo &textureInfo, const char *filename, int mode, int textureMode) -{ - textureInfo.mBits = NULL; - - - JFileSystem *fileSys = JFileSystem::GetInstance(); - if (!fileSys->OpenFile(filename)) - return; - - DWORD bkcol; - int result = image_readgif(fileSys, textureInfo, &bkcol, image_gif_read, mode); - - if(result!=0) - textureInfo.mBits=NULL; - fileSys->CloseFile(); - - return ; -} - - - -JTexture* JRenderer::CreateTexture(int width, int height, int mode) -{ - bool useVideoRAM = (mode == TEX_TYPE_USE_VRAM); - - JTexture* tex = new JTexture(); - if (tex) - { - tex->mWidth = width; - tex->mHeight = height; - - - tex->mTexWidth = getNextPower2(width); - tex->mTexHeight = getNextPower2(height); - - int size = tex->mTexWidth * tex->mTexHeight * sizeof(PIXEL_TYPE); - if (useVideoRAM) - { - tex->mInVideoRAM = true; - tex->mBits = (PIXEL_TYPE*) valloc(size); - } - - //else - if (tex->mBits == NULL) - { - tex->mInVideoRAM = false; - tex->mBits = (PIXEL_TYPE*) memalign(16, size); - } - - memset(tex->mBits, 0, size); - - tex->mTexId = mTexCounter++; - } - - return tex; -} - - -void JRenderer::BindTexture(JTexture *tex) -{ - if (mCurrentTex != tex->mTexId) - { - sceGuTexImage(0, tex->mTexWidth, tex->mTexHeight, tex->mTexWidth, tex->mBits); - mCurrentTex = tex->mTexId; - - if (m3DEnabled) - { - if (mCurrentRenderMode == MODE_3D) - { - sceKernelDcacheWritebackAll(); - sceGuTexFunc(GU_TFX_ADD,GU_TCC_RGB); - } - } - } - -} - - -////////////////////////////////////////////////////////////////////////// -void JRenderer::Enable2D() -{ - - mCurrentRenderMode = MODE_2D; - - sceGuDisable(GU_DEPTH_TEST); - -} - - -////////////////////////////////////////////////////////////////////////// -void JRenderer::Enable3D() -{ - mCurrentRenderMode = MODE_3D; - - mCurrentBlend = -1; - - sceGuEnable(GU_DEPTH_TEST); - - LoadIdentity(); -} - - -////////////////////////////////////////////////////////////////////////// -void JRenderer::SetClip(int x, int y, int width, int height) -{ - sceGuScissor(x, y, width, height); -} - - -void JRenderer::LoadIdentity() -{ - sceGumMatrixMode(GU_VIEW); - sceGumLoadIdentity(); - - sceGumMatrixMode(GU_MODEL); - sceGumLoadIdentity(); -} - - -void JRenderer::Translate(float x, float y, float z) -{ - ScePspFVector3 pos = { x, y, z }; - sceGumTranslate(&pos); -} - - -void JRenderer::RotateX(float angle) -{ - sceGumRotateX(angle); -} - - -void JRenderer::RotateY(float angle) -{ - sceGumRotateY(angle); -} - - -void JRenderer::RotateZ(float angle) -{ - sceGumRotateZ(angle); -} - - -void JRenderer::PushMatrix() -{ - sceGumPushMatrix(); -} - - -void JRenderer::PopMatrix() -{ - sceGumPopMatrix(); -} - -void JRenderer::RenderTriangles(JTexture* texture, Vertex3D *tris, int start, int count) -{ - if (texture) - BindTexture(texture); - - PSPVertex3D* vertices = (PSPVertex3D*) sceGuGetMemory(count * 3 * sizeof(PSPVertex3D)); - - int n = 0; - int index = start*3; - for (int i = 0; i < count; i++) - { - vertices[n].texture.x = tris[index].u; - vertices[n].texture.y = tris[index].v; - - vertices[n].pos.x = tris[index].x; - vertices[n].pos.y = tris[index].y; - vertices[n].pos.z = tris[index].z; - - - index++; - n++; - - vertices[n].texture.x = tris[index].u; - vertices[n].texture.y = tris[index].v; - - vertices[n].pos.x = tris[index].x; - vertices[n].pos.y = tris[index].y; - vertices[n].pos.z = tris[index].z; - - - index++; - n++; - - vertices[n].texture.x = tris[index].u; - vertices[n].texture.y = tris[index].v; - - vertices[n].pos.x = tris[index].x; - vertices[n].pos.y = tris[index].y; - vertices[n].pos.z = tris[index].z; - - - index++; - n++; - - } - - sceGuColor(0xff000000); - sceGumDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_3D,count*3,0,vertices); - -} - -void JRenderer::SetFOV(float fov) -{ - mFOV = fov; - - sceGumMatrixMode(GU_PROJECTION); - sceGumLoadIdentity(); - sceGumPerspective(mFOV,16.0f/9.0f,0.5f,1000.0f); -} - -void JRenderer::FillPolygon(float* x, float* y, int count, PIXEL_TYPE color) -{ - struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(count * sizeof(struct VertexColor)); - - for(int i=0; i y2-y1) - { - q=(float)sqrt(radius*radius - (i-(y2-y1))*(i-(y2-y1))); - nextq=(float)sqrt(radius*radius - (i+1-(y2-y1))*(i+1-(y2-y1))); - } - if (nextq == q) nextq = q+1; - if (i==-radius || i == y2-y1+radius-1){ - DrawLine(x1+(radius-q),y1+i+radius,x2+q+radius,y1+i+radius,color); - }else{ - DrawLine(x1+(radius-q),y1+i+radius,x1+(radius-nextq),y1+i+radius,color); - DrawLine(x2+radius+q,y1+i+radius,x2+radius+nextq,y1+i+radius,color); - } - } -} - - -void JRenderer::FillRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color) -{ - x+=w+radius; - y+=radius; - - struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(182 * sizeof(struct VertexColor)); - - vertices[0].color = color; - vertices[0].x = x; - vertices[0].y = y; - vertices[0].z = 0.0f; - - int angle = 359; - for(int i=0; i<45; i++) - { - vertices[i+1].color = color; - vertices[i+1].x = x+radius*COSF(angle); - vertices[i+1].y = y+radius*SINF(angle); - vertices[i+1].z = 0.0f; - angle -= 2; - if (angle < 0) - angle = 0; - } - - x-=w; - - for(int i=45; i<90; i++) - { - vertices[i+1].color = color; - vertices[i+1].x = x+radius*COSF(angle); - vertices[i+1].y = y+radius*SINF(angle); - vertices[i+1].z = 0.0f; - angle -= 2; - if (angle < 0) - angle = 0; - } - - y+=h; - for(int i=90; i<135; i++) - { - vertices[i+1].color = color; - vertices[i+1].x = x+radius*COSF(angle); - vertices[i+1].y = y+radius*SINF(angle); - vertices[i+1].z = 0.0f; - angle -= 2; - if (angle < 0) - angle = 0; - } - - x+=w; - for(int i=135; i<180; i++) - { - vertices[i+1].color = color; - vertices[i+1].x = x+radius*COSF(angle); - vertices[i+1].y = y+radius*SINF(angle); - vertices[i+1].z = 0.0f; - angle -= 2; - if (angle < 0) - angle = 0; - } - - y-=h; - vertices[181].color = color; - vertices[181].x = x+radius*COSF(359); - vertices[181].y = y+radius*SINF(359); - vertices[181].z = 0.0f; - - sceGuDisable(GU_TEXTURE_2D); - sceGuShadeModel(GU_SMOOTH); - sceGuAmbientColor(0xffffffff); - sceGuDrawArray(GU_TRIANGLE_FAN, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 182, 0, vertices); - sceGuEnable(GU_TEXTURE_2D); -} - - -void JRenderer::SetImageFilter(JImageFilter* imageFilter) -{ - mImageFilter = imageFilter; +//------------------------------------------------------------------------------------- +// +// JGE is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../include/vram.h" +#include "../include/JLogger.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifdef __cplusplus +} +#endif + +#include "../include/JGE.h" +#include "../include/JRenderer.h" +#include "../include/JFileSystem.h" + +static unsigned int __attribute__((aligned(16))) list[262144]; + + +extern void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width); + +void Swap(float *a, float *b) +{ + float n=*a; + *a = *b; + *b = n; +} + +JQuad::JQuad(JTexture *tex, float x, float y, float width, float height) + :mTex(tex), mX(x), mY(y), mWidth(width), mHeight(height) +{ + mHotSpotX = 0.0f; + mHotSpotY = 0.0f; + mBlend = DEFAULT_BLEND; //GU_TFX_MODULATE; + for (int i=0;i<4;i++) + mColor[i] = ARGB(255,255,255,255); + + mHFlipped = false; + mVFlipped = false; +} + + +void JQuad::GetTextureRect(float *x, float *y, float *w, float *h) +{ + *x=mX; *y=mY; *w=mWidth; *h=mHeight; +} + + +void JQuad::SetTextureRect(float x, float y, float w, float h) +{ + mX = x; mY = y; mWidth = w; mHeight = h; +} + + +void JQuad::SetColor(PIXEL_TYPE color) +{ + for (int i=0;i<4;i++) + mColor[i] = color; +} + + +void JQuad::SetHotSpot(float x, float y) +{ + mHotSpotX = x; + mHotSpotY = y; +} + +////////////////////////////////////////////////////////////////////////// + +JTexture::JTexture() +{ + mBits = NULL; + mInVideoRAM = false; + mTextureFormat = TEXTURE_FORMAT; +} + +JTexture::~JTexture() +{ + if (mBits) + { + if (mInVideoRAM) + vfree(mBits); + else + free(mBits); + } +} + + +void JTexture::UpdateBits(int x, int y, int width, int height, PIXEL_TYPE* bits) +{ + for (int i=0;iInitRenderer(); + } + + return mInstance; +} + + +void JRenderer::Destroy() +{ + if (mInstance) + { + mInstance->DestroyRenderer(); + delete mInstance; + mInstance = NULL; + } +} + +JRenderer::JRenderer() +{ +} + + +JRenderer::~JRenderer() +{ + +} + + +void JRenderer::InitRenderer() +{ + + mCurrentRenderMode = MODE_2D; + +#ifdef USING_MATH_TABLE + for (int i=0;i<360;i++) + { + mSinTable[i] = sinf(i*DEG2RAD); + mCosTable[i] = cosf(i*DEG2RAD); + } +#endif + + mCurrTexBlendSrc = BLEND_SRC_ALPHA; + mCurrTexBlendDest = BLEND_ONE_MINUS_SRC_ALPHA; + + mSwizzle = 1; + mVsync = false; + + mTexCounter = 0; + mCurrentTex = -1; + mCurrentBlend = -1; + mCurrentTextureFormat = TEXTURE_FORMAT; + + mFOV = 75.0f; + + mImageFilter = NULL; + + mCurrentTextureFilter = TEX_FILTER_LINEAR; + + sceGuInit(); + + fbp0 = ( u32* ) valloc ( FRAME_BUFFER_SIZE ) ; + fbp1 = ( u32* ) valloc ( FRAME_BUFFER_SIZE ); + zbp = NULL; + + // setup GU + sceGuStart(GU_DIRECT,list); + + sceGuDrawBuffer(BUFFER_FORMAT, vrelptr (fbp0), FRAME_BUFFER_WIDTH); + sceGuDispBuffer(SCREEN_WIDTH, SCREEN_HEIGHT, vrelptr (fbp1), FRAME_BUFFER_WIDTH); + if (m3DEnabled) + { + zbp = ( u16* ) valloc ( FRAME_BUFFER_WIDTH*SCREEN_HEIGHT*2); + sceGuDepthBuffer(vrelptr (zbp), FRAME_BUFFER_WIDTH); + } + + sceGuOffset(2048 - (SCREEN_WIDTH/2), 2048 - (SCREEN_HEIGHT/2)); + sceGuViewport(2048, 2048, SCREEN_WIDTH, SCREEN_HEIGHT); + sceGuScissor(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); + sceGuEnable(GU_SCISSOR_TEST); + //sceGuFrontFace(GU_CW); + sceGuFrontFace(GU_CCW); + sceGuEnable(GU_TEXTURE_2D); + + sceGuShadeModel(GU_SMOOTH); + + sceGuTexWrap(GU_REPEAT, GU_REPEAT); + + // enable alpha channel + sceGuEnable(GU_BLEND); + sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0); + + sceGuTexFilter(GU_LINEAR,GU_LINEAR); + + if (m3DEnabled) + { + + sceGuDepthRange(65535,0); + sceGuEnable(GU_DEPTH_TEST); + sceGuDepthFunc(GU_GEQUAL); + + sceGuEnable(GU_CULL_FACE); + sceGuEnable(GU_CLIP_PLANES); + + sceGuClearColor(0x00ff0000); + sceGuClearDepth(0); + + sceGuTexEnvColor(0xffffffff); + + sceGuTexScale(1.0f,1.0f); + sceGuTexOffset(0.0f,0.0f); + sceGuAmbientColor(0xffffffff); + + sceGumMatrixMode(GU_PROJECTION); + sceGumLoadIdentity(); + sceGumPerspective(mFOV,16.0f/9.0f,0.5f,1000.0f); + //sceGumPerspective(90.0f,480.0f/272.0f,0.5f,1000.0f); + + } + + //sceGuClear(GU_COLOR_BUFFER_BIT); + sceGuFinish(); + sceGuSync(0,0); + + sceDisplayWaitVblankStart(); + sceGuDisplay(1); + +} + +void JRenderer::SetTexBlend(int src, int dest) +{ + + if (src != mCurrTexBlendSrc || dest != mCurrTexBlendDest) + { + mCurrTexBlendSrc = src; + mCurrTexBlendDest = dest; + + int fixSrc = 0; + int fixDest = 0; + if (src == BLEND_ZERO) + src = GU_FIX; + else if (src == BLEND_ONE) + { + src = GU_FIX; + fixSrc = 0x00FFFFFF; + } + if (dest == BLEND_ZERO) + dest = GU_FIX; + else if (dest == BLEND_ONE) + { + dest = GU_FIX; + fixDest = 0x00FFFFFF; + } + + //glBlendFunc(src, dest); + sceGuBlendFunc(GU_ADD, src, dest, fixSrc, fixDest); + } +} + + +void JRenderer::EnableTextureFilter(bool flag) +{ + if (flag) + mCurrentTextureFilter = TEX_FILTER_LINEAR; + else + mCurrentTextureFilter = TEX_FILTER_NEAREST; +} + + +void JRenderer::DestroyRenderer() +{ + sceGuDisplay(GU_FALSE); + sceGuTerm(); + vfree(fbp0); + vfree(fbp1); + //debugged = 0; + if (zbp) vfree(zbp); +} + + +void JRenderer::BeginScene() +{ + sceGuStart(GU_DIRECT, list); + + if (m3DEnabled) + { + //if (mMode3D) + sceGuClear(GU_DEPTH_BUFFER_BIT|GU_COLOR_BUFFER_BIT); + } + + sceGuTexMode(TEXTURE_FORMAT, 0, 0, mSwizzle); + mCurrentTextureFormat = TEXTURE_FORMAT; + + if (mCurrentTextureFilter == TEX_FILTER_NEAREST) + sceGuTexFilter(GU_NEAREST, GU_NEAREST); // GU_NEAREST good for tile-map + else + sceGuTexFilter(GU_LINEAR, GU_LINEAR); // GU_LINEAR good for scaling + + //Keep this until we get rev 2489 (or better) of the SDK + //See http://code.google.com/p/wagic/issues/detail?id=92 + sceGuSendCommandi(210,BUFFER_FORMAT); +} + + +void JRenderer::EndScene() +{ + sceGuFinish(); + + sceGuSync(0,0); + + if (mVsync) + sceDisplayWaitVblankStart(); + + sceGuSwapBuffers(); + + mCurrentTex = -1; + mCurrentBlend = -1; +} + + +void JRenderer::EnableVSync(bool flag) +{ + mVsync = flag; +} + + +void JRenderer::ClearScreen(PIXEL_TYPE color) +{ + sceGuClearColor(color); + //sceGuClearStencil( 0 ); + sceGuClear(GU_COLOR_BUFFER_BIT); + //sceGuClear( GU_COLOR_BUFFER_BIT | GU_STENCIL_BUFFER_BIT ); +} + + +void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE color) +{ + struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(2 * sizeof(struct VertexColor)); + + vertices[0].color = color; + vertices[0].x = x; + vertices[0].y = y; + vertices[0].z = 0.0f; + + vertices[1].color = color; + vertices[1].x = x + width; + vertices[1].y = y + height; + vertices[1].z = 0.0f; + + sceGuDisable(GU_TEXTURE_2D); + sceGuShadeModel(GU_SMOOTH); + sceGuAmbientColor(0xffffffff); + sceGuDrawArray(GU_SPRITES, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices); + sceGuEnable(GU_TEXTURE_2D); + +} + + +void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE* colors) +{ + struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(4 * sizeof(struct VertexColor)); + + + vertices[0].color = colors[0]; + vertices[0].x = x; + vertices[0].y = y; + vertices[0].z = 0.0f; + + vertices[1].color = colors[1]; + vertices[1].x = x + width; + vertices[1].y = y; + vertices[1].z = 0.0f; + + vertices[2].color = colors[2]; + vertices[2].x = x; + vertices[2].y = y + height; + vertices[2].z = 0.0f; + + vertices[3].color = colors[3]; + vertices[3].x = x + width; + vertices[3].y = y + height; + vertices[3].z = 0.0f; + + sceGuDisable(GU_TEXTURE_2D); + sceGuShadeModel(GU_SMOOTH); + sceGuAmbientColor(0xffffffff); + sceGuDrawArray(GU_TRIANGLE_STRIP, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 4, 0, vertices); + sceGuEnable(GU_TEXTURE_2D); + +} + + +void JRenderer::DrawRect(float x, float y, float width, float height, PIXEL_TYPE color) +{ + struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(5 * sizeof(struct VertexColor)); + + vertices[0].color = color; + vertices[0].x = x; + vertices[0].y = y; + vertices[0].z = 0.0f; + + vertices[1].color = color; + vertices[1].x = x; + vertices[1].y = y + height; + vertices[1].z = 0.0f; + + vertices[2].color = color; + vertices[2].x = x + width; + vertices[2].y = y + height; + vertices[2].z = 0.0f; + + vertices[3].color = color; + vertices[3].x = x + width; + vertices[3].y = y; + vertices[3].z = 0.0f; + + vertices[4].color = color; + vertices[4].x = x; + vertices[4].y = y; + vertices[4].z = 0.0f; + + sceGuDisable(GU_TEXTURE_2D); + sceGuShadeModel(GU_SMOOTH); + sceGuAmbientColor(0xffffffff); + sceGuDrawArray(GU_LINE_STRIP, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 5, 0, vertices); + sceGuEnable(GU_TEXTURE_2D); + +} + + +void JRenderer::DrawLine(float x1, float y1, float x2, float y2, PIXEL_TYPE color) +{ + struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(2 * sizeof(struct VertexColor)); + + vertices[0].color = color; + vertices[0].x = x1; + vertices[0].y = y1; + vertices[0].z = 0.0f; + + vertices[1].color = color; + vertices[1].x = x2; + vertices[1].y = y2; + vertices[1].z = 0.0f; + + sceGuDisable(GU_TEXTURE_2D); + sceGuShadeModel(GU_SMOOTH); + sceGuAmbientColor(0xffffffff); + sceGuDrawArray(GU_LINES, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices); + sceGuEnable(GU_TEXTURE_2D); + +} + + +void JRenderer::Plot(float x, float y, PIXEL_TYPE color) +{ + struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(1 * sizeof(struct VertexColor)); + + vertices[0].color = color; + vertices[0].x = x; + vertices[0].y = y; + vertices[0].z = 0.0f; + + sceGuDisable(GU_TEXTURE_2D); + sceGuShadeModel(GU_SMOOTH); + sceGuAmbientColor(0xffffffff); + sceGuDrawArray(GU_POINTS, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 1, 0, vertices); + sceGuEnable(GU_TEXTURE_2D); + +} + + +void JRenderer::PlotArray(float *x, float *y, int count, PIXEL_TYPE color) +{ + struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(count * sizeof(struct VertexColor)); + + for (int i=0;imTex == NULL) + { + JLOG("JRenderer::RenderQuad:: invalid texture!"); + return; + } + + if (mCurrentTextureFormat != quad->mTex->mTextureFormat) + { + mCurrentTextureFormat = quad->mTex->mTextureFormat; + sceGuTexMode(mCurrentTextureFormat, 0, 0, mSwizzle); + } + + if (mCurrentTex != quad->mTex->mTexId) + { + sceGuTexImage(0, quad->mTex->mTexWidth, quad->mTex->mTexHeight, quad->mTex->mTexWidth, quad->mTex->mBits); + mCurrentTex = quad->mTex->mTexId; + } + + if (mCurrentBlend != quad->mBlend) + { + sceGuTexFunc(quad->mBlend, GU_TCC_RGBA); + mCurrentBlend = quad->mBlend; + } + + //float destWidth = quad->mWidth*quad->mScaleX; + float destHeight = quad->mHeight*yScale; + float x = xo - quad->mHotSpotX*xScale; + float y = yo - quad->mHotSpotY*yScale; + + float start, end; + + float width; + float destWidth; + float fixedWidth = SLICE_SIZE_F*xScale; + float xx, yy; + float cosAngle = cosf(angle); + float sinAngle = sinf(angle); + + if (quad->mHFlipped)// || quad->mVFlipped) + { + + for (end = quad->mX, start = quad->mX+quad->mWidth; start > end; start -= SLICE_SIZE_F) + { + // allocate memory on the current display list for temporary storage + // in order to rotate, we use 4 vertices this time + struct Vertex* vertices = (struct Vertex*)sceGuGetMemory(4 * sizeof(struct Vertex)); + if ((start - SLICE_SIZE_F) > end) + { + width = SLICE_SIZE_F; + destWidth = fixedWidth; + } + else + { + width = start-end; + destWidth = width*xScale; + } + + vertices[0].u = start; + vertices[0].v = quad->mY; + vertices[0].color = quad->mColor[0];//.color; + vertices[0].x = x; + vertices[0].y = y; + vertices[0].z = 0.0f; + + vertices[2].u = start - width; + vertices[2].v = quad->mY; + vertices[2].color = quad->mColor[2];//.color; + vertices[2].x = x + destWidth; + vertices[2].y = y; + vertices[2].z = 0.0f; + + vertices[1].u = start; + vertices[1].v = quad->mY + quad->mHeight; + vertices[1].color = quad->mColor[1];//.color; + vertices[1].x = x; + vertices[1].y = y + destHeight; + vertices[1].z = 0.0f; + + vertices[3].u = start - width; + vertices[3].v = quad->mY + quad->mHeight; + vertices[3].color = quad->mColor[3];//.color; + vertices[3].x = x + destWidth; + vertices[3].y = y + destHeight; + vertices[3].z = 0.0f; + + if (quad->mVFlipped) + { + Swap(&vertices[0].v, &vertices[2].v); + Swap(&vertices[1].v, &vertices[3].v); + } + + if (angle != 0.0f) + { + for (int i=0;i<4;i++) + { + xx = (cosAngle*(vertices[i].x-xo) - sinAngle*(vertices[i].y-yo) + xo); + yy = (sinAngle*(vertices[i].x-xo) + cosAngle*(vertices[i].y-yo) + yo); + vertices[i].x = xx; + vertices[i].y = yy; + } + } + + x += destWidth; + + sceGuDrawArray(GU_TRIANGLE_STRIP,GU_TEXTURE_32BITF|TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 4, 0, vertices); + } + } + else + { + for (start = quad->mX, end = quad->mX+quad->mWidth; start < end; start += SLICE_SIZE_F) + { + // allocate memory on the current display list for temporary storage + // in order to rotate, we use 4 vertices this time + struct Vertex* vertices = (struct Vertex*)sceGuGetMemory(4 * sizeof(struct Vertex)); + if ((start + SLICE_SIZE_F) < end) + { + width = SLICE_SIZE_F; + destWidth = fixedWidth; + } + else + { + width = end-start; + destWidth = width*xScale; + } + + vertices[0].u = start; + vertices[0].v = quad->mY; + vertices[0].color = quad->mColor[0];//.color; + vertices[0].x = x; + vertices[0].y = y; + vertices[0].z = 0.0f; + + vertices[2].u = start + width; + vertices[2].v = quad->mY; + vertices[2].color = quad->mColor[2];//.color; + vertices[2].x = x + destWidth; + vertices[2].y = y; + vertices[2].z = 0.0f; + + vertices[1].u = start; + vertices[1].v = quad->mY + quad->mHeight; + vertices[1].color = quad->mColor[1];//.color; + vertices[1].x = x; + vertices[1].y = y + destHeight; + vertices[1].z = 0.0f; + + vertices[3].u = start + width; + vertices[3].v = quad->mY + quad->mHeight; + vertices[3].color = quad->mColor[3];//.color; + vertices[3].x = x + destWidth; + vertices[3].y = y + destHeight; + vertices[3].z = 0.0f; + + if (quad->mVFlipped) + { + Swap(&vertices[0].v, &vertices[2].v); + Swap(&vertices[1].v, &vertices[3].v); + } + + if (angle != 0.0f) + { + for (int i=0;i<4;i++) + { + xx = (cosAngle*(vertices[i].x-xo) - sinAngle*(vertices[i].y-yo) + xo); + yy = (sinAngle*(vertices[i].x-xo) + cosAngle*(vertices[i].y-yo) + yo); + vertices[i].x = xx; + vertices[i].y = yy; + } + } + + x += destWidth; + + sceGuDrawArray(GU_TRIANGLE_STRIP,GU_TEXTURE_32BITF|TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 4, 0, vertices); + } + } +} + + +void JRenderer::RenderQuad(JQuad* quad, VertexColor* points) +{ + if (mCurrentTextureFormat != quad->mTex->mTextureFormat){ + mCurrentTextureFormat = quad->mTex->mTextureFormat; + sceGuTexMode(mCurrentTextureFormat, 0, 0, mSwizzle); + } + + if (mCurrentTex != quad->mTex->mTexId) + { + sceGuTexImage(0, quad->mTex->mTexWidth, quad->mTex->mTexHeight, quad->mTex->mTexWidth, quad->mTex->mBits); + mCurrentTex = quad->mTex->mTexId; + } + + if (mCurrentBlend != quad->mBlend) + { + sceGuTexFunc(quad->mBlend, GU_TCC_RGBA); + mCurrentBlend = quad->mBlend; + } + + + + // allocate memory on the current display list for temporary storage + // in order to rotate, we use 4 vertices this time + struct Vertex* vertices = (struct Vertex*)sceGuGetMemory(4 * sizeof(struct Vertex)); + + vertices[0].u = quad->mX; + vertices[0].v = quad->mY; + + vertices[1].u = quad->mX; + vertices[1].v = quad->mY + quad->mHeight; + + vertices[2].u = quad->mX + quad->mWidth; + vertices[2].v = quad->mY; + + vertices[3].u = quad->mX + quad->mWidth; + vertices[3].v = quad->mY + quad->mHeight; + + vertices[0].color = points[3].color; + vertices[0].x = points[3].x; + vertices[0].y = points[3].y; + vertices[0].z = points[3].z; + + vertices[1].color = points[0].color; + vertices[1].x = points[0].x; + vertices[1].y = points[0].y; + vertices[1].z = points[0].z; + + vertices[2].color = points[2].color; + vertices[2].x = points[2].x; + vertices[2].y = points[2].y; + vertices[2].z = points[2].z; + + vertices[3].color = points[1].color; + vertices[3].x = points[1].x; + vertices[3].y = points[1].y; + vertices[3].z = points[1].z; + + + sceGuDrawArray(GU_TRIANGLE_STRIP,GU_TEXTURE_32BITF|TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 4, 0, vertices); + + +} + +/* +** No-op on PSP. This is purely a PC openGL utility. +*/ +void JRenderer::TransferTextureToGLContext(JTexture& inTexture) +{ + +} + + +//------------------------------------------------------------------------------------------------ +// Taken from: +// http://svn.ps2dev.org/filedetails.php?repname=psp&path=/trunk/libpng/screenshot/main.c&rev=0&sc=0 +// Save current visible screen as PNG +//------------------------------------------------------------------------------------------------ +void JRenderer::ScreenShot(const char* filename) +{ + u32* vram32; + u16* vram16; + void* temp; + int bufferwidth; + int pixelformat; + int i, x, y; + png_structp png_ptr; + png_infop info_ptr; + FILE* fp; + u8* line; + + fp = fopen(filename, "wb"); + if (!fp) return; + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (!png_ptr) + { + fclose(fp); + return; + } + info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) { + png_destroy_write_struct(&png_ptr, (png_infopp)NULL); + fclose(fp); + return; + } + png_init_io(png_ptr, fp); + png_set_IHDR(png_ptr, info_ptr, SCREEN_WIDTH, SCREEN_HEIGHT, + 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + png_write_info(png_ptr, info_ptr); + line = (u8*) malloc(SCREEN_WIDTH * 3); + sceDisplayWaitVblankStart(); // if framebuf was set with PSP_DISPLAY_SETBUF_NEXTFRAME, wait until it is changed + sceDisplayGetFrameBuf(&temp, &bufferwidth, &pixelformat, PSP_DISPLAY_SETBUF_NEXTFRAME); + //temp = (void*)(0x04000000+0x40000000); + vram32 = (u32*) temp; + vram16 = (u16*) vram32; + for (y = 0; y < SCREEN_HEIGHT; y++) { + for (i = 0, x = 0; x < SCREEN_WIDTH; x++) { + u32 color = 0; + u8 r = 0, g = 0, b = 0; + switch (pixelformat) { + case PSP_DISPLAY_PIXEL_FORMAT_565: + color = vram16[x + y * bufferwidth]; + r = (color & 0x1f) << 3; + g = ((color >> 5) & 0x3f) << 2 ; + b = ((color >> 11) & 0x1f) << 3 ; + break; + case PSP_DISPLAY_PIXEL_FORMAT_5551: + color = vram16[x + y * bufferwidth]; + r = (color & 0x1f) << 3; + g = ((color >> 5) & 0x1f) << 3 ; + b = ((color >> 10) & 0x1f) << 3 ; + break; + case PSP_DISPLAY_PIXEL_FORMAT_4444: + color = vram16[x + y * bufferwidth]; + r = (color & 0xf) << 4; + g = ((color >> 4) & 0xf) << 4 ; + b = ((color >> 8) & 0xf) << 4 ; + break; + case PSP_DISPLAY_PIXEL_FORMAT_8888: + color = vram32[x + y * bufferwidth]; + r = color & 0xff; + g = (color >> 8) & 0xff; + b = (color >> 16) & 0xff; + break; + } + line[i++] = r; + line[i++] = g; + line[i++] = b; + } + png_write_row(png_ptr, line); + } + free(line); + png_write_end(png_ptr, info_ptr); + png_destroy_write_struct(&png_ptr, (png_infopp)NULL); + fclose(fp); +} + + +static void PNGCustomWarningFn(png_structp png_ptr, png_const_charp warning_msg) +{ + JLOG("PNG error callback fired!"); + JLOG(warning_msg); +} + +static void PNGCustomReadDataFn(png_structp png_ptr, png_bytep data, png_size_t length) +{ + png_size_t check; + + JFileSystem *fileSystem = (JFileSystem*)png_ptr->io_ptr; + + check = fileSystem->ReadFile(data, length); + + if (check != length) + { + png_error(png_ptr, "Read Error!"); + } +} + + + +static int getNextPower2(int width) +{ + int b = width; + int n; + for (n = 0; b != 0; n++) b >>= 1; + b = 1 << n; + if (b == 2 * width) b >>= 1; + return b; +} + +/* +** Alternate swizzle function that can handle any number of lines (as opposed to swizzle_fast, which is +** hardcoded to do 8 at a time) +*/ +static void swizzle_lines(const u8* inSrc, u8* inDst, unsigned int inWidth, unsigned int inLines) +{ + unsigned int rowblocks = (inWidth * sizeof(u32) / 16); + for (unsigned int j = 0; j < inLines; ++j) + { + for (unsigned int i = 0; i < inWidth * sizeof(u32); ++i) + { + unsigned int blockx = i / 16; + unsigned int blocky = j / 8; + + unsigned int x = (i - blockx * 16); + unsigned int y = (j - blocky * 8); + unsigned int block_index = blockx + ((blocky) * rowblocks); + unsigned int block_address = block_index * 16 * 8; + + inDst[block_address + x + y * 16] = inSrc[i + j * inWidth * sizeof(u32)]; + } + } +} + + +typedef u32* u32_ptr; +static void swizzle_row(const u8* inSrc, u32_ptr& inDst, unsigned int inBlockWidth, unsigned int inPitch) +{ + for (unsigned int blockx = 0; blockx < inBlockWidth; ++blockx) + { + const u32* src = (u32*)inSrc; + for (unsigned int j = 0; j < 8; ++j) + { + *(inDst++) = *(src++); + *(inDst++) = *(src++); + *(inDst++) = *(src++); + *(inDst++) = *(src++); + src += inPitch; + } + inSrc += 16; + } +} + + +static void swizzle_fast(u8* out, const u8* in, unsigned int width, unsigned int height) +{ + unsigned int width_blocks = (width / 16); + unsigned int height_blocks = (height / 8); + + unsigned int src_pitch = (width-16)/4; + unsigned int src_row = width * 8; + + const u8* ysrc = in; + u32* dst = (u32*)out; + + for (unsigned int blocky = 0; blocky < height_blocks; ++blocky) + { + const u8* xsrc = ysrc; + swizzle_row(xsrc, dst, width_blocks, src_pitch); + ysrc += src_row; + } +} + + +static void jpg_null(j_decompress_ptr cinfo) +{ +} + +static boolean jpg_fill_input_buffer(j_decompress_ptr cinfo) +{ + return 1; +} + +static void jpg_skip_input_data(j_decompress_ptr cinfo, long num_bytes) +{ + + cinfo->src->next_input_byte += (size_t) num_bytes; + cinfo->src->bytes_in_buffer -= (size_t) num_bytes; + +} + +static void jpeg_mem_src(j_decompress_ptr cinfo, u8 *mem, int len) +{ + cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small)((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(struct jpeg_source_mgr)); + cinfo->src->init_source = jpg_null; + cinfo->src->fill_input_buffer = jpg_fill_input_buffer; + cinfo->src->skip_input_data = jpg_skip_input_data; + cinfo->src->resync_to_restart = jpeg_resync_to_restart; + cinfo->src->term_source = jpg_null; + cinfo->src->bytes_in_buffer = len; + cinfo->src->next_input_byte = mem; +} + + +int JRenderer::PixelSize(int textureMode){ + switch (textureMode) { + case GU_PSM_5650: + case GU_PSM_5551: + case GU_PSM_4444: + return 2; + case GU_PSM_8888: + return 4; + } + return PIXEL_SIZE; +} + +void JRenderer::LoadJPG(TextureInfo &textureInfo, const char *filename, int mode, int textureMode) +{ + JLOG("JRenderer::LoadJPG"); + textureInfo.mBits = NULL; + char filenamenew[4096]; + sprintf(filenamenew, JGE_GET_RES(filename).c_str()); + + bool useVideoRAM = (mode == TEX_TYPE_USE_VRAM); + + struct jpeg_decompress_struct cinfo; + struct jpeg_error_mgr jerr; + u8 *rawdata, *scanline, *p; + u16 *rgbadata16, *q16, *bits16; + u32 *rgbadata32, *q32, *bits32; + int rawsize, i; + int pixelSize = PixelSize(textureMode); + bits16 = NULL; + bits32 = NULL; + + JFileSystem* fileSystem = JFileSystem::GetInstance(); + if (!fileSystem->OpenFile(filename)) + { + return; + } + + rawsize = fileSystem->GetFileSize(); + + rawdata = new u8[rawsize]; + + if (!rawdata) + { + fileSystem->CloseFile(); + return; + } + + fileSystem->ReadFile(rawdata, rawsize); + fileSystem->CloseFile(); + + + cinfo.err = jpeg_std_error(&jerr); + jpeg_create_decompress(&cinfo); + + jpeg_mem_src(&cinfo, rawdata, rawsize); + + + jpeg_read_header(&cinfo, true); + + jpeg_start_decompress(&cinfo); + + if(cinfo.output_components != 3 && cinfo.output_components != 4) + { + jpeg_destroy_decompress(&cinfo); + return; + } + + int tw = getNextPower2(cinfo.output_width); + int th = getNextPower2(cinfo.output_height); + + + bool videoRAMUsed = false; + + int size = tw * th * pixelSize; + + if (useVideoRAM) + { + + if (pixelSize == 2) + { + bits16 = (u16*)valloc(size); + } + else + { + bits32 = (u32*)valloc(size); + } + videoRAMUsed = true; + } + + //else + if (bits16 == NULL && bits32 == NULL) + { + videoRAMUsed = false; + if (pixelSize == 2) + { + bits16 = (u16*)memalign(16, size); + } + else + { + bits32 = (u32*)memalign(16, size); + } + } + + + rgbadata16 = bits16; + rgbadata32 = bits32; + if (mSwizzle) + { + if (rgbadata16) rgbadata16 = (u16*) memalign(16, size); + if (rgbadata32) rgbadata32 = (u32*) memalign(16, size); + if(!rgbadata16 && !rgbadata32) + { + jpeg_destroy_decompress(&cinfo); + if (videoRAMUsed) + { + if (bits16) vfree(bits16); + if (bits32) vfree(bits32); + } + else + { + if (bits16) free(bits16); + if (bits32) free(bits32); + } + return; + } + } + + scanline = (u8 *)malloc(cinfo.output_width * 3); + if(!scanline) + { + jpeg_destroy_decompress(&cinfo); + + if (videoRAMUsed) + { + if (bits16) vfree(bits16); + if (bits32) vfree(bits32); + } + else + { + if (bits16) free(bits16); + if (bits32) free(bits32); + } + if (mSwizzle) + { + if (rgbadata16) + free(rgbadata16); + if (rgbadata32) + free(rgbadata32); + } + return; + } + + u16 * currRow16 = rgbadata16; + u32 * currRow32 = rgbadata32; + u16 color16; + u32 color32; + while(cinfo.output_scanline < cinfo.output_height) + { + p = scanline; + jpeg_read_scanlines(&cinfo, &scanline, 1); + + q16 = currRow16; + q32 = currRow32; + for (i=0; i<(int)cinfo.output_width; ++i) + { + int a = 255; + int r = p[0]; + int g = p[1]; + int b = p[2]; + switch (textureMode) + { + case GU_PSM_5650: + color16 = (r >> 3) | ((g >> 2) << 5) | ((b >> 3) << 11); + *(q16) = color16; + break; + case GU_PSM_5551: + color16 = (r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10) | ((a >> 7) << 15); + *(q16) = color16; + break; + case GU_PSM_4444: + color16 = (r >> 4) | ((g >> 4) << 4) | ((b >> 4) << 8) | ((a >> 4) << 12); + *(q16) = color16; + break; + case GU_PSM_8888: + color32 = r | (g << 8) | (b << 16) | (a << 24); + *(q32) = color32; + break; + } + + p+=3; + if (q16) q16+=1; + if (q32) q32+=1; + } + if (currRow32) currRow32+= tw; + if (currRow16) currRow16+= tw; + } + + free(scanline); + + try + { + jpeg_finish_decompress(&cinfo); + } + catch(...) + {} + + if (mSwizzle) + { + if (rgbadata16){ + swizzle_fast((u8*)bits16, (const u8*)rgbadata16, tw*pixelSize, th/*cinfo.output_height*/); + free (rgbadata16); + } + if (rgbadata32){ + swizzle_fast((u8*)bits32, (const u8*)rgbadata32, tw*pixelSize, th/*cinfo.output_height*/); + free (rgbadata32); + } + } + + + + if (bits16) textureInfo.mBits = (u8 *)bits16; + else textureInfo.mBits = (u8 *)bits32; + textureInfo.mWidth = cinfo.output_width; + textureInfo.mHeight = cinfo.output_height; + textureInfo.mTexWidth = tw; + textureInfo.mTexHeight = th; + textureInfo.mVRAM =videoRAMUsed; + + jpeg_destroy_decompress(&cinfo); + delete [] rawdata; + JLOG("-- OK -- JRenderer::LoadJPG"); +} + + +JTexture* JRenderer::LoadTexture(const char* filename, int mode, int textureMode) +{ + JLOG("JRenderer::LoadTexture"); + TextureInfo textureInfo; + textureInfo.mVRAM = false; + textureInfo.mBits = NULL; + + int ret = 0; + + if (strstr(filename, ".jpg")!=NULL || strstr(filename, ".JPG")!=NULL) + LoadJPG(textureInfo, filename, mode, textureMode); + else if(strstr(filename, ".gif")!=NULL || strstr(filename, ".GIF")!=NULL) + { + textureMode = TEXTURE_FORMAT; //textureMode not supported in Gif yet + LoadGIF(textureInfo,filename, mode, textureMode); + } + else if(strstr(filename, ".png")!=NULL || strstr(filename, ".PNG")!=NULL) + { + textureMode = TEXTURE_FORMAT; //textureMode not supported in PNG yet + ret = LoadPNG(textureInfo, filename, mode, textureMode); + if (ret < 0) + { + char buf[512]; + sprintf(buf, "--LoadPNG sent error code: %i for file %s", ret, filename); + JLOG(buf); + } + } + + if (textureInfo.mBits == NULL) + return NULL; + + + bool done = false; + JTexture* tex = new JTexture(); + if (tex) + { + if (mImageFilter != NULL) + mImageFilter->ProcessImage((PIXEL_TYPE*)textureInfo.mBits, textureInfo.mWidth, textureInfo.mHeight); + + tex->mTexId = mTexCounter++; + tex->mTextureFormat = textureMode; + tex->mWidth = textureInfo.mWidth; + tex->mHeight = textureInfo.mHeight; + tex->mTexWidth = textureInfo.mTexWidth; + tex->mTexHeight = textureInfo.mTexHeight; + tex->mInVideoRAM = textureInfo.mVRAM; + tex->mBits = (PIXEL_TYPE *)textureInfo.mBits; + + done = true; + } + + if (!done) + { + SAFE_DELETE(tex); + } + + JLOG("-- OK -- JRenderer::LoadTexture"); + return tex; + +} + +/* +** Helper function for LoadPNG +*/ +void ReadPngLine( png_structp& png_ptr, u32_ptr& line, png_uint_32 width, int pixelformat, u16* p16, u32* p32 ) +{ + png_read_row(png_ptr, (u8*) line, png_bytep_NULL); + for (int x = 0; x < (int)width; ++x) + { + u32 color32 = line[x]; + u16 color16; + int a = (color32 >> 24) & 0xff; + int r = color32 & 0xff; + int g = (color32 >> 8) & 0xff; + int b = (color32 >> 16) & 0xff; + switch (pixelformat) { + case PSP_DISPLAY_PIXEL_FORMAT_565: + color16 = (r >> 3) | ((g >> 2) << 5) | ((b >> 3) << 11); + *(p16+x) = color16; + break; + case PSP_DISPLAY_PIXEL_FORMAT_5551: + color16 = (r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10) | ((a >> 7) << 15); + *(p16+x) = color16; + break; + case PSP_DISPLAY_PIXEL_FORMAT_4444: + color16 = (r >> 4) | ((g >> 4) << 4) | ((b >> 4) << 8) | ((a >> 4) << 12); + *(p16+x) = color16; + break; + case PSP_DISPLAY_PIXEL_FORMAT_8888: + color32 = r | (g << 8) | (b << 16) | (a << 24); + *(p32+x) = color32; + break; + } + } +} + + + +//------------------------------------------------------------------------------------------------ +// Based on: +// http://svn.ps2dev.org/filedetails.php?repname=psp&path=/trunk/libpng/screenshot/main.c&rev=0&sc=0 +// Load PNG as texture +//------------------------------------------------------------------------------------------------ +int JRenderer::LoadPNG(TextureInfo &textureInfo, const char* filename, int mode, int textureMode) +{ + //JLOG("JRenderer::LoadPNG: "); + //JLOG(filename); + textureInfo.mBits = NULL; + + bool useVideoRAM = (mode == TEX_TYPE_USE_VRAM); + int pixelformat = PIXEL_FORMAT; + + u32* p32; + u16* p16; + png_structp png_ptr; + png_infop info_ptr; + unsigned int sig_read = 0; + png_uint_32 width, height; + int bit_depth, color_type, interlace_type; + u32* line; + + JFileSystem* fileSystem = JFileSystem::GetInstance(); + if (!fileSystem->OpenFile(filename)) return JGE_ERR_CANT_OPEN_FILE; + + //JLOG("PNG opened - creating read struct"); + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (png_ptr == NULL) { + fileSystem->CloseFile(); + return JGE_ERR_PNG; + } + //JLOG("Setting error callback func"); + png_set_error_fn(png_ptr, (png_voidp) NULL, (png_error_ptr) NULL, PNGCustomWarningFn); + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) { + fileSystem->CloseFile(); + png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); + return JGE_ERR_PNG; + } + png_init_io(png_ptr, NULL); + png_set_read_fn(png_ptr, (png_voidp)fileSystem, PNGCustomReadDataFn); + + png_set_sig_bytes(png_ptr, sig_read); + png_read_info(png_ptr, info_ptr); + png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, int_p_NULL, int_p_NULL); + png_set_strip_16(png_ptr); + png_set_packing(png_ptr); + if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr); + if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr); + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); + png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); + line = (u32*) malloc(width * 4); + if (!line) { + fileSystem->CloseFile(); + png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); + return JGE_ERR_MALLOC_FAILED; + } + + int texWidth = getNextPower2(width); + int texHeight = getNextPower2(height); + + bool done = false; + PIXEL_TYPE* bits = NULL; + bool videoRAMUsed = false; + int size = texWidth * texHeight * sizeof(PIXEL_TYPE); + + { + if (useVideoRAM) + { + bits = (PIXEL_TYPE*) valloc(size); + videoRAMUsed = true; + } + + if (bits == NULL) + { + videoRAMUsed = false; + bits = (PIXEL_TYPE*) memalign(16, size); + } + + PIXEL_TYPE* buffer = bits; + const unsigned int kVerticalBlockSize = 8; + if (mSwizzle) + { + //JLOG("allocating swizzle buffer"); + buffer = (PIXEL_TYPE*) memalign(16, texWidth * kVerticalBlockSize * sizeof(PIXEL_TYPE)); + if (!buffer) + { + JLOG("failed to allocate destination swizzle buffer!"); + std::ostringstream stream; + stream << "Alloc failed for: Tex Width: " << texWidth << " Tex Height: " << kVerticalBlockSize << ", total bytes: " << texWidth * kVerticalBlockSize * sizeof(PIXEL_TYPE); + JLOG(stream.str().c_str()); + fileSystem->CloseFile(); + png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); + return JGE_ERR_MALLOC_FAILED; + } + } + + if (buffer) + { + unsigned int src_row = texWidth * 8; + u32* dst = (u32*)bits; + u32* ysrc = (u32*) buffer; + unsigned int totalVerticalBlocksToProcess = height / kVerticalBlockSize; + + p32 = (u32*) buffer; + p16 = (u16*) p32; + for (unsigned int block = 0; block < totalVerticalBlocksToProcess; ++block) + { + for (unsigned int y = 0; y < kVerticalBlockSize; ++y) + { + ReadPngLine(png_ptr, line, width, pixelformat, p16, p32); + + p32 += texWidth; + p16 += texWidth; + } + + if (mSwizzle) + { + swizzle_fast((u8*) dst, (const u8*) buffer, texWidth * sizeof(PIXEL_TYPE), kVerticalBlockSize); + dst += src_row; + + // if we're swizzling, reset the read pointers to the top of the buffer, as we re-read into an 8 line + // block of memory (if we're not swizzling, we're reading directly into the destination, so we + // want to continue iterating through) + p32 = (u32*) buffer; + p16 = (u16*) p32; + } + } + + //now the last remaining lines (ie if the height wasn't evenly divisible by 8) + { + if (mSwizzle) + { + //clear the conversion buffer so that leftover scan lines are transparent + memset(buffer, 255, texWidth * kVerticalBlockSize * sizeof(PIXEL_TYPE)); + } + unsigned int remainingLines = height % kVerticalBlockSize; + for (unsigned int y = 0; y < remainingLines; ++y) + { + ReadPngLine(png_ptr, line, width, pixelformat, p16, p32); + + p32 += texWidth; + p16 += texWidth; + } + + if (mSwizzle) + { + // swizzle_fast only can handle eight lines at a time, and will overrun memory in our destination, + // which only has remainingLines to fill - use the swizzle_lines function instead + swizzle_lines((const u8*) buffer, (u8*) dst, texWidth, remainingLines); + } + } + + free(buffer); + done = true; + } + } + + //JLOG("Freeing line"); + free (line); + //JLOG("Reading end"); + png_read_end(png_ptr, info_ptr); + //JLOG("Destroying read struct"); + png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); + + //JLOG("Closing PNG"); + fileSystem->CloseFile(); + + if (done) + { + textureInfo.mBits = (u8 *)bits; + textureInfo.mWidth = width; + textureInfo.mHeight = height; + textureInfo.mTexWidth = texWidth; + textureInfo.mTexHeight = texHeight; + textureInfo.mVRAM = videoRAMUsed; + JLOG("-- OK -- JRenderer::LoadPNG"); + return 1; + + } + else + { + JLOG("LoadPNG failure - deallocating bits"); + textureInfo.mBits = NULL; + + if (videoRAMUsed) + vfree(bits); + else + free(bits); + return JGE_ERR_GENERIC; + } + +} + + + + +////////////////////////////////////////////////////////////////////////// +/// GIF Support +int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bgcolor, InputFunc readFunc,int mode, int textureMode) +{ + bool useVideoRAM = (mode == TEX_TYPE_USE_VRAM); + // pixel ** image_data=NULL; + DWORD *p32=NULL; + //#define gif_color(c) RGB(palette->Colors[c].Red, palette->Colors[c].Green, palette->Colors[c].Blue) +#define gif_color32(c) ARGB(255,palette->Colors[c].Red,palette->Colors[c].Green, palette->Colors[c].Blue) + GifRecordType RecordType; + GifByteType *Extension; + GifRowType LineIn = NULL; + GifFileType *GifFileIn = NULL; + ColorMapObject *palette; + int ExtCode; + int i, j; + if ((GifFileIn = DGifOpen(handle, readFunc)) == NULL) + return 1; + *bgcolor = 0; + textureInfo.mWidth = 0; + textureInfo.mHeight = 0; + //*image_data = NULL; + bool videoRAMUsed = false; + int size = 0; + + do { + if (DGifGetRecordType(GifFileIn, &RecordType) == GIF_ERROR) + { + DGifCloseFile(GifFileIn); + return 1; + } + + switch (RecordType) { + case IMAGE_DESC_RECORD_TYPE: + { + if (DGifGetImageDesc(GifFileIn) == GIF_ERROR) + { + DGifCloseFile(GifFileIn); + return 1; + } + if((palette = (GifFileIn->SColorMap != NULL) ? GifFileIn->SColorMap : GifFileIn->Image.ColorMap) == NULL) + { + DGifCloseFile(GifFileIn); + return 1; + } + textureInfo.mWidth = GifFileIn->Image.Width; + textureInfo.mHeight = GifFileIn->Image.Height; + *bgcolor = gif_color32(GifFileIn->SBackGroundColor); + if((LineIn = (GifRowType) malloc(GifFileIn->Image.Width * sizeof(GifPixelType))) == NULL) + { + DGifCloseFile(GifFileIn); + return 1; + } + + //--------------------------------------- + textureInfo.mTexWidth = getNextPower2(GifFileIn->Image.Width); + textureInfo.mTexHeight = getNextPower2(GifFileIn->Image.Height); + + bool done = false; + PIXEL_TYPE* bits = NULL; + + size = textureInfo.mTexWidth * textureInfo.mTexHeight * sizeof(PIXEL_TYPE); + + if (useVideoRAM)// && (mCurrentPointer+size)<0x200000) + { + //bits = (PIXEL_TYPE*) (0x04000000+0x40000000+mCurrentPointer); + //mCurrentPointer += size; + + bits = (PIXEL_TYPE*) valloc(size); + videoRAMUsed = true; + } + //else + + if (bits == NULL) + { + videoRAMUsed = false; + bits = (PIXEL_TYPE*) memalign(16, size); + } + + PIXEL_TYPE* buffer = bits; + + if (mSwizzle) + buffer = (PIXEL_TYPE*) memalign(16, textureInfo.mTexWidth * textureInfo.mTexHeight * sizeof(PIXEL_TYPE)); + + if (buffer) + { + p32 = (DWORD*) buffer; + } + + //if((*image_data = (pixel *)malloc(sizeof(pixel) * GifFileIn->Image.Width * GifFileIn->Image.Height)) == NULL) + if(p32 == NULL) + { + free((void *)LineIn); + DGifCloseFile(GifFileIn); + return 1; + } + + DWORD * curr = p32; + DWORD * imgdata = p32; + for (i = 0; i < GifFileIn->Image.Height; i ++) + { + imgdata = curr; + if (DGifGetLine(GifFileIn, LineIn, GifFileIn->Image.Width) == GIF_ERROR) + { + if (videoRAMUsed) + vfree(bits); + else + free(bits); + + if (mSwizzle) + free((void *)p32); + free((void *)LineIn); + DGifCloseFile(GifFileIn); + return 1; + } + for(j = 0; j < GifFileIn->Image.Width; j ++) + { + DWORD color32 = gif_color32(LineIn[j]); + + + *imgdata++ = color32; + } + + curr += textureInfo.mTexWidth; + } + + if (mSwizzle) + { + swizzle_fast((u8*)bits, (const u8*)buffer, textureInfo.mTexWidth*sizeof(PIXEL_TYPE), textureInfo.mTexHeight/*GifFileIn->Image.Height*/); + free (buffer); + } + + done = true; + + textureInfo.mBits = (u8 *)bits; + textureInfo.mVRAM = videoRAMUsed; + break; + } + case EXTENSION_RECORD_TYPE: + if (DGifGetExtension(GifFileIn, &ExtCode, &Extension) == GIF_ERROR) + { + if(textureInfo.mBits != NULL) + { + if (videoRAMUsed) + vfree(textureInfo.mBits); + else + free((void *)textureInfo.mBits); + textureInfo.mBits = NULL; + } + if(LineIn != NULL) + free((void *)LineIn); + DGifCloseFile(GifFileIn); + return 1; + } + while (Extension != NULL) { + if (DGifGetExtensionNext(GifFileIn, &Extension) == GIF_ERROR) + { + if(textureInfo.mBits != NULL) + { + if (videoRAMUsed) + vfree(textureInfo.mBits); + else + free((void *)textureInfo.mBits); + textureInfo.mBits = NULL; + } + if(LineIn != NULL) + free((void *)LineIn); + DGifCloseFile(GifFileIn); + return 1; + } + } + break; + case TERMINATE_RECORD_TYPE: + break; + default: + break; + } + } + while (RecordType != TERMINATE_RECORD_TYPE); + + if(LineIn != NULL) + free((void *)LineIn); + DGifCloseFile(GifFileIn); + + return 0; +} + +int image_gif_read(GifFileType * ft, GifByteType * buf, int size) +{ + + JFileSystem *fileSys = (JFileSystem *)ft->UserData; + if (fileSys->ReadFile(buf, size)) + return size; + else + return 0; + +} + +void JRenderer::LoadGIF(TextureInfo &textureInfo, const char *filename, int mode, int textureMode) +{ + textureInfo.mBits = NULL; + + + JFileSystem *fileSys = JFileSystem::GetInstance(); + if (!fileSys->OpenFile(filename)) + return; + + DWORD bkcol; + int result = image_readgif(fileSys, textureInfo, &bkcol, image_gif_read, mode); + + if(result!=0) + textureInfo.mBits=NULL; + fileSys->CloseFile(); + + return ; +} + + + +JTexture* JRenderer::CreateTexture(int width, int height, int mode) +{ + bool useVideoRAM = (mode == TEX_TYPE_USE_VRAM); + + JTexture* tex = new JTexture(); + if (tex) + { + tex->mWidth = width; + tex->mHeight = height; + + + tex->mTexWidth = getNextPower2(width); + tex->mTexHeight = getNextPower2(height); + + int size = tex->mTexWidth * tex->mTexHeight * sizeof(PIXEL_TYPE); + if (useVideoRAM) + { + tex->mInVideoRAM = true; + tex->mBits = (PIXEL_TYPE*) valloc(size); + } + + //else + if (tex->mBits == NULL) + { + tex->mInVideoRAM = false; + tex->mBits = (PIXEL_TYPE*) memalign(16, size); + } + + memset(tex->mBits, 0, size); + + tex->mTexId = mTexCounter++; + } + + return tex; +} + + +void JRenderer::BindTexture(JTexture *tex) +{ + if (mCurrentTex != tex->mTexId) + { + sceGuTexImage(0, tex->mTexWidth, tex->mTexHeight, tex->mTexWidth, tex->mBits); + mCurrentTex = tex->mTexId; + + if (m3DEnabled) + { + if (mCurrentRenderMode == MODE_3D) + { + sceKernelDcacheWritebackAll(); + sceGuTexFunc(GU_TFX_ADD,GU_TCC_RGB); + } + } + } + +} + + +////////////////////////////////////////////////////////////////////////// +void JRenderer::Enable2D() +{ + + mCurrentRenderMode = MODE_2D; + + sceGuDisable(GU_DEPTH_TEST); + +} + + +////////////////////////////////////////////////////////////////////////// +void JRenderer::Enable3D() +{ + mCurrentRenderMode = MODE_3D; + + mCurrentBlend = -1; + + sceGuEnable(GU_DEPTH_TEST); + + LoadIdentity(); +} + + +////////////////////////////////////////////////////////////////////////// +void JRenderer::SetClip(int x, int y, int width, int height) +{ + sceGuScissor(x, y, width, height); +} + + +void JRenderer::LoadIdentity() +{ + sceGumMatrixMode(GU_VIEW); + sceGumLoadIdentity(); + + sceGumMatrixMode(GU_MODEL); + sceGumLoadIdentity(); +} + + +void JRenderer::Translate(float x, float y, float z) +{ + ScePspFVector3 pos = { x, y, z }; + sceGumTranslate(&pos); +} + + +void JRenderer::RotateX(float angle) +{ + sceGumRotateX(angle); +} + + +void JRenderer::RotateY(float angle) +{ + sceGumRotateY(angle); +} + + +void JRenderer::RotateZ(float angle) +{ + sceGumRotateZ(angle); +} + + +void JRenderer::PushMatrix() +{ + sceGumPushMatrix(); +} + + +void JRenderer::PopMatrix() +{ + sceGumPopMatrix(); +} + +void JRenderer::RenderTriangles(JTexture* texture, Vertex3D *tris, int start, int count) +{ + if (texture) + BindTexture(texture); + + PSPVertex3D* vertices = (PSPVertex3D*) sceGuGetMemory(count * 3 * sizeof(PSPVertex3D)); + + int n = 0; + int index = start*3; + for (int i = 0; i < count; i++) + { + vertices[n].texture.x = tris[index].u; + vertices[n].texture.y = tris[index].v; + + vertices[n].pos.x = tris[index].x; + vertices[n].pos.y = tris[index].y; + vertices[n].pos.z = tris[index].z; + + + index++; + n++; + + vertices[n].texture.x = tris[index].u; + vertices[n].texture.y = tris[index].v; + + vertices[n].pos.x = tris[index].x; + vertices[n].pos.y = tris[index].y; + vertices[n].pos.z = tris[index].z; + + + index++; + n++; + + vertices[n].texture.x = tris[index].u; + vertices[n].texture.y = tris[index].v; + + vertices[n].pos.x = tris[index].x; + vertices[n].pos.y = tris[index].y; + vertices[n].pos.z = tris[index].z; + + + index++; + n++; + + } + + sceGuColor(0xff000000); + sceGumDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_3D,count*3,0,vertices); + +} + +void JRenderer::SetFOV(float fov) +{ + mFOV = fov; + + sceGumMatrixMode(GU_PROJECTION); + sceGumLoadIdentity(); + sceGumPerspective(mFOV,16.0f/9.0f,0.5f,1000.0f); +} + +void JRenderer::FillPolygon(float* x, float* y, int count, PIXEL_TYPE color) +{ + struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(count * sizeof(struct VertexColor)); + + for(int i=0; i y2-y1) + { + q=(float)sqrt(radius*radius - (i-(y2-y1))*(i-(y2-y1))); + nextq=(float)sqrt(radius*radius - (i+1-(y2-y1))*(i+1-(y2-y1))); + } + if (nextq == q) nextq = q+1; + if (i==-radius || i == y2-y1+radius-1){ + DrawLine(x1+(radius-q),y1+i+radius,x2+q+radius,y1+i+radius,color); + }else{ + DrawLine(x1+(radius-q),y1+i+radius,x1+(radius-nextq),y1+i+radius,color); + DrawLine(x2+radius+q,y1+i+radius,x2+radius+nextq,y1+i+radius,color); + } + } +} + + +void JRenderer::FillRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color) +{ + x+=w+radius; + y+=radius; + + struct VertexColor* vertices = (struct VertexColor*)sceGuGetMemory(182 * sizeof(struct VertexColor)); + + vertices[0].color = color; + vertices[0].x = x; + vertices[0].y = y; + vertices[0].z = 0.0f; + + int angle = 359; + for(int i=0; i<45; i++) + { + vertices[i+1].color = color; + vertices[i+1].x = x+radius*COSF(angle); + vertices[i+1].y = y+radius*SINF(angle); + vertices[i+1].z = 0.0f; + angle -= 2; + if (angle < 0) + angle = 0; + } + + x-=w; + + for(int i=45; i<90; i++) + { + vertices[i+1].color = color; + vertices[i+1].x = x+radius*COSF(angle); + vertices[i+1].y = y+radius*SINF(angle); + vertices[i+1].z = 0.0f; + angle -= 2; + if (angle < 0) + angle = 0; + } + + y+=h; + for(int i=90; i<135; i++) + { + vertices[i+1].color = color; + vertices[i+1].x = x+radius*COSF(angle); + vertices[i+1].y = y+radius*SINF(angle); + vertices[i+1].z = 0.0f; + angle -= 2; + if (angle < 0) + angle = 0; + } + + x+=w; + for(int i=135; i<180; i++) + { + vertices[i+1].color = color; + vertices[i+1].x = x+radius*COSF(angle); + vertices[i+1].y = y+radius*SINF(angle); + vertices[i+1].z = 0.0f; + angle -= 2; + if (angle < 0) + angle = 0; + } + + y-=h; + vertices[181].color = color; + vertices[181].x = x+radius*COSF(359); + vertices[181].y = y+radius*SINF(359); + vertices[181].z = 0.0f; + + sceGuDisable(GU_TEXTURE_2D); + sceGuShadeModel(GU_SMOOTH); + sceGuAmbientColor(0xffffffff); + sceGuDrawArray(GU_TRIANGLE_FAN, TEXTURE_COLOR_FORMAT|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 182, 0, vertices); + sceGuEnable(GU_TEXTURE_2D); +} + + +void JRenderer::SetImageFilter(JImageFilter* imageFilter) +{ + mImageFilter = imageFilter; } \ No newline at end of file diff --git a/JGE/src/JGui.cpp b/JGE/src/JGui.cpp index e105462a7..c38dde703 100644 --- a/JGE/src/JGui.cpp +++ b/JGE/src/JGui.cpp @@ -1,257 +1,257 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#include "../include/JGE.h" -#include "../include/JGui.h" - -JGE* JGuiObject::mEngine = NULL; - -JGE* JGuiController::mEngine = NULL; - -JGuiObject::JGuiObject(int id) : - mId(id) -{ - mEngine = JGE::GetInstance(); -} - -JGuiObject::~JGuiObject() -{ - // JGERelease(); -} - -bool JGuiObject::Leaving(JButton key __attribute__((unused))) -{ - return true; -} - -bool JGuiObject::ButtonPressed() -{ - return false; -} - -void JGuiObject::Entering() -{ - -} - -int JGuiObject::GetId() -{ - return mId; -} - -void JGuiObject::Update(float dt __attribute__((unused))) -{ -} - -ostream& operator<<(ostream &out, const JGuiObject &j) -{ - return j.toString(out); -} - -JGuiController::JGuiController(int id, JGuiListener* listener) : - mId(id), mListener(listener) -{ - mEngine = JGE::GetInstance(); - - mBg = NULL; - mShadingBg = NULL; - - mCount = 0; - mCurr = 0; - - mCursorX = SCREEN_WIDTH / 2; - mCursorY = SCREEN_HEIGHT / 2; - mShowCursor = false; - - mActionButton = JGE_BTN_OK; - mCancelButton = JGE_BTN_MENU; - - mStyle = JGUI_STYLE_WRAPPING; - - mActive = true; -} - -JGuiController::~JGuiController() -{ - for (int i = 0; i < mCount; i++) - if (mObjects[i] != NULL) delete mObjects[i]; - -} - -void JGuiController::Render() -{ - for (int i = 0; i < mCount; i++) - if (mObjects[i] != NULL) mObjects[i]->Render(); -} - -bool JGuiController::CheckUserInput(JButton key) -{ - if (!mCount) return false; - if (key == mActionButton) - { - if (!mObjects.empty() && mObjects[mCurr] != NULL && mObjects[mCurr]->ButtonPressed()) - { - if (mListener != NULL) mListener->ButtonPressed(mId, mObjects[mCurr]->GetId()); - return true; - } - } - else if (key == mCancelButton) - { - if (mListener != NULL) - { - mListener->ButtonPressed(mId, kCancelMenuID); - } - } - else if (JGE_BTN_CANCEL == key) - { - if (mListener != NULL) mListener->ButtonPressed(mId, kInfoMenuID); - return true; - } - else if ((JGE_BTN_LEFT == key) || (JGE_BTN_UP == key)) // || mEngine->GetAnalogY() < 64 || mEngine->GetAnalogX() < 64) - { - int n = mCurr; - n--; - if (n < 0) - { - if ((mStyle & JGUI_STYLE_WRAPPING)) - n = mCount - 1; - else - n = 0; - } - - if (n != mCurr && mObjects[mCurr] != NULL && mObjects[mCurr]->Leaving(JGE_BTN_UP)) - { - mCurr = n; - mObjects[mCurr]->Entering(); - } - return true; - } - else if ((JGE_BTN_RIGHT == key) || (JGE_BTN_DOWN == key)) // || mEngine->GetAnalogY()>192 || mEngine->GetAnalogX()>192) - { - int n = mCurr; - n++; - if (n > mCount - 1) - { - if ((mStyle & JGUI_STYLE_WRAPPING)) - n = 0; - else - n = mCount - 1; - } - - if (n != mCurr && mObjects[mCurr] != NULL && mObjects[mCurr]->Leaving(JGE_BTN_DOWN)) - { - mCurr = n; - mObjects[mCurr]->Entering(); - } - return true; - } - else - { // a dude may have clicked somewhere, we're gonna select the closest object from where he clicked - int x, y; - unsigned int distance2; - unsigned int minDistance2 = -1; - int n = mCurr; - if (mEngine->GetLeftClickCoordinates(x, y)) - { - for (int i = 0; i < mCount; i++) - { - float top, left; - if (mObjects[i]->getTopLeft(top, left)) - { - distance2 = (top - y) * (top - y) + (left - x) * (left - x); - if (distance2 < minDistance2) - { - minDistance2 = distance2; - n = i; - } - } - } - - if (n != mCurr && mObjects[mCurr] != NULL && mObjects[mCurr]->Leaving(JGE_BTN_DOWN)) - { - mCurr = n; - mObjects[mCurr]->Entering(); - } - mEngine->LeftClickedProcessed(); - return true; - } - } - return false; -} - -void JGuiController::Update(float dt) -{ - for (int i = 0; i < mCount; i++) - if (mObjects[i] != NULL) mObjects[i]->Update(dt); - - JButton key = mEngine->ReadButton(); - CheckUserInput(key); -} - -void JGuiController::Add(JGuiObject* ctrl) -{ - mObjects.push_back(ctrl); - mCount++; -} - -void JGuiController::RemoveAt(int i) -{ - if (!mObjects[i]) return; - mObjects.erase(mObjects.begin() + i); - delete mObjects[i]; - mCount--; - if (mCurr == mCount) mCurr = 0; - return; -} - -void JGuiController::Remove(int id) -{ - for (int i = 0; i < mCount; i++) - { - if (mObjects[i] != NULL && mObjects[i]->GetId() == id) - { - RemoveAt(i); - return; - } - } -} - -void JGuiController::Remove(JGuiObject* ctrl) -{ - for (int i = 0; i < mCount; i++) - { - if (mObjects[i] != NULL && mObjects[i] == ctrl) - { - RemoveAt(i); - return; - } - } -} - -void JGuiController::SetActionButton(JButton button) -{ - mActionButton = button; -} -void JGuiController::SetStyle(int style) -{ - mStyle = style; -} -void JGuiController::SetCursor(JSprite* cursor) -{ - mCursor = cursor; -} -bool JGuiController::IsActive() -{ - return mActive; -} -void JGuiController::SetActive(bool flag) -{ - mActive = flag; -} +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#include "../include/JGE.h" +#include "../include/JGui.h" + +JGE* JGuiObject::mEngine = NULL; + +JGE* JGuiController::mEngine = NULL; + +JGuiObject::JGuiObject(int id) : + mId(id) +{ + mEngine = JGE::GetInstance(); +} + +JGuiObject::~JGuiObject() +{ + // JGERelease(); +} + +bool JGuiObject::Leaving(JButton key __attribute__((unused))) +{ + return true; +} + +bool JGuiObject::ButtonPressed() +{ + return false; +} + +void JGuiObject::Entering() +{ + +} + +int JGuiObject::GetId() +{ + return mId; +} + +void JGuiObject::Update(float dt __attribute__((unused))) +{ +} + +ostream& operator<<(ostream &out, const JGuiObject &j) +{ + return j.toString(out); +} + +JGuiController::JGuiController(int id, JGuiListener* listener) : + mId(id), mListener(listener) +{ + mEngine = JGE::GetInstance(); + + mBg = NULL; + mShadingBg = NULL; + + mCount = 0; + mCurr = 0; + + mCursorX = SCREEN_WIDTH / 2; + mCursorY = SCREEN_HEIGHT / 2; + mShowCursor = false; + + mActionButton = JGE_BTN_OK; + mCancelButton = JGE_BTN_MENU; + + mStyle = JGUI_STYLE_WRAPPING; + + mActive = true; +} + +JGuiController::~JGuiController() +{ + for (int i = 0; i < mCount; i++) + if (mObjects[i] != NULL) delete mObjects[i]; + +} + +void JGuiController::Render() +{ + for (int i = 0; i < mCount; i++) + if (mObjects[i] != NULL) mObjects[i]->Render(); +} + +bool JGuiController::CheckUserInput(JButton key) +{ + if (!mCount) return false; + if (key == mActionButton) + { + if (!mObjects.empty() && mObjects[mCurr] != NULL && mObjects[mCurr]->ButtonPressed()) + { + if (mListener != NULL) mListener->ButtonPressed(mId, mObjects[mCurr]->GetId()); + return true; + } + } + else if (key == mCancelButton) + { + if (mListener != NULL) + { + mListener->ButtonPressed(mId, kCancelMenuID); + } + } + else if (JGE_BTN_CANCEL == key) + { + if (mListener != NULL) mListener->ButtonPressed(mId, kInfoMenuID); + return true; + } + else if ((JGE_BTN_LEFT == key) || (JGE_BTN_UP == key)) // || mEngine->GetAnalogY() < 64 || mEngine->GetAnalogX() < 64) + { + int n = mCurr; + n--; + if (n < 0) + { + if ((mStyle & JGUI_STYLE_WRAPPING)) + n = mCount - 1; + else + n = 0; + } + + if (n != mCurr && mObjects[mCurr] != NULL && mObjects[mCurr]->Leaving(JGE_BTN_UP)) + { + mCurr = n; + mObjects[mCurr]->Entering(); + } + return true; + } + else if ((JGE_BTN_RIGHT == key) || (JGE_BTN_DOWN == key)) // || mEngine->GetAnalogY()>192 || mEngine->GetAnalogX()>192) + { + int n = mCurr; + n++; + if (n > mCount - 1) + { + if ((mStyle & JGUI_STYLE_WRAPPING)) + n = 0; + else + n = mCount - 1; + } + + if (n != mCurr && mObjects[mCurr] != NULL && mObjects[mCurr]->Leaving(JGE_BTN_DOWN)) + { + mCurr = n; + mObjects[mCurr]->Entering(); + } + return true; + } + else + { // a dude may have clicked somewhere, we're gonna select the closest object from where he clicked + int x, y; + unsigned int distance2; + unsigned int minDistance2 = -1; + int n = mCurr; + if (mEngine->GetLeftClickCoordinates(x, y)) + { + for (int i = 0; i < mCount; i++) + { + float top, left; + if (mObjects[i]->getTopLeft(top, left)) + { + distance2 = (top - y) * (top - y) + (left - x) * (left - x); + if (distance2 < minDistance2) + { + minDistance2 = distance2; + n = i; + } + } + } + + if (n != mCurr && mObjects[mCurr] != NULL && mObjects[mCurr]->Leaving(JGE_BTN_DOWN)) + { + mCurr = n; + mObjects[mCurr]->Entering(); + } + mEngine->LeftClickedProcessed(); + return true; + } + } + return false; +} + +void JGuiController::Update(float dt) +{ + for (int i = 0; i < mCount; i++) + if (mObjects[i] != NULL) mObjects[i]->Update(dt); + + JButton key = mEngine->ReadButton(); + CheckUserInput(key); +} + +void JGuiController::Add(JGuiObject* ctrl) +{ + mObjects.push_back(ctrl); + mCount++; +} + +void JGuiController::RemoveAt(int i) +{ + if (!mObjects[i]) return; + mObjects.erase(mObjects.begin() + i); + delete mObjects[i]; + mCount--; + if (mCurr == mCount) mCurr = 0; + return; +} + +void JGuiController::Remove(int id) +{ + for (int i = 0; i < mCount; i++) + { + if (mObjects[i] != NULL && mObjects[i]->GetId() == id) + { + RemoveAt(i); + return; + } + } +} + +void JGuiController::Remove(JGuiObject* ctrl) +{ + for (int i = 0; i < mCount; i++) + { + if (mObjects[i] != NULL && mObjects[i] == ctrl) + { + RemoveAt(i); + return; + } + } +} + +void JGuiController::SetActionButton(JButton button) +{ + mActionButton = button; +} +void JGuiController::SetStyle(int style) +{ + mStyle = style; +} +void JGuiController::SetCursor(JSprite* cursor) +{ + mCursor = cursor; +} +bool JGuiController::IsActive() +{ + return mActive; +} +void JGuiController::SetActive(bool flag) +{ + mActive = flag; +} diff --git a/JGE/src/JMD2Model.cpp b/JGE/src/JMD2Model.cpp index d27537fb5..3d6db171a 100644 --- a/JGE/src/JMD2Model.cpp +++ b/JGE/src/JMD2Model.cpp @@ -1,677 +1,677 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#include "../include/JFileSystem.h" -#include "../include/JRenderer.h" -#include "../include/JMD2Model.h" - - -MD2Animation::MD2Animation(int start, int end) -{ - mStartFrame = start; - mEndFrame = end; -} - -JRenderer* JMD2Model::mRenderer = NULL; - - -//------------------------------------------------------------------------------------------------- -JMD2Model::JMD2Model() -{ - mRenderer = JRenderer::GetInstance(); - - int endFrames[] = { 39, 46, 60, 66, 73, 95, 112, 122, 135, 154, 161, 169, 177, 185, 190, 198 }; - int startFrame = 0; - - mAnimations = (MD2Animation **)malloc(sizeof(MD2Animation)*MAX_ANIMATION); - for (int i=0;itriIndex != NULL) - free(mModel->triIndex); - if (mModel->pointList != NULL) - free(mModel->pointList); - if (mModel->st != NULL) - free(mModel->st); - if (mModel->modelTex != NULL) - delete mModel->modelTex; - - free(mModel); - } - - if (mAnimations) - { - for (int i=0;iOpenFile(filename)) - return false; - //filePtr = fopen(filename, "rb"); - //if (filePtr == NULL) - // return false; - - // find length of file - //fseek(filePtr, 0, SEEK_END); - //fileLen = ftell(filePtr); - //fseek(filePtr, 0, SEEK_SET); - - fileLen = fileSystem->GetFileSize(); - - // read entire file into buffer - buffer = (char*)malloc(fileLen + 1); - //fread(buffer, sizeof(char), fileLen, filePtr); - fileSystem->ReadFile(buffer, fileLen); - fileSystem->CloseFile(); - - // extract model file header from buffer - modelHeader = (modelHeader_t*)buffer; - - // allocate memory for model data - mModel = (modelData_t*)malloc(sizeof(modelData_t)); - if (mModel == NULL) - return false; - - // allocate memory for all vertices used in model, including animations - mModel->pointList = (Vector3D *)malloc(sizeof(Vector3D)*modelHeader->numXYZ * modelHeader->numFrames); - - // store vital model data - mModel->numPoints = modelHeader->numXYZ; - mModel->numFrames = modelHeader->numFrames; - mModel->frameSize = modelHeader->framesize; - - // loop number of frames in model file - for(j = 0; j < modelHeader->numFrames; j++) - { - // offset to the points in this frame - frame = (frame_t*)&buffer[modelHeader->offsetFrames + modelHeader->framesize * j]; - - // calculate the point positions based on frame details - pointListPtr = (Vector3D *)&mModel->pointList[modelHeader->numXYZ * j]; - for(i = 0; i < modelHeader->numXYZ; i++) - { - pointListPtr[i].x = frame->scale[0] * frame->fp[i].v[0] + frame->translate[0]; - pointListPtr[i].y = frame->scale[1] * frame->fp[i].v[1] + frame->translate[1]; - pointListPtr[i].z = frame->scale[2] * frame->fp[i].v[2] + frame->translate[2]; - } - } - - JTexture *tex = mRenderer->LoadTexture(textureName); - if (tex) - mModel->modelTex = tex; - else - { - free(mModel); - mModel = NULL; - - free(buffer); - return false; - } - - float texWidth = (float)tex->mWidth; - float texHeight = (float)tex->mHeight; - - - // allocate memory for the model texture coordinates - mModel->st = (texCoord_t*)malloc(sizeof(texCoord_t)*modelHeader->numST); - - // store number of texture coordinates - mModel->numST = modelHeader->numST; - - // set texture pointer to texture coordinate offset - stPtr = (stIndex_t*)&buffer[modelHeader->offsetST]; - - // calculate and store the texture coordinates for the model - for (i = 0; i < modelHeader->numST; i++) - { - mModel->st[i].s = (float)stPtr[i].s / texWidth; - mModel->st[i].t = (float)stPtr[i].t / texHeight; - } - - // allocate an index of triangles - triIndex = (mesh_t*)malloc(sizeof(mesh_t) * modelHeader->numTris); - - // set total number of triangles - mModel->numTriangles = modelHeader->numTris; - mModel->triIndex = triIndex; - - // point to triangle indexes in buffer - bufIndexPtr = (mesh_t*)&buffer[modelHeader->offsetTris]; - - // create a mesh (triangle) list - for (j = 0; j < mModel->numFrames; j++) - { - // for all triangles in each frame - for(i = 0; i < modelHeader->numTris; i++) - { - triIndex[i].meshIndex[0] = bufIndexPtr[i].meshIndex[0]; - triIndex[i].meshIndex[1] = bufIndexPtr[i].meshIndex[1]; - triIndex[i].meshIndex[2] = bufIndexPtr[i].meshIndex[2]; - triIndex[i].stIndex[0] = bufIndexPtr[i].stIndex[0]; - triIndex[i].stIndex[1] = bufIndexPtr[i].stIndex[1]; - triIndex[i].stIndex[2] = bufIndexPtr[i].stIndex[2]; - } - } - - // close file and free memory - //fclose(filePtr); - free(buffer); - - mModel->currentFrame = 0; - mModel->nextFrame = 1; - mModel->interpol = 0.0; - - CheckNextState(); - - return true; -} - - -//------------------------------------------------------------------------------------------------- -// given 3 points, calculates the normal to the points -#if defined (WIN32) || defined (LINUX) || defined (IOS) -void JMD2Model::CalculateNormal(float *p1, float *p2, float *p3) -#else -void JMD2Model::CalculateNormal(ScePspFVector3 *normal, float *p1, float *p2, float *p3) -#endif -{ - float a[3], b[3], result[3]; - float length; - - a[0] = p1[0] - p2[0]; - a[1] = p1[1] - p2[1]; - a[2] = p1[2] - p2[2]; - - b[0] = p1[0] - p3[0]; - b[1] = p1[1] - p3[1]; - b[2] = p1[2] - p3[2]; - - result[0] = a[1] * b[2] - b[1] * a[2]; - result[1] = b[0] * a[2] - a[0] * b[2]; - result[2] = a[0] * b[1] - b[0] * a[1]; - - // calculate the length of the normal - length = (float)sqrt(result[0]*result[0] + result[1]*result[1] + result[2]*result[2]); - -#if defined (WIN32) || defined (LINUX) || defined (IOS) - // normalize and specify the normal -#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0) - glNormal3f(result[0]/length, result[1]/length, result[2]/length); -#else - // FIXME -#endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0) - -#else - if (length == 0.0f) - length = SMALLEST_FP; - - normal->x = result[0]/length; - normal->y = result[1]/length; - normal->z = result[2]/length; -#endif - -} - - -//------------------------------------------------------------------------------------------------- -// render a single frame of a MD2 model -void JMD2Model::Render(int frameNum) -{ - Vector3D *pointList; - int i; - - // create a pointer to the frame we want to show - pointList = &mModel->pointList[mModel->numPoints * frameNum]; - - // set the texture - mRenderer->BindTexture(mModel->modelTex); - - -#if defined (WIN32) || defined (LINUX) || defined (IOS) - - // display the textured model with proper lighting normals -#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - -#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - -#else - glBegin(GL_TRIANGLES); -#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - - for(i = 0; i < mModel->numTriangles; i++) - { - CalculateNormal(pointList[mModel->triIndex[i].meshIndex[0]].v, - pointList[mModel->triIndex[i].meshIndex[2]].v, - pointList[mModel->triIndex[i].meshIndex[1]].v); - -#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - -#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) - float vertex_data[]={ - pointList[mModel->triIndex[i].meshIndex[0]].x, pointList[mModel->triIndex[i].meshIndex[0]].y, pointList[mModel->triIndex[i].meshIndex[0]].z, - pointList[mModel->triIndex[i].meshIndex[2]].x, pointList[mModel->triIndex[i].meshIndex[2]].y, pointList[mModel->triIndex[i].meshIndex[2]].z, - pointList[mModel->triIndex[i].meshIndex[1]].x, pointList[mModel->triIndex[i].meshIndex[1]].y, pointList[mModel->triIndex[i].meshIndex[1]].z, - }; - float texcoord_data[] = { - mModel->st[mModel->triIndex[i].stIndex[0]].s, - mModel->st[mModel->triIndex[i].stIndex[0]].t, - mModel->st[mModel->triIndex[i].stIndex[2]].s, - mModel->st[mModel->triIndex[i].stIndex[2]].t, - mModel->st[mModel->triIndex[i].stIndex[1]].s, - mModel->st[mModel->triIndex[i].stIndex[1]].t, - }; - - glVertexPointer(3,GL_FLOAT,0,vertex_data); - glTexCoordPointer(2,GL_FLOAT,0,texcoord_data); - -#else - glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[0]].s, - mModel->st[mModel->triIndex[i].stIndex[0]].t); - glVertex3fv(pointList[mModel->triIndex[i].meshIndex[0]].v); - - glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[2]].s , - mModel->st[mModel->triIndex[i].stIndex[2]].t); - glVertex3fv(pointList[mModel->triIndex[i].meshIndex[2]].v); - - glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[1]].s, - mModel->st[mModel->triIndex[i].stIndex[1]].t); - glVertex3fv(pointList[mModel->triIndex[i].meshIndex[1]].v); -#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0) - } -#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - -#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) - glDrawArrays(GL_TRIANGLES,0,3); // seems suspicious to put that here, should probably be in the loop -#else - glEnd(); -#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - - -#else - - PSPVertex3D* vertices = (PSPVertex3D*) sceGuGetMemory(mModel->numTriangles * 3 * sizeof(PSPVertex3D)); - - int n = 0; - for(i = 0; i < mModel->numTriangles; i++) - { - //CalculateNormal(&vertices[n].normal, - // pointList[mModel->triIndex[i].meshIndex[0]].v, - // pointList[mModel->triIndex[i].meshIndex[2]].v, - // pointList[mModel->triIndex[i].meshIndex[1]].v); - - vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[0]].s; - vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[0]].t; - - vertices[n].pos.x = pointList[mModel->triIndex[i].meshIndex[0]].x; - vertices[n].pos.y = pointList[mModel->triIndex[i].meshIndex[0]].y; - vertices[n].pos.z = pointList[mModel->triIndex[i].meshIndex[0]].z; - n++; - - //vertices[n].normal.x = vertices[n-1].normal.x; - //vertices[n].normal.y = vertices[n-1].normal.y; - //vertices[n].normal.z = vertices[n-1].normal.z; - - vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[2]].s; - vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[2]].t; - - vertices[n].pos.x = pointList[mModel->triIndex[i].meshIndex[2]].x; - vertices[n].pos.y = pointList[mModel->triIndex[i].meshIndex[2]].y; - vertices[n].pos.z = pointList[mModel->triIndex[i].meshIndex[2]].z; - n++; - - - //vertices[n].normal.x = vertices[n-1].normal.x; - //vertices[n].normal.y = vertices[n-1].normal.y; - //vertices[n].normal.z = vertices[n-1].normal.z; - - vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[1]].s; - vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[1]].t; - - vertices[n].pos.x = pointList[mModel->triIndex[i].meshIndex[1]].x; - vertices[n].pos.y = pointList[mModel->triIndex[i].meshIndex[1]].y; - vertices[n].pos.z = pointList[mModel->triIndex[i].meshIndex[1]].z; - n++; - - - } - - - sceGuColor(0xff000000); - sceGumDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_NORMAL_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_3D,mModel->numTriangles*3,0,vertices); - - -#endif - -} - - -//------------------------------------------------------------------------------------------------- -void JMD2Model::SetState(int newState) -{ - mNextState = newState; - -} - - -//------------------------------------------------------------------------------------------------- -void JMD2Model::CheckNextState() -{ - if (mState != mNextState) - { - mState = mNextState; - mModel->currentFrame = mAnimations[mState]->mStartFrame; - mModel->nextFrame = mAnimations[mState]->mStartFrame+1; - mModel->interpol = 0.0f; - } -} - - -void JMD2Model::Update(float dt) -{ - - mModel->interpol += mAnimationSpeed*dt; - - if (mModel->interpol >= 1.0) - { - mModel->interpol = 0.0f; - - int startFrame = mAnimations[mState]->mStartFrame; - int endFrame = mAnimations[mState]->mEndFrame; - - if ( (startFrame < 0) || (endFrame < 0) ) - return; - - if ( (startFrame >= mModel->numFrames) || (endFrame >= mModel->numFrames) ) - return; - - mModel->currentFrame++; - if (mModel->currentFrame >= endFrame) - mModel->currentFrame = startFrame; - - mModel->nextFrame = mModel->currentFrame + 1; - - if (mModel->nextFrame >= endFrame) - { - mModel->nextFrame = startFrame; - CheckNextState(); - } - } - -} - - -void JMD2Model::SetAnimationSpeed(float speed) -{ - mAnimationSpeed = speed; -} - - -//------------------------------------------------------------------------------------------------- -// displays a frame of the model between startFrame and endFrame with an interpolation percent -void JMD2Model::Render() -{ - - CheckNextState(); - - Vector3D *pointList; // current frame vertices - Vector3D *nextPointList; // next frame vertices - int i; - float x1, y1, z1; // current frame point values - float x2, y2, z2; // next frame point values - - Vector3D vertex[3]; - - if (mModel == NULL) - return; - - pointList = &mModel->pointList[mModel->numPoints*mModel->currentFrame]; - nextPointList = &mModel->pointList[mModel->numPoints*mModel->nextFrame]; - - mRenderer->BindTexture(mModel->modelTex); - -#if defined (WIN32) || defined (LINUX) || defined (IOS) - -#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - // FIXME -#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); -#else - glBegin(GL_TRIANGLES); -#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - - for (i = 0; i < mModel->numTriangles; i++) - { - // get first points of each frame - x1 = pointList[mModel->triIndex[i].meshIndex[0]].x; - y1 = pointList[mModel->triIndex[i].meshIndex[0]].y; - z1 = pointList[mModel->triIndex[i].meshIndex[0]].z; - x2 = nextPointList[mModel->triIndex[i].meshIndex[0]].x; - y2 = nextPointList[mModel->triIndex[i].meshIndex[0]].y; - z2 = nextPointList[mModel->triIndex[i].meshIndex[0]].z; - - // store first interpolated vertex of triangle - vertex[0].x = x1 + mModel->interpol * (x2 - x1); - vertex[0].y = y1 + mModel->interpol * (y2 - y1); - vertex[0].z = z1 + mModel->interpol * (z2 - z1); - - // get second points of each frame - x1 = pointList[mModel->triIndex[i].meshIndex[2]].x; - y1 = pointList[mModel->triIndex[i].meshIndex[2]].y; - z1 = pointList[mModel->triIndex[i].meshIndex[2]].z; - x2 = nextPointList[mModel->triIndex[i].meshIndex[2]].x; - y2 = nextPointList[mModel->triIndex[i].meshIndex[2]].y; - z2 = nextPointList[mModel->triIndex[i].meshIndex[2]].z; - - // store second interpolated vertex of triangle - vertex[2].x = x1 + mModel->interpol * (x2 - x1); - vertex[2].y = y1 + mModel->interpol * (y2 - y1); - vertex[2].z = z1 + mModel->interpol * (z2 - z1); - - // get third points of each frame - x1 = pointList[mModel->triIndex[i].meshIndex[1]].x; - y1 = pointList[mModel->triIndex[i].meshIndex[1]].y; - z1 = pointList[mModel->triIndex[i].meshIndex[1]].z; - x2 = nextPointList[mModel->triIndex[i].meshIndex[1]].x; - y2 = nextPointList[mModel->triIndex[i].meshIndex[1]].y; - z2 = nextPointList[mModel->triIndex[i].meshIndex[1]].z; - - // store third interpolated vertex of triangle - vertex[1].x = x1 + mModel->interpol * (x2 - x1); - vertex[1].y = y1 + mModel->interpol * (y2 - y1); - vertex[1].z = z1 + mModel->interpol * (z2 - z1); - - // calculate the normal of the triangle - //CalculateNormal(vertex[0].v, vertex[2].v, vertex[1].v); - - // render properly textured triangle - -#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - // FIXME -#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) - float vertex_data[]={ - vertex[0].x, vertex[0].y, vertex[0].z, - vertex[2].x, vertex[2].y, vertex[2].z, - vertex[1].x, vertex[1].y, vertex[1].z, - }; - float texcoord_data[] = { - mModel->st[mModel->triIndex[i].stIndex[0]].s, - mModel->st[mModel->triIndex[i].stIndex[0]].t, - mModel->st[mModel->triIndex[i].stIndex[2]].s, - mModel->st[mModel->triIndex[i].stIndex[2]].t, - mModel->st[mModel->triIndex[i].stIndex[1]].s, - mModel->st[mModel->triIndex[i].stIndex[1]].t, - }; - - glVertexPointer(3,GL_FLOAT,0,vertex_data); - glTexCoordPointer(2,GL_FLOAT,0,texcoord_data); -#else - glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[0]].s, - mModel->st[mModel->triIndex[i].stIndex[0]].t); - glVertex3fv(vertex[0].v); - - glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[2]].s , - mModel->st[mModel->triIndex[i].stIndex[2]].t); - glVertex3fv(vertex[2].v); - - glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[1]].s, - mModel->st[mModel->triIndex[i].stIndex[1]].t); - glVertex3fv(vertex[1].v); -#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - - } -#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - // FIXME -#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) - glDrawArrays(GL_TRIANGLES,0,3); // seems suspicious to put that here, should probably be in the loop -#else - glEnd(); -#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) - -#else - - PSPVertex3D* vertices = (PSPVertex3D*) sceGuGetMemory(mModel->numTriangles * 3 * sizeof(PSPVertex3D)); - - int n = 0; - for (i = 0; i < mModel->numTriangles; i++) - { - // get first points of each frame - x1 = pointList[mModel->triIndex[i].meshIndex[0]].x; - y1 = pointList[mModel->triIndex[i].meshIndex[0]].y; - z1 = pointList[mModel->triIndex[i].meshIndex[0]].z; - x2 = nextPointList[mModel->triIndex[i].meshIndex[0]].x; - y2 = nextPointList[mModel->triIndex[i].meshIndex[0]].y; - z2 = nextPointList[mModel->triIndex[i].meshIndex[0]].z; - - // store first interpolated vertex of triangle - vertex[0].x = x1 + mModel->interpol * (x2 - x1); - vertex[0].y = y1 + mModel->interpol * (y2 - y1); - vertex[0].z = z1 + mModel->interpol * (z2 - z1); - - // get second points of each frame - x1 = pointList[mModel->triIndex[i].meshIndex[2]].x; - y1 = pointList[mModel->triIndex[i].meshIndex[2]].y; - z1 = pointList[mModel->triIndex[i].meshIndex[2]].z; - x2 = nextPointList[mModel->triIndex[i].meshIndex[2]].x; - y2 = nextPointList[mModel->triIndex[i].meshIndex[2]].y; - z2 = nextPointList[mModel->triIndex[i].meshIndex[2]].z; - - // store second interpolated vertex of triangle - vertex[2].x = x1 + mModel->interpol * (x2 - x1); - vertex[2].y = y1 + mModel->interpol * (y2 - y1); - vertex[2].z = z1 + mModel->interpol * (z2 - z1); - - // get third points of each frame - x1 = pointList[mModel->triIndex[i].meshIndex[1]].x; - y1 = pointList[mModel->triIndex[i].meshIndex[1]].y; - z1 = pointList[mModel->triIndex[i].meshIndex[1]].z; - x2 = nextPointList[mModel->triIndex[i].meshIndex[1]].x; - y2 = nextPointList[mModel->triIndex[i].meshIndex[1]].y; - z2 = nextPointList[mModel->triIndex[i].meshIndex[1]].z; - - // store third interpolated vertex of triangle - vertex[1].x = x1 + mModel->interpol * (x2 - x1); - vertex[1].y = y1 + mModel->interpol * (y2 - y1); - vertex[1].z = z1 + mModel->interpol * (z2 - z1); - - - //CalculateNormal(&vertices[n].normal, - // vertex[0].v, - // vertex[2].v, - // vertex[1].v); - - vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[0]].s; - vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[0]].t; - - vertices[n].pos.x = vertex[0].x; - vertices[n].pos.y = vertex[0].y; - vertices[n].pos.z = vertex[0].z; - n++; - - //vertices[n].normal.x = vertices[n-1].normal.x; - //vertices[n].normal.y = vertices[n-1].normal.y; - //vertices[n].normal.z = vertices[n-1].normal.z; - - vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[2]].s; - vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[2]].t; - - vertices[n].pos.x = vertex[2].x; - vertices[n].pos.y = vertex[2].y; - vertices[n].pos.z = vertex[2].z; - n++; - - - //vertices[n].normal.x = vertices[n-1].normal.x; - //vertices[n].normal.y = vertices[n-1].normal.y; - //vertices[n].normal.z = vertices[n-1].normal.z; - - vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[1]].s; - vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[1]].t; - - vertices[n].pos.x = vertex[1].x; - vertices[n].pos.y = vertex[1].y; - vertices[n].pos.z = vertex[1].z; - n++; - - } - - sceGuColor(0xff000000); - sceGumDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_3D,mModel->numTriangles*3,0,vertices); - -#endif - -// mModel->interpol += percent; // increase percentage of interpolation between frames -} - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#include "../include/JFileSystem.h" +#include "../include/JRenderer.h" +#include "../include/JMD2Model.h" + + +MD2Animation::MD2Animation(int start, int end) +{ + mStartFrame = start; + mEndFrame = end; +} + +JRenderer* JMD2Model::mRenderer = NULL; + + +//------------------------------------------------------------------------------------------------- +JMD2Model::JMD2Model() +{ + mRenderer = JRenderer::GetInstance(); + + int endFrames[] = { 39, 46, 60, 66, 73, 95, 112, 122, 135, 154, 161, 169, 177, 185, 190, 198 }; + int startFrame = 0; + + mAnimations = (MD2Animation **)malloc(sizeof(MD2Animation)*MAX_ANIMATION); + for (int i=0;itriIndex != NULL) + free(mModel->triIndex); + if (mModel->pointList != NULL) + free(mModel->pointList); + if (mModel->st != NULL) + free(mModel->st); + if (mModel->modelTex != NULL) + delete mModel->modelTex; + + free(mModel); + } + + if (mAnimations) + { + for (int i=0;iOpenFile(filename)) + return false; + //filePtr = fopen(filename, "rb"); + //if (filePtr == NULL) + // return false; + + // find length of file + //fseek(filePtr, 0, SEEK_END); + //fileLen = ftell(filePtr); + //fseek(filePtr, 0, SEEK_SET); + + fileLen = fileSystem->GetFileSize(); + + // read entire file into buffer + buffer = (char*)malloc(fileLen + 1); + //fread(buffer, sizeof(char), fileLen, filePtr); + fileSystem->ReadFile(buffer, fileLen); + fileSystem->CloseFile(); + + // extract model file header from buffer + modelHeader = (modelHeader_t*)buffer; + + // allocate memory for model data + mModel = (modelData_t*)malloc(sizeof(modelData_t)); + if (mModel == NULL) + return false; + + // allocate memory for all vertices used in model, including animations + mModel->pointList = (Vector3D *)malloc(sizeof(Vector3D)*modelHeader->numXYZ * modelHeader->numFrames); + + // store vital model data + mModel->numPoints = modelHeader->numXYZ; + mModel->numFrames = modelHeader->numFrames; + mModel->frameSize = modelHeader->framesize; + + // loop number of frames in model file + for(j = 0; j < modelHeader->numFrames; j++) + { + // offset to the points in this frame + frame = (frame_t*)&buffer[modelHeader->offsetFrames + modelHeader->framesize * j]; + + // calculate the point positions based on frame details + pointListPtr = (Vector3D *)&mModel->pointList[modelHeader->numXYZ * j]; + for(i = 0; i < modelHeader->numXYZ; i++) + { + pointListPtr[i].x = frame->scale[0] * frame->fp[i].v[0] + frame->translate[0]; + pointListPtr[i].y = frame->scale[1] * frame->fp[i].v[1] + frame->translate[1]; + pointListPtr[i].z = frame->scale[2] * frame->fp[i].v[2] + frame->translate[2]; + } + } + + JTexture *tex = mRenderer->LoadTexture(textureName); + if (tex) + mModel->modelTex = tex; + else + { + free(mModel); + mModel = NULL; + + free(buffer); + return false; + } + + float texWidth = (float)tex->mWidth; + float texHeight = (float)tex->mHeight; + + + // allocate memory for the model texture coordinates + mModel->st = (texCoord_t*)malloc(sizeof(texCoord_t)*modelHeader->numST); + + // store number of texture coordinates + mModel->numST = modelHeader->numST; + + // set texture pointer to texture coordinate offset + stPtr = (stIndex_t*)&buffer[modelHeader->offsetST]; + + // calculate and store the texture coordinates for the model + for (i = 0; i < modelHeader->numST; i++) + { + mModel->st[i].s = (float)stPtr[i].s / texWidth; + mModel->st[i].t = (float)stPtr[i].t / texHeight; + } + + // allocate an index of triangles + triIndex = (mesh_t*)malloc(sizeof(mesh_t) * modelHeader->numTris); + + // set total number of triangles + mModel->numTriangles = modelHeader->numTris; + mModel->triIndex = triIndex; + + // point to triangle indexes in buffer + bufIndexPtr = (mesh_t*)&buffer[modelHeader->offsetTris]; + + // create a mesh (triangle) list + for (j = 0; j < mModel->numFrames; j++) + { + // for all triangles in each frame + for(i = 0; i < modelHeader->numTris; i++) + { + triIndex[i].meshIndex[0] = bufIndexPtr[i].meshIndex[0]; + triIndex[i].meshIndex[1] = bufIndexPtr[i].meshIndex[1]; + triIndex[i].meshIndex[2] = bufIndexPtr[i].meshIndex[2]; + triIndex[i].stIndex[0] = bufIndexPtr[i].stIndex[0]; + triIndex[i].stIndex[1] = bufIndexPtr[i].stIndex[1]; + triIndex[i].stIndex[2] = bufIndexPtr[i].stIndex[2]; + } + } + + // close file and free memory + //fclose(filePtr); + free(buffer); + + mModel->currentFrame = 0; + mModel->nextFrame = 1; + mModel->interpol = 0.0; + + CheckNextState(); + + return true; +} + + +//------------------------------------------------------------------------------------------------- +// given 3 points, calculates the normal to the points +#if defined (WIN32) || defined (LINUX) || defined (IOS) +void JMD2Model::CalculateNormal(float *p1, float *p2, float *p3) +#else +void JMD2Model::CalculateNormal(ScePspFVector3 *normal, float *p1, float *p2, float *p3) +#endif +{ + float a[3], b[3], result[3]; + float length; + + a[0] = p1[0] - p2[0]; + a[1] = p1[1] - p2[1]; + a[2] = p1[2] - p2[2]; + + b[0] = p1[0] - p3[0]; + b[1] = p1[1] - p3[1]; + b[2] = p1[2] - p3[2]; + + result[0] = a[1] * b[2] - b[1] * a[2]; + result[1] = b[0] * a[2] - a[0] * b[2]; + result[2] = a[0] * b[1] - b[0] * a[1]; + + // calculate the length of the normal + length = (float)sqrt(result[0]*result[0] + result[1]*result[1] + result[2]*result[2]); + +#if defined (WIN32) || defined (LINUX) || defined (IOS) + // normalize and specify the normal +#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0) + glNormal3f(result[0]/length, result[1]/length, result[2]/length); +#else + // FIXME +#endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0) + +#else + if (length == 0.0f) + length = SMALLEST_FP; + + normal->x = result[0]/length; + normal->y = result[1]/length; + normal->z = result[2]/length; +#endif + +} + + +//------------------------------------------------------------------------------------------------- +// render a single frame of a MD2 model +void JMD2Model::Render(int frameNum) +{ + Vector3D *pointList; + int i; + + // create a pointer to the frame we want to show + pointList = &mModel->pointList[mModel->numPoints * frameNum]; + + // set the texture + mRenderer->BindTexture(mModel->modelTex); + + +#if defined (WIN32) || defined (LINUX) || defined (IOS) + + // display the textured model with proper lighting normals +#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + +#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + +#else + glBegin(GL_TRIANGLES); +#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + + for(i = 0; i < mModel->numTriangles; i++) + { + CalculateNormal(pointList[mModel->triIndex[i].meshIndex[0]].v, + pointList[mModel->triIndex[i].meshIndex[2]].v, + pointList[mModel->triIndex[i].meshIndex[1]].v); + +#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + +#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) + float vertex_data[]={ + pointList[mModel->triIndex[i].meshIndex[0]].x, pointList[mModel->triIndex[i].meshIndex[0]].y, pointList[mModel->triIndex[i].meshIndex[0]].z, + pointList[mModel->triIndex[i].meshIndex[2]].x, pointList[mModel->triIndex[i].meshIndex[2]].y, pointList[mModel->triIndex[i].meshIndex[2]].z, + pointList[mModel->triIndex[i].meshIndex[1]].x, pointList[mModel->triIndex[i].meshIndex[1]].y, pointList[mModel->triIndex[i].meshIndex[1]].z, + }; + float texcoord_data[] = { + mModel->st[mModel->triIndex[i].stIndex[0]].s, + mModel->st[mModel->triIndex[i].stIndex[0]].t, + mModel->st[mModel->triIndex[i].stIndex[2]].s, + mModel->st[mModel->triIndex[i].stIndex[2]].t, + mModel->st[mModel->triIndex[i].stIndex[1]].s, + mModel->st[mModel->triIndex[i].stIndex[1]].t, + }; + + glVertexPointer(3,GL_FLOAT,0,vertex_data); + glTexCoordPointer(2,GL_FLOAT,0,texcoord_data); + +#else + glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[0]].s, + mModel->st[mModel->triIndex[i].stIndex[0]].t); + glVertex3fv(pointList[mModel->triIndex[i].meshIndex[0]].v); + + glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[2]].s , + mModel->st[mModel->triIndex[i].stIndex[2]].t); + glVertex3fv(pointList[mModel->triIndex[i].meshIndex[2]].v); + + glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[1]].s, + mModel->st[mModel->triIndex[i].stIndex[1]].t); + glVertex3fv(pointList[mModel->triIndex[i].meshIndex[1]].v); +#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0) + } +#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + +#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) + glDrawArrays(GL_TRIANGLES,0,3); // seems suspicious to put that here, should probably be in the loop +#else + glEnd(); +#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + + +#else + + PSPVertex3D* vertices = (PSPVertex3D*) sceGuGetMemory(mModel->numTriangles * 3 * sizeof(PSPVertex3D)); + + int n = 0; + for(i = 0; i < mModel->numTriangles; i++) + { + //CalculateNormal(&vertices[n].normal, + // pointList[mModel->triIndex[i].meshIndex[0]].v, + // pointList[mModel->triIndex[i].meshIndex[2]].v, + // pointList[mModel->triIndex[i].meshIndex[1]].v); + + vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[0]].s; + vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[0]].t; + + vertices[n].pos.x = pointList[mModel->triIndex[i].meshIndex[0]].x; + vertices[n].pos.y = pointList[mModel->triIndex[i].meshIndex[0]].y; + vertices[n].pos.z = pointList[mModel->triIndex[i].meshIndex[0]].z; + n++; + + //vertices[n].normal.x = vertices[n-1].normal.x; + //vertices[n].normal.y = vertices[n-1].normal.y; + //vertices[n].normal.z = vertices[n-1].normal.z; + + vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[2]].s; + vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[2]].t; + + vertices[n].pos.x = pointList[mModel->triIndex[i].meshIndex[2]].x; + vertices[n].pos.y = pointList[mModel->triIndex[i].meshIndex[2]].y; + vertices[n].pos.z = pointList[mModel->triIndex[i].meshIndex[2]].z; + n++; + + + //vertices[n].normal.x = vertices[n-1].normal.x; + //vertices[n].normal.y = vertices[n-1].normal.y; + //vertices[n].normal.z = vertices[n-1].normal.z; + + vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[1]].s; + vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[1]].t; + + vertices[n].pos.x = pointList[mModel->triIndex[i].meshIndex[1]].x; + vertices[n].pos.y = pointList[mModel->triIndex[i].meshIndex[1]].y; + vertices[n].pos.z = pointList[mModel->triIndex[i].meshIndex[1]].z; + n++; + + + } + + + sceGuColor(0xff000000); + sceGumDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_NORMAL_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_3D,mModel->numTriangles*3,0,vertices); + + +#endif + +} + + +//------------------------------------------------------------------------------------------------- +void JMD2Model::SetState(int newState) +{ + mNextState = newState; + +} + + +//------------------------------------------------------------------------------------------------- +void JMD2Model::CheckNextState() +{ + if (mState != mNextState) + { + mState = mNextState; + mModel->currentFrame = mAnimations[mState]->mStartFrame; + mModel->nextFrame = mAnimations[mState]->mStartFrame+1; + mModel->interpol = 0.0f; + } +} + + +void JMD2Model::Update(float dt) +{ + + mModel->interpol += mAnimationSpeed*dt; + + if (mModel->interpol >= 1.0) + { + mModel->interpol = 0.0f; + + int startFrame = mAnimations[mState]->mStartFrame; + int endFrame = mAnimations[mState]->mEndFrame; + + if ( (startFrame < 0) || (endFrame < 0) ) + return; + + if ( (startFrame >= mModel->numFrames) || (endFrame >= mModel->numFrames) ) + return; + + mModel->currentFrame++; + if (mModel->currentFrame >= endFrame) + mModel->currentFrame = startFrame; + + mModel->nextFrame = mModel->currentFrame + 1; + + if (mModel->nextFrame >= endFrame) + { + mModel->nextFrame = startFrame; + CheckNextState(); + } + } + +} + + +void JMD2Model::SetAnimationSpeed(float speed) +{ + mAnimationSpeed = speed; +} + + +//------------------------------------------------------------------------------------------------- +// displays a frame of the model between startFrame and endFrame with an interpolation percent +void JMD2Model::Render() +{ + + CheckNextState(); + + Vector3D *pointList; // current frame vertices + Vector3D *nextPointList; // next frame vertices + int i; + float x1, y1, z1; // current frame point values + float x2, y2, z2; // next frame point values + + Vector3D vertex[3]; + + if (mModel == NULL) + return; + + pointList = &mModel->pointList[mModel->numPoints*mModel->currentFrame]; + nextPointList = &mModel->pointList[mModel->numPoints*mModel->nextFrame]; + + mRenderer->BindTexture(mModel->modelTex); + +#if defined (WIN32) || defined (LINUX) || defined (IOS) + +#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + // FIXME +#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); +#else + glBegin(GL_TRIANGLES); +#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + + for (i = 0; i < mModel->numTriangles; i++) + { + // get first points of each frame + x1 = pointList[mModel->triIndex[i].meshIndex[0]].x; + y1 = pointList[mModel->triIndex[i].meshIndex[0]].y; + z1 = pointList[mModel->triIndex[i].meshIndex[0]].z; + x2 = nextPointList[mModel->triIndex[i].meshIndex[0]].x; + y2 = nextPointList[mModel->triIndex[i].meshIndex[0]].y; + z2 = nextPointList[mModel->triIndex[i].meshIndex[0]].z; + + // store first interpolated vertex of triangle + vertex[0].x = x1 + mModel->interpol * (x2 - x1); + vertex[0].y = y1 + mModel->interpol * (y2 - y1); + vertex[0].z = z1 + mModel->interpol * (z2 - z1); + + // get second points of each frame + x1 = pointList[mModel->triIndex[i].meshIndex[2]].x; + y1 = pointList[mModel->triIndex[i].meshIndex[2]].y; + z1 = pointList[mModel->triIndex[i].meshIndex[2]].z; + x2 = nextPointList[mModel->triIndex[i].meshIndex[2]].x; + y2 = nextPointList[mModel->triIndex[i].meshIndex[2]].y; + z2 = nextPointList[mModel->triIndex[i].meshIndex[2]].z; + + // store second interpolated vertex of triangle + vertex[2].x = x1 + mModel->interpol * (x2 - x1); + vertex[2].y = y1 + mModel->interpol * (y2 - y1); + vertex[2].z = z1 + mModel->interpol * (z2 - z1); + + // get third points of each frame + x1 = pointList[mModel->triIndex[i].meshIndex[1]].x; + y1 = pointList[mModel->triIndex[i].meshIndex[1]].y; + z1 = pointList[mModel->triIndex[i].meshIndex[1]].z; + x2 = nextPointList[mModel->triIndex[i].meshIndex[1]].x; + y2 = nextPointList[mModel->triIndex[i].meshIndex[1]].y; + z2 = nextPointList[mModel->triIndex[i].meshIndex[1]].z; + + // store third interpolated vertex of triangle + vertex[1].x = x1 + mModel->interpol * (x2 - x1); + vertex[1].y = y1 + mModel->interpol * (y2 - y1); + vertex[1].z = z1 + mModel->interpol * (z2 - z1); + + // calculate the normal of the triangle + //CalculateNormal(vertex[0].v, vertex[2].v, vertex[1].v); + + // render properly textured triangle + +#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + // FIXME +#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) + float vertex_data[]={ + vertex[0].x, vertex[0].y, vertex[0].z, + vertex[2].x, vertex[2].y, vertex[2].z, + vertex[1].x, vertex[1].y, vertex[1].z, + }; + float texcoord_data[] = { + mModel->st[mModel->triIndex[i].stIndex[0]].s, + mModel->st[mModel->triIndex[i].stIndex[0]].t, + mModel->st[mModel->triIndex[i].stIndex[2]].s, + mModel->st[mModel->triIndex[i].stIndex[2]].t, + mModel->st[mModel->triIndex[i].stIndex[1]].s, + mModel->st[mModel->triIndex[i].stIndex[1]].t, + }; + + glVertexPointer(3,GL_FLOAT,0,vertex_data); + glTexCoordPointer(2,GL_FLOAT,0,texcoord_data); +#else + glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[0]].s, + mModel->st[mModel->triIndex[i].stIndex[0]].t); + glVertex3fv(vertex[0].v); + + glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[2]].s , + mModel->st[mModel->triIndex[i].stIndex[2]].t); + glVertex3fv(vertex[2].v); + + glTexCoord2f(mModel->st[mModel->triIndex[i].stIndex[1]].s, + mModel->st[mModel->triIndex[i].stIndex[1]].t); + glVertex3fv(vertex[1].v); +#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + + } +#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + // FIXME +#elif (defined GL_ES_VERSION_1_1) || (defined GL_VERSION_1_1) + glDrawArrays(GL_TRIANGLES,0,3); // seems suspicious to put that here, should probably be in the loop +#else + glEnd(); +#endif //(defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) + +#else + + PSPVertex3D* vertices = (PSPVertex3D*) sceGuGetMemory(mModel->numTriangles * 3 * sizeof(PSPVertex3D)); + + int n = 0; + for (i = 0; i < mModel->numTriangles; i++) + { + // get first points of each frame + x1 = pointList[mModel->triIndex[i].meshIndex[0]].x; + y1 = pointList[mModel->triIndex[i].meshIndex[0]].y; + z1 = pointList[mModel->triIndex[i].meshIndex[0]].z; + x2 = nextPointList[mModel->triIndex[i].meshIndex[0]].x; + y2 = nextPointList[mModel->triIndex[i].meshIndex[0]].y; + z2 = nextPointList[mModel->triIndex[i].meshIndex[0]].z; + + // store first interpolated vertex of triangle + vertex[0].x = x1 + mModel->interpol * (x2 - x1); + vertex[0].y = y1 + mModel->interpol * (y2 - y1); + vertex[0].z = z1 + mModel->interpol * (z2 - z1); + + // get second points of each frame + x1 = pointList[mModel->triIndex[i].meshIndex[2]].x; + y1 = pointList[mModel->triIndex[i].meshIndex[2]].y; + z1 = pointList[mModel->triIndex[i].meshIndex[2]].z; + x2 = nextPointList[mModel->triIndex[i].meshIndex[2]].x; + y2 = nextPointList[mModel->triIndex[i].meshIndex[2]].y; + z2 = nextPointList[mModel->triIndex[i].meshIndex[2]].z; + + // store second interpolated vertex of triangle + vertex[2].x = x1 + mModel->interpol * (x2 - x1); + vertex[2].y = y1 + mModel->interpol * (y2 - y1); + vertex[2].z = z1 + mModel->interpol * (z2 - z1); + + // get third points of each frame + x1 = pointList[mModel->triIndex[i].meshIndex[1]].x; + y1 = pointList[mModel->triIndex[i].meshIndex[1]].y; + z1 = pointList[mModel->triIndex[i].meshIndex[1]].z; + x2 = nextPointList[mModel->triIndex[i].meshIndex[1]].x; + y2 = nextPointList[mModel->triIndex[i].meshIndex[1]].y; + z2 = nextPointList[mModel->triIndex[i].meshIndex[1]].z; + + // store third interpolated vertex of triangle + vertex[1].x = x1 + mModel->interpol * (x2 - x1); + vertex[1].y = y1 + mModel->interpol * (y2 - y1); + vertex[1].z = z1 + mModel->interpol * (z2 - z1); + + + //CalculateNormal(&vertices[n].normal, + // vertex[0].v, + // vertex[2].v, + // vertex[1].v); + + vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[0]].s; + vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[0]].t; + + vertices[n].pos.x = vertex[0].x; + vertices[n].pos.y = vertex[0].y; + vertices[n].pos.z = vertex[0].z; + n++; + + //vertices[n].normal.x = vertices[n-1].normal.x; + //vertices[n].normal.y = vertices[n-1].normal.y; + //vertices[n].normal.z = vertices[n-1].normal.z; + + vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[2]].s; + vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[2]].t; + + vertices[n].pos.x = vertex[2].x; + vertices[n].pos.y = vertex[2].y; + vertices[n].pos.z = vertex[2].z; + n++; + + + //vertices[n].normal.x = vertices[n-1].normal.x; + //vertices[n].normal.y = vertices[n-1].normal.y; + //vertices[n].normal.z = vertices[n-1].normal.z; + + vertices[n].texture.x = mModel->st[mModel->triIndex[i].stIndex[1]].s; + vertices[n].texture.y = mModel->st[mModel->triIndex[i].stIndex[1]].t; + + vertices[n].pos.x = vertex[1].x; + vertices[n].pos.y = vertex[1].y; + vertices[n].pos.z = vertex[1].z; + n++; + + } + + sceGuColor(0xff000000); + sceGumDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_3D,mModel->numTriangles*3,0,vertices); + +#endif + +// mModel->interpol += percent; // increase percentage of interpolation between frames +} + diff --git a/JGE/src/JOBJModel.cpp b/JGE/src/JOBJModel.cpp index 376341a19..07ba098a1 100644 --- a/JGE/src/JOBJModel.cpp +++ b/JGE/src/JOBJModel.cpp @@ -1,222 +1,222 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#include "../include/JTypes.h" -#include "../include/JFileSystem.h" -#include "../include/JRenderer.h" -#include "../include/JOBJModel.h" - -JOBJModel::JOBJModel() -{ - mPolygons = NULL; - mTexture = NULL; -} - -JOBJModel::~JOBJModel() -{ - if (mPolygons) - delete [] mPolygons; - - if (mTexture) - delete mTexture; -} - -int JOBJModel::ReadLine(char *output, const char *buffer, int start, int size) -{ - int index = 0; - while (start < size && buffer[start] != '\n' && buffer[start] != '\r') - output[index++] = buffer[start++]; - - while ((start < size && buffer[start] == '\n') || buffer[start] == '\r') - start++; - - output[index] = 0; - - return start; - -} - -bool JOBJModel::Load(const char *modelName, const char *textureName) -{ - - JFileSystem* fileSys = JFileSystem::GetInstance(); - if (!fileSys->OpenFile(modelName)) - return false; - - int size = fileSys->GetFileSize(); - char *buffer = new char[size]; - - fileSys->ReadFile(buffer, size); - fileSys->CloseFile(); - - Vector3D vert; - - vector faceList; - vector normalList; - vector texList; - vector vertList; - - normalList.reserve(32); - texList.reserve(32); - vertList.reserve(32); - faceList.reserve(32); - - int filePtr = 0; - - char tmpLine[256]; - char s1[256]; - - int count; - - while (filePtr < size) - { - filePtr = ReadLine(tmpLine, buffer, filePtr, size); - { - - if ((tmpLine[0] == '#') || (strlen(tmpLine) < 3)) - { - } - else if (tmpLine[0] == 'v') - { - count = sscanf(tmpLine, "%s %f %f %f", s1, &vert.x, &vert.y, &vert.z); - - if (count == 4) - { - if (strcmp(s1, "vn") == 0) - normalList.push_back(vert); - else if (strcmp(s1, "vt") == 0) - texList.push_back(vert); - else if (strcmp(s1, "v") == 0) - vertList.push_back(vert); - } - else if (count == 3) - { - if (strcmp(s1, "vt") == 0) - texList.push_back(vert); - } - - } - else if (tmpLine[0] == 'f') - { - Face face; - face.mVertCount = 0; - - char *p = strchr(tmpLine, ' '); - char *pNext = p; - - int vertIdx, texIdx, norIdx; - - while (p != NULL) - { - while (((*p) == ' ') || ((*p) == '\n') || ((*p) == '\t')) - ++p; - strcpy(s1, p); - count = sscanf(s1, "%d/%d/%d", &vertIdx, &texIdx, &norIdx); - if (count == 3) - { - if (face.mVertCount < 4) - { - face.mVertIdx[face.mVertCount] = vertIdx - 1; - face.mTexIdx[face.mVertCount] = texIdx - 1; - face.mNormalIdx[face.mVertCount] = norIdx - 1; - face.mVertCount++; - } - } - else if (count == 2) - { - if (face.mVertCount < 4) - { - face.mVertIdx[face.mVertCount] = vertIdx - 1; - face.mTexIdx[face.mVertCount] = texIdx - 1; - face.mNormalIdx[face.mVertCount] = 0; - face.mVertCount++; - } - } - else if (count == 1) - { - if (face.mVertCount < 4) - { - face.mVertIdx[face.mVertCount] = vertIdx - 1; - face.mTexIdx[face.mVertCount] = 0; - face.mNormalIdx[face.mVertCount] = 0; - face.mVertCount++; - } - } - - pNext = strchr(p, ' '); - p = pNext; - } - - if (face.mVertCount == 3) // we do triangles only ;) - faceList.push_back(face); - } - else if (tmpLine[0] == 'g') - { - - } - else if (tmpLine[0] == 'u') - { - } - - } - } - - mPolycount = faceList.size(); - mPolygons = new Vertex3D[mPolycount*3]; - - int idx = 0; - for (int i=0;iLoadTexture(textureName); - - return true; - -} - - -void JOBJModel::Render() -{ - JRenderer::GetInstance()->RenderTriangles(mTexture, mPolygons, 0, mPolycount); -} +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#include "../include/JTypes.h" +#include "../include/JFileSystem.h" +#include "../include/JRenderer.h" +#include "../include/JOBJModel.h" + +JOBJModel::JOBJModel() +{ + mPolygons = NULL; + mTexture = NULL; +} + +JOBJModel::~JOBJModel() +{ + if (mPolygons) + delete [] mPolygons; + + if (mTexture) + delete mTexture; +} + +int JOBJModel::ReadLine(char *output, const char *buffer, int start, int size) +{ + int index = 0; + while (start < size && buffer[start] != '\n' && buffer[start] != '\r') + output[index++] = buffer[start++]; + + while ((start < size && buffer[start] == '\n') || buffer[start] == '\r') + start++; + + output[index] = 0; + + return start; + +} + +bool JOBJModel::Load(const char *modelName, const char *textureName) +{ + + JFileSystem* fileSys = JFileSystem::GetInstance(); + if (!fileSys->OpenFile(modelName)) + return false; + + int size = fileSys->GetFileSize(); + char *buffer = new char[size]; + + fileSys->ReadFile(buffer, size); + fileSys->CloseFile(); + + Vector3D vert; + + vector faceList; + vector normalList; + vector texList; + vector vertList; + + normalList.reserve(32); + texList.reserve(32); + vertList.reserve(32); + faceList.reserve(32); + + int filePtr = 0; + + char tmpLine[256]; + char s1[256]; + + int count; + + while (filePtr < size) + { + filePtr = ReadLine(tmpLine, buffer, filePtr, size); + { + + if ((tmpLine[0] == '#') || (strlen(tmpLine) < 3)) + { + } + else if (tmpLine[0] == 'v') + { + count = sscanf(tmpLine, "%s %f %f %f", s1, &vert.x, &vert.y, &vert.z); + + if (count == 4) + { + if (strcmp(s1, "vn") == 0) + normalList.push_back(vert); + else if (strcmp(s1, "vt") == 0) + texList.push_back(vert); + else if (strcmp(s1, "v") == 0) + vertList.push_back(vert); + } + else if (count == 3) + { + if (strcmp(s1, "vt") == 0) + texList.push_back(vert); + } + + } + else if (tmpLine[0] == 'f') + { + Face face; + face.mVertCount = 0; + + char *p = strchr(tmpLine, ' '); + char *pNext = p; + + int vertIdx, texIdx, norIdx; + + while (p != NULL) + { + while (((*p) == ' ') || ((*p) == '\n') || ((*p) == '\t')) + ++p; + strcpy(s1, p); + count = sscanf(s1, "%d/%d/%d", &vertIdx, &texIdx, &norIdx); + if (count == 3) + { + if (face.mVertCount < 4) + { + face.mVertIdx[face.mVertCount] = vertIdx - 1; + face.mTexIdx[face.mVertCount] = texIdx - 1; + face.mNormalIdx[face.mVertCount] = norIdx - 1; + face.mVertCount++; + } + } + else if (count == 2) + { + if (face.mVertCount < 4) + { + face.mVertIdx[face.mVertCount] = vertIdx - 1; + face.mTexIdx[face.mVertCount] = texIdx - 1; + face.mNormalIdx[face.mVertCount] = 0; + face.mVertCount++; + } + } + else if (count == 1) + { + if (face.mVertCount < 4) + { + face.mVertIdx[face.mVertCount] = vertIdx - 1; + face.mTexIdx[face.mVertCount] = 0; + face.mNormalIdx[face.mVertCount] = 0; + face.mVertCount++; + } + } + + pNext = strchr(p, ' '); + p = pNext; + } + + if (face.mVertCount == 3) // we do triangles only ;) + faceList.push_back(face); + } + else if (tmpLine[0] == 'g') + { + + } + else if (tmpLine[0] == 'u') + { + } + + } + } + + mPolycount = faceList.size(); + mPolygons = new Vertex3D[mPolycount*3]; + + int idx = 0; + for (int i=0;iLoadTexture(textureName); + + return true; + +} + + +void JOBJModel::Render() +{ + JRenderer::GetInstance()->RenderTriangles(mTexture, mPolygons, 0, mPolycount); +} diff --git a/JGE/src/JParticle.cpp b/JGE/src/JParticle.cpp index 1a91d2e0b..201c31259 100644 --- a/JGE/src/JParticle.cpp +++ b/JGE/src/JParticle.cpp @@ -1,246 +1,246 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - - -//#include "JApp.h" -#include "../include/JGE.h" - -#include "../include/JParticle.h" - - - -JParticleData::JParticleData() -{ - Clear(); -} - -void JParticleData::Clear() -{ - mCurr = 0.0f; - mTarget = 0.0f; - mDelta = 0.0f; - mKeyCount = 0; - mKeyIndex = 0; - mTimer = 0.0f; - mScale = 1.0f; -} - -void JParticleData::Init() -{ - mKeyIndex = 0; - mDelta = 0.0f; - mTimer = 0.0f; - if (mKeyCount > 0) - { - mCurr = mKeyValue[mKeyIndex++]; - - if (mKeyIndex < mKeyCount) - { - mTimer = mKeyTime[mKeyIndex]*mScale-mKeyTime[mKeyIndex-1]*mScale; - mTarget = mKeyValue[mKeyIndex]; - mDelta = (mTarget-mCurr)/mTimer; - mKeyIndex++; - } - } -} - -void JParticleData::AddKey(float keyTime, float keyValue) -{ - if (mKeyCount < MAX_KEYS) - { - mKeyTime[mKeyCount] = keyTime; - mKeyValue[mKeyCount] = keyValue; - mKeyCount++; - } -} - -void JParticleData::Update(float dt) -{ - mCurr += mDelta*dt; - if (mDelta < 0.0f) - { - if (mCurr < mTarget) - mCurr = mTarget; - - } - else if (mDelta > 0.0f) - { - if (mCurr > mTarget) - mCurr = mTarget; - } - - mTimer -= dt; - - if (mTimer <= 0.0f) - { - if (mKeyIndex < mKeyCount) - { - mTimer = mKeyTime[mKeyIndex]*mScale-mKeyTime[mKeyIndex-1]*mScale; - mTarget = mKeyValue[mKeyIndex]; - mDelta = (mTarget-mCurr)/mTimer; - mKeyIndex++; - } - else - mDelta = 0.0f; - } -} - -void JParticleData::SetScale(float scale) -{ - mScale = scale; -} - - -JRenderer* JParticle::mRenderer = NULL; - -JParticleData* JParticle::GetField(int index) -{ - if (index < FIELD_COUNT) - return &mData[index]; - else - return NULL; -} - - -JParticleData* JParticle::GetDataPtr() -{ - return mData; -} - -JParticle::JParticle()//JQuad* texture, float x, float y) -{ - mRenderer = JRenderer::GetInstance(); - - //mTexture = texture; - mOrigin = Vector2D(0.0f, 0.0f); - mPos = Vector2D(0.0f, 0.0f); - mVelocity = Vector2D(0.0f, 0.0f); - - mActive = false; - mQuad = NULL; - -// mNext = NULL; -// mPrev = NULL; -} - - -JParticle::~JParticle() -{ - //JGERelease(); -} - - -bool JParticle::Update(float dt) -{ - - for (int i=0;ivecLocation-vecLocation; - vecAccel.Normalize(); - Vector2D vecAccel2 = vecAccel; - vecAccel *= mData[FIELD_RADIAL_ACCEL].mCurr; //par->fRadialAccel; - - // vecAccel2.Rotate(M_PI_2); - // the following is faster - float ang = vecAccel2.x; - vecAccel2.x = -vecAccel2.y; - vecAccel2.y = ang; - - vecAccel2 *= mData[FIELD_TANGENTIAL_ACCEL].mCurr; //par->fTangentialAccel; - mVelocity += (vecAccel+vecAccel2)*dt; //par->vecVelocity += (vecAccel+vecAccel2)*fDeltaTime; - mVelocity.y += mData[FIELD_GRAVITY].mCurr*dt; //par->vecVelocity.y += par->fGravity*fDeltaTime; - - //par->vecLocation += par->vecVelocity*fDeltaTime; - - ////mPos.x += mData[FIELD_SPEED].mCurr * mVelocity.x * dt; - ////mPos.y += mData[FIELD_SPEED].mCurr * mVelocity.y * dt; - mPos += mVelocity*mData[FIELD_SPEED].mCurr*dt; - - - mLifetime -= dt; - if (mLifetime <= 0.0f) - { - mActive = false; - return false; - } - - - return true; -} - - -void JParticle::Render() -{ - if (mQuad) - { - int a = (int)(mData[FIELD_ALPHA].mCurr*255.0f); - int r = (int)(mData[FIELD_RED].mCurr*255.0f); - int g = (int)(mData[FIELD_GREEN].mCurr*255.0f); - int b = (int)(mData[FIELD_BLUE].mCurr*255.0f); - PIXEL_TYPE color = ARGB(a, r, g, b); - mQuad->SetColor(color); - - mRenderer->RenderQuad(mQuad, mPos.x, mPos.y, mData[FIELD_ROTATION].mCurr, mData[FIELD_SIZE].mCurr*mSize, mData[FIELD_SIZE].mCurr*mSize); - - } -} - - -void JParticle::Init(float lifeTime) -{ - mLifetime = lifeTime; - - for (int i=0;i +// +//------------------------------------------------------------------------------------- + + +//#include "JApp.h" +#include "../include/JGE.h" + +#include "../include/JParticle.h" + + + +JParticleData::JParticleData() +{ + Clear(); +} + +void JParticleData::Clear() +{ + mCurr = 0.0f; + mTarget = 0.0f; + mDelta = 0.0f; + mKeyCount = 0; + mKeyIndex = 0; + mTimer = 0.0f; + mScale = 1.0f; +} + +void JParticleData::Init() +{ + mKeyIndex = 0; + mDelta = 0.0f; + mTimer = 0.0f; + if (mKeyCount > 0) + { + mCurr = mKeyValue[mKeyIndex++]; + + if (mKeyIndex < mKeyCount) + { + mTimer = mKeyTime[mKeyIndex]*mScale-mKeyTime[mKeyIndex-1]*mScale; + mTarget = mKeyValue[mKeyIndex]; + mDelta = (mTarget-mCurr)/mTimer; + mKeyIndex++; + } + } +} + +void JParticleData::AddKey(float keyTime, float keyValue) +{ + if (mKeyCount < MAX_KEYS) + { + mKeyTime[mKeyCount] = keyTime; + mKeyValue[mKeyCount] = keyValue; + mKeyCount++; + } +} + +void JParticleData::Update(float dt) +{ + mCurr += mDelta*dt; + if (mDelta < 0.0f) + { + if (mCurr < mTarget) + mCurr = mTarget; + + } + else if (mDelta > 0.0f) + { + if (mCurr > mTarget) + mCurr = mTarget; + } + + mTimer -= dt; + + if (mTimer <= 0.0f) + { + if (mKeyIndex < mKeyCount) + { + mTimer = mKeyTime[mKeyIndex]*mScale-mKeyTime[mKeyIndex-1]*mScale; + mTarget = mKeyValue[mKeyIndex]; + mDelta = (mTarget-mCurr)/mTimer; + mKeyIndex++; + } + else + mDelta = 0.0f; + } +} + +void JParticleData::SetScale(float scale) +{ + mScale = scale; +} + + +JRenderer* JParticle::mRenderer = NULL; + +JParticleData* JParticle::GetField(int index) +{ + if (index < FIELD_COUNT) + return &mData[index]; + else + return NULL; +} + + +JParticleData* JParticle::GetDataPtr() +{ + return mData; +} + +JParticle::JParticle()//JQuad* texture, float x, float y) +{ + mRenderer = JRenderer::GetInstance(); + + //mTexture = texture; + mOrigin = Vector2D(0.0f, 0.0f); + mPos = Vector2D(0.0f, 0.0f); + mVelocity = Vector2D(0.0f, 0.0f); + + mActive = false; + mQuad = NULL; + +// mNext = NULL; +// mPrev = NULL; +} + + +JParticle::~JParticle() +{ + //JGERelease(); +} + + +bool JParticle::Update(float dt) +{ + + for (int i=0;ivecLocation-vecLocation; + vecAccel.Normalize(); + Vector2D vecAccel2 = vecAccel; + vecAccel *= mData[FIELD_RADIAL_ACCEL].mCurr; //par->fRadialAccel; + + // vecAccel2.Rotate(M_PI_2); + // the following is faster + float ang = vecAccel2.x; + vecAccel2.x = -vecAccel2.y; + vecAccel2.y = ang; + + vecAccel2 *= mData[FIELD_TANGENTIAL_ACCEL].mCurr; //par->fTangentialAccel; + mVelocity += (vecAccel+vecAccel2)*dt; //par->vecVelocity += (vecAccel+vecAccel2)*fDeltaTime; + mVelocity.y += mData[FIELD_GRAVITY].mCurr*dt; //par->vecVelocity.y += par->fGravity*fDeltaTime; + + //par->vecLocation += par->vecVelocity*fDeltaTime; + + ////mPos.x += mData[FIELD_SPEED].mCurr * mVelocity.x * dt; + ////mPos.y += mData[FIELD_SPEED].mCurr * mVelocity.y * dt; + mPos += mVelocity*mData[FIELD_SPEED].mCurr*dt; + + + mLifetime -= dt; + if (mLifetime <= 0.0f) + { + mActive = false; + return false; + } + + + return true; +} + + +void JParticle::Render() +{ + if (mQuad) + { + int a = (int)(mData[FIELD_ALPHA].mCurr*255.0f); + int r = (int)(mData[FIELD_RED].mCurr*255.0f); + int g = (int)(mData[FIELD_GREEN].mCurr*255.0f); + int b = (int)(mData[FIELD_BLUE].mCurr*255.0f); + PIXEL_TYPE color = ARGB(a, r, g, b); + mQuad->SetColor(color); + + mRenderer->RenderQuad(mQuad, mPos.x, mPos.y, mData[FIELD_ROTATION].mCurr, mData[FIELD_SIZE].mCurr*mSize, mData[FIELD_SIZE].mCurr*mSize); + + } +} + + +void JParticle::Init(float lifeTime) +{ + mLifetime = lifeTime; + + for (int i=0;i -// -//------------------------------------------------------------------------------------- - - -#include - -#include "../include/JGE.h" -#include "../include/JParticleSystem.h" -#include "../include/JParticleEffect.h" -#include "../include/JParticleEmitter.h" - -#include "../include/JFileSystem.h" -#include "../include/JResourceManager.h" - -#include "tinyxml/tinyxml.h" - -//------------------------------------------------------------------------------------- - - -JParticleEffect::JParticleEffect(JResourceManager* mgr) -{ - mResourceManager = mgr; - - mX = 0.0f; - mY = 0.0f; - - mEmitterCount = 0; -} - - -JParticleEffect::~JParticleEffect() -{ - for (int i=0;iOpenFile(filename)) return false; - - int size = fileSystem->GetFileSize(); - char *xmlBuffer = new char[size]; - fileSystem->ReadFile(xmlBuffer, size); - - TiXmlDocument doc; - - doc.Parse(xmlBuffer); - - - TiXmlNode* effect = 0; - TiXmlNode* emitter = 0; - TiXmlNode* param = 0; - TiXmlNode* key = 0; - - TiXmlElement* element = 0; - - float keyTime; - float value; - float baseValue; - int int_value; -// -// enum ParticleField -// { -// FIELD_SPEED, -// FIELD_SIZE, -// FIELD_ROTATION, -// FIELD_ALPHA, -// FIELD_RED, -// FIELD_GREEN, -// FIELD_BLUE, -// FIELD_COUNT -// }; - - const char* lifeValues[] = - { - "speed", - "size", - "rotation", - "alpha", - "red", - "green", - "blue", - "radial_accel", - "tangential_accel", - "gravity" - }; - - const char* typeNames[] = - { - "POINT", - "AREA", - "HORIZONTAL", - "VERTICAL", - "CIRCLE" - }; - - const char* modeNames[] = - { - "REPEAT", - "ONCE", - "NTIMES", - "CONTINUOUS" - }; - - ////////////////////////////////////////////////////////////////////////// - // One effect per file only, well, we may extend it later to permit - // multiple effect definitions: - // - // for (effect = doc.FirstChild("effect"); effect; effect = effect->NextSibling()) - // - ////////////////////////////////////////////////////////////////////////// - - effect = doc.FirstChild("effect"); - if (effect) - { - element = effect->ToElement(); - printf("%s:%s\n", element->Value(), element->Attribute("name")); - - - for (emitter = effect->FirstChild("emitter"); emitter && mEmitterCount < MAX_EMITTER; emitter = emitter->NextSibling()) - { - - mParticleEmitters[mEmitterCount] = new JParticleEmitter(this); - element = emitter->ToElement(); - - if (element->QueryFloatAttribute("life", &value) == TIXML_SUCCESS) - mParticleEmitters[mEmitterCount]->mLife = value; - - for (param = emitter->FirstChild(); param; param = param->NextSibling()) - { - element = param->ToElement(); - - if (strcmp(element->Attribute("name"), "settings")==0) - { - - if (strcmp(element->Attribute("blend"), "NORMAL")==0) - mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); - else if (strcmp(element->Attribute("blend"), "ADDITIVE")==0) - mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE); - - for (unsigned int i=0;iAttribute("mode"), modeNames[i])==0) - { - mParticleEmitters[mEmitterCount]->mEmitterMode = i; - #if defined (_DEBUG) - printf("emitter mode:%s\n", modeNames[i]); - #endif - break; - } - } - for (unsigned i=0;iAttribute("type"), typeNames[i])==0) - { - mParticleEmitters[mEmitterCount]->mType = i; - #if defined (_DEBUG) - printf("emitter type:%s\n", typeNames[i]); - #endif - break; - } - } - - string quadName = element->Attribute("image"); - JQuad* quad = mResourceManager->GetQuad(quadName); - if (quad != NULL) - mParticleEmitters[mEmitterCount]->SetQuad(quad); - -// if (element->QueryIntAttribute("image", &int_value) == TIXML_SUCCESS) -// { -// mParticleEmitters[mEmitterCount]->mQuadIndex = int_value; -// -// } - if (element->QueryIntAttribute("width", &int_value) == TIXML_SUCCESS) - { - mParticleEmitters[mEmitterCount]->mWidth = int_value; - - } - if (element->QueryIntAttribute("height", &int_value) == TIXML_SUCCESS) - { - mParticleEmitters[mEmitterCount]->mHeight = int_value; - - } - - if (element->QueryIntAttribute("id", &int_value) == TIXML_SUCCESS) - { - mParticleEmitters[mEmitterCount]->mId = int_value; - - } - - if (element->QueryIntAttribute("repeat_count", &int_value) == TIXML_SUCCESS) - { - mParticleEmitters[mEmitterCount]->mRepeatTimes = int_value; - - } - } - else if (strcmp(element->Attribute("name"), "quantity")==0) - { - for (key = param->FirstChild(); key; key = key->NextSibling()) - { - element = key->ToElement(); - - if (element->QueryFloatAttribute("timeslice", &keyTime) == TIXML_SUCCESS && - element->QueryFloatAttribute("value", &value) == TIXML_SUCCESS) - { - mParticleEmitters[mEmitterCount]->mQuantity.AddKey(keyTime, value); - } - - } - } - else if (strcmp(element->Attribute("name"), "lifex")==0) - { - if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && - element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) - { - mParticleEmitters[mEmitterCount]->mLifeBase = baseValue; - mParticleEmitters[mEmitterCount]->mLifeMax= value; - } - } - else if (strcmp(element->Attribute("name"), "anglex")==0) - { - if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && - element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) - { - mParticleEmitters[mEmitterCount]->mAngleBase = baseValue*DEG2RAD; - mParticleEmitters[mEmitterCount]->mAngleMax= value*DEG2RAD; - } - } - else if (strcmp(element->Attribute("name"), "speedx")==0) - { - if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && - element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) - { - mParticleEmitters[mEmitterCount]->mSpeedBase = baseValue; - mParticleEmitters[mEmitterCount]->mSpeedMax= value; - } - } - else if (strcmp(element->Attribute("name"), "sizex")==0) - { - if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && - element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) - { - mParticleEmitters[mEmitterCount]->mSizeBase = baseValue; - mParticleEmitters[mEmitterCount]->mSizeMax= value; - } - } - else - { - for (int i=0;iAttribute("name"), lifeValues[i])==0) - { - for (key = param->FirstChild(); key; key = key->NextSibling()) - { - element = key->ToElement(); - - if (element->QueryFloatAttribute("lifeslice", &keyTime) == TIXML_SUCCESS && - element->QueryFloatAttribute("value", &value) == TIXML_SUCCESS) - { - if (i==FIELD_ROTATION) - value *= DEG2RAD; - - mParticleEmitters[mEmitterCount]->mData[i].AddKey(keyTime, value); - } - - } - break; - } - } - - } - - - } - - mEmitterCount++; - } - } - - fileSystem->CloseFile(); - delete[] xmlBuffer; - - return true; -} - - -void JParticleEffect::SetParticleSystem(JParticleSystem* particleSys) -{ - mParticleSystem = particleSys; -} - - -void JParticleEffect::SetPosition(float x, float y) -{ - mX = x; - mY = y; -} - - -JParticleSystem* JParticleEffect::GetParticleSystem() -{ - return mParticleSystem; -} - - -float JParticleEffect::GetX() -{ - return mX; -} - - -float JParticleEffect::GetY() -{ - return mY; -} - - -void JParticleEffect::Update(float dt) -{ -// mTimer += dt; - - for (int i=0;iUpdate(dt); -} - -void JParticleEffect::Render() -{ - for (int i=0;iRender(); -} - -bool JParticleEffect::Done() -{ - bool done = true; - for (int i=0;iDone()) - done = false; - - return (done); -} - - -void JParticleEffect::Start() -{ - for (int i=0;iStart(); -} - - -void JParticleEffect::Stop() -{ - - for (int i=0;iSetActive(false); -} - - -void JParticleEffect::MoveTo(float x, float y) -{ - float dx = x - mX; - float dy = y - mY; - - mX = x; - mY = y; - - for (int i=0;iMoveAllParticles(dx, dy); - } -} +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + + +#include + +#include "../include/JGE.h" +#include "../include/JParticleSystem.h" +#include "../include/JParticleEffect.h" +#include "../include/JParticleEmitter.h" + +#include "../include/JFileSystem.h" +#include "../include/JResourceManager.h" + +#include "tinyxml/tinyxml.h" + +//------------------------------------------------------------------------------------- + + +JParticleEffect::JParticleEffect(JResourceManager* mgr) +{ + mResourceManager = mgr; + + mX = 0.0f; + mY = 0.0f; + + mEmitterCount = 0; +} + + +JParticleEffect::~JParticleEffect() +{ + for (int i=0;iOpenFile(filename)) return false; + + int size = fileSystem->GetFileSize(); + char *xmlBuffer = new char[size]; + fileSystem->ReadFile(xmlBuffer, size); + + TiXmlDocument doc; + + doc.Parse(xmlBuffer); + + + TiXmlNode* effect = 0; + TiXmlNode* emitter = 0; + TiXmlNode* param = 0; + TiXmlNode* key = 0; + + TiXmlElement* element = 0; + + float keyTime; + float value; + float baseValue; + int int_value; +// +// enum ParticleField +// { +// FIELD_SPEED, +// FIELD_SIZE, +// FIELD_ROTATION, +// FIELD_ALPHA, +// FIELD_RED, +// FIELD_GREEN, +// FIELD_BLUE, +// FIELD_COUNT +// }; + + const char* lifeValues[] = + { + "speed", + "size", + "rotation", + "alpha", + "red", + "green", + "blue", + "radial_accel", + "tangential_accel", + "gravity" + }; + + const char* typeNames[] = + { + "POINT", + "AREA", + "HORIZONTAL", + "VERTICAL", + "CIRCLE" + }; + + const char* modeNames[] = + { + "REPEAT", + "ONCE", + "NTIMES", + "CONTINUOUS" + }; + + ////////////////////////////////////////////////////////////////////////// + // One effect per file only, well, we may extend it later to permit + // multiple effect definitions: + // + // for (effect = doc.FirstChild("effect"); effect; effect = effect->NextSibling()) + // + ////////////////////////////////////////////////////////////////////////// + + effect = doc.FirstChild("effect"); + if (effect) + { + element = effect->ToElement(); + printf("%s:%s\n", element->Value(), element->Attribute("name")); + + + for (emitter = effect->FirstChild("emitter"); emitter && mEmitterCount < MAX_EMITTER; emitter = emitter->NextSibling()) + { + + mParticleEmitters[mEmitterCount] = new JParticleEmitter(this); + element = emitter->ToElement(); + + if (element->QueryFloatAttribute("life", &value) == TIXML_SUCCESS) + mParticleEmitters[mEmitterCount]->mLife = value; + + for (param = emitter->FirstChild(); param; param = param->NextSibling()) + { + element = param->ToElement(); + + if (strcmp(element->Attribute("name"), "settings")==0) + { + + if (strcmp(element->Attribute("blend"), "NORMAL")==0) + mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); + else if (strcmp(element->Attribute("blend"), "ADDITIVE")==0) + mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE); + + for (unsigned int i=0;iAttribute("mode"), modeNames[i])==0) + { + mParticleEmitters[mEmitterCount]->mEmitterMode = i; + #if defined (_DEBUG) + printf("emitter mode:%s\n", modeNames[i]); + #endif + break; + } + } + for (unsigned i=0;iAttribute("type"), typeNames[i])==0) + { + mParticleEmitters[mEmitterCount]->mType = i; + #if defined (_DEBUG) + printf("emitter type:%s\n", typeNames[i]); + #endif + break; + } + } + + string quadName = element->Attribute("image"); + JQuad* quad = mResourceManager->GetQuad(quadName); + if (quad != NULL) + mParticleEmitters[mEmitterCount]->SetQuad(quad); + +// if (element->QueryIntAttribute("image", &int_value) == TIXML_SUCCESS) +// { +// mParticleEmitters[mEmitterCount]->mQuadIndex = int_value; +// +// } + if (element->QueryIntAttribute("width", &int_value) == TIXML_SUCCESS) + { + mParticleEmitters[mEmitterCount]->mWidth = int_value; + + } + if (element->QueryIntAttribute("height", &int_value) == TIXML_SUCCESS) + { + mParticleEmitters[mEmitterCount]->mHeight = int_value; + + } + + if (element->QueryIntAttribute("id", &int_value) == TIXML_SUCCESS) + { + mParticleEmitters[mEmitterCount]->mId = int_value; + + } + + if (element->QueryIntAttribute("repeat_count", &int_value) == TIXML_SUCCESS) + { + mParticleEmitters[mEmitterCount]->mRepeatTimes = int_value; + + } + } + else if (strcmp(element->Attribute("name"), "quantity")==0) + { + for (key = param->FirstChild(); key; key = key->NextSibling()) + { + element = key->ToElement(); + + if (element->QueryFloatAttribute("timeslice", &keyTime) == TIXML_SUCCESS && + element->QueryFloatAttribute("value", &value) == TIXML_SUCCESS) + { + mParticleEmitters[mEmitterCount]->mQuantity.AddKey(keyTime, value); + } + + } + } + else if (strcmp(element->Attribute("name"), "lifex")==0) + { + if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && + element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) + { + mParticleEmitters[mEmitterCount]->mLifeBase = baseValue; + mParticleEmitters[mEmitterCount]->mLifeMax= value; + } + } + else if (strcmp(element->Attribute("name"), "anglex")==0) + { + if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && + element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) + { + mParticleEmitters[mEmitterCount]->mAngleBase = baseValue*DEG2RAD; + mParticleEmitters[mEmitterCount]->mAngleMax= value*DEG2RAD; + } + } + else if (strcmp(element->Attribute("name"), "speedx")==0) + { + if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && + element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) + { + mParticleEmitters[mEmitterCount]->mSpeedBase = baseValue; + mParticleEmitters[mEmitterCount]->mSpeedMax= value; + } + } + else if (strcmp(element->Attribute("name"), "sizex")==0) + { + if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS && + element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS) + { + mParticleEmitters[mEmitterCount]->mSizeBase = baseValue; + mParticleEmitters[mEmitterCount]->mSizeMax= value; + } + } + else + { + for (int i=0;iAttribute("name"), lifeValues[i])==0) + { + for (key = param->FirstChild(); key; key = key->NextSibling()) + { + element = key->ToElement(); + + if (element->QueryFloatAttribute("lifeslice", &keyTime) == TIXML_SUCCESS && + element->QueryFloatAttribute("value", &value) == TIXML_SUCCESS) + { + if (i==FIELD_ROTATION) + value *= DEG2RAD; + + mParticleEmitters[mEmitterCount]->mData[i].AddKey(keyTime, value); + } + + } + break; + } + } + + } + + + } + + mEmitterCount++; + } + } + + fileSystem->CloseFile(); + delete[] xmlBuffer; + + return true; +} + + +void JParticleEffect::SetParticleSystem(JParticleSystem* particleSys) +{ + mParticleSystem = particleSys; +} + + +void JParticleEffect::SetPosition(float x, float y) +{ + mX = x; + mY = y; +} + + +JParticleSystem* JParticleEffect::GetParticleSystem() +{ + return mParticleSystem; +} + + +float JParticleEffect::GetX() +{ + return mX; +} + + +float JParticleEffect::GetY() +{ + return mY; +} + + +void JParticleEffect::Update(float dt) +{ +// mTimer += dt; + + for (int i=0;iUpdate(dt); +} + +void JParticleEffect::Render() +{ + for (int i=0;iRender(); +} + +bool JParticleEffect::Done() +{ + bool done = true; + for (int i=0;iDone()) + done = false; + + return (done); +} + + +void JParticleEffect::Start() +{ + for (int i=0;iStart(); +} + + +void JParticleEffect::Stop() +{ + + for (int i=0;iSetActive(false); +} + + +void JParticleEffect::MoveTo(float x, float y) +{ + float dx = x - mX; + float dy = y - mY; + + mX = x; + mY = y; + + for (int i=0;iMoveAllParticles(dx, dy); + } +} diff --git a/JGE/src/JParticleEmitter.cpp b/JGE/src/JParticleEmitter.cpp index 7bbcaa087..6cc1ba4da 100644 --- a/JGE/src/JParticleEmitter.cpp +++ b/JGE/src/JParticleEmitter.cpp @@ -1,323 +1,323 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#include - -#include "../include/JGE.h" -#include "../include/JParticleSystem.h" -#include "../include/JParticleEffect.h" -#include "../include/JParticleEmitter.h" - - -//------------------------------------------------------------------------------------- -JParticleEmitter::JParticleEmitter(JParticleEffect* parent) -{ - mParent = parent; - mType = TYPE_POINT; - mSrcBlending = BLEND_SRC_ALPHA; - mDestBlending = BLEND_ONE; - - mQuad = NULL; - - mQuadIndex = 0; - mWidth = 8; - mHeight = 8; - - mEmitTimer = 0.0f; - mActive = false; - - mMaxParticleCount = MAX_PARTICLE_COUNT; - - mParticles.clear(); - mParticles.reserve(INIT_PARTICLE_COUNT); -} - -JParticleEmitter::~JParticleEmitter() -{ - - while (mParticles.size()>0) - { - JParticle* par = mParticles.back(); - mParticles.pop_back(); - delete par; - } -} - -JParticle* JParticleEmitter::GetIdleParticle() -{ - int size = mParticles.size(); - for (int i=0;imActive) - return mParticles[i]; - } - - if (size < mMaxParticleCount) - { - - JParticle*par = new JParticle(); - if (par != NULL) - { - mParticles.push_back(par); - return par; - } - } - - return NULL; -} - -void JParticleEmitter::Start() -{ - mActive = true; - mActiveParticleCount = 0; - mRepeatCounter = mRepeatTimes; - - ReStart(); -} - - -void JParticleEmitter::ReStart() -{ - mQuantity.Init(); - mEmitTimer = 0.0f; - -// if (mQuad == NULL) -// { -// JParticleSystem* particleSys = mParent->GetParticleSystem(); -// mQuad = particleSys->GetParticleQuad(mQuadIndex); -// } - - int count = (int) mQuantity.mCurr; - if (count > 0) - EmitParticles(count); -} - - -void JParticleEmitter::SetQuad(JQuad *quad) -{ - mQuad = quad; -} - - - -void JParticleEmitter::Update(float dt) -{ - // JParticleSystem* particleSys = mParent->GetParticleSystem(); - - mActiveParticleCount = 0; - - if (!mParticles.empty()) - { - int count = 0; - int size = mParticles.size(); - for (int i=0;imActive) - { - count++; - mParticles[i]->Update(dt); - } - } - - mActiveParticleCount = count; - } - - if (!mActive) return; // don't generate more - - mEmitTimer += dt; - if (mEmitTimer > mLife) - { - mEmitTimer = 0.0f; - - if (mEmitterMode == MODE_ONCE) - { - mActive = false; - } - else if (mEmitterMode == MODE_REPEAT) - { - ReStart(); - return; - } - else if (mEmitterMode == MODE_NTIMES) - { - mRepeatCounter--; - if (mRepeatCounter > 0) - { - ReStart(); - return; - } - else - mActive = false; - } - } - - if (!mActive) return; // don't generate more - - // more particles... - int count = 0; - - if (mQuantity.mCurr != 0.0f) - { - - float timeForOneParticle = 1.0f/mQuantity.mCurr; - - float potentialParticles = (float) ((int)(mEmitTimer/timeForOneParticle)); - if (potentialParticles >= 1.0f) - mEmitTimer -= (potentialParticles*timeForOneParticle); - - count = (int)potentialParticles; - } - - //int count = (int)(mQuantity.mCurr * dt); // number of particles for this dt - - mQuantity.Update(dt); - - EmitParticles(count); -} - - -void JParticleEmitter::EmitParticles(int count) -{ - // JParticleSystem* particleSys = mParent->GetParticleSystem(); - - JParticleData *dataPtr; - JParticle* particle; - - float x, y; - - float xOrigin = mParent->GetX(); - float yOrigin = mParent->GetY(); - - for (int i=0;iSetQuad(mQuad); - - dataPtr = particle->GetDataPtr(); - memcpy(dataPtr, mData, sizeof(JParticleData)*FIELD_COUNT); - - float angle = 0.0f; - - switch (mType) - { - case TYPE_POINT: - //particle->SetPosition(mParent->GetX(),mParent->GetY()); - particle->InitPosition(xOrigin, yOrigin, 0, 0); - break; - case TYPE_AREA: - x = (float)((rand()%mWidth) - (mWidth>>1)); - y = (float)((rand()%mHeight) - (mHeight>>1)); - //particle->SetPosition(mParent->GetX()+x,mParent->GetY()+y); - particle->InitPosition(xOrigin, yOrigin, x, y); - break; - case TYPE_HORIZONTAL: - x = (float)((rand()%mWidth) - (mWidth>>1)); - //particle->SetPosition(mParent->GetX()+x,mParent->GetY()); - particle->InitPosition(xOrigin, yOrigin, x, 0); - break; - case TYPE_VERTICAL: - y = (float)((rand()%mHeight) - (mHeight>>1)); - //particle->SetPosition(mParent->GetX(),mParent->GetY()+y); - particle->InitPosition(xOrigin, yOrigin, 0, y); - break; - case TYPE_CIRCLE: - angle = M_PI* 2 * (rand()%1001)/1000.0f; - x = cosf(angle)*mWidth; - y = sinf(angle)*mHeight; - particle->InitPosition(xOrigin, yOrigin, x, y); - break; - - } - - //particle->mSpeed - float speed = mSpeedBase + (mSpeedMax-mSpeedBase) * (rand()%1001)/1000.0f; - - if (mType != TYPE_CIRCLE) - angle = mAngleBase + (mAngleMax-mAngleBase) * (rand()%1001)/1000.0f; - //float x = cosf(angle); - //float y = sinf(angle); - // speed itself is not changing - particle->SetVelocity(cosf(angle)*speed, sinf(angle)*speed); - - particle->SetSize(mSizeBase + (mSizeMax-mSizeBase) * (rand()%1001)/1000.0f); - - float life = mLifeBase + (mLifeMax-mLifeBase) * (rand()%1001)/1000.0f; - particle->Init(life); - - - } - - } - - -} - - -void JParticleEmitter::Render() -{ - JRenderer* renderer = JRenderer::GetInstance(); - - renderer->SetTexBlend(mSrcBlending, mDestBlending); - - int size = mParticles.size(); - for (int i=0;imActive) - { - mParticles[i]->Render(); - } - } - - renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); - - -} - - -void JParticleEmitter::SetBlending(int srcBlend, int destBlend) -{ - mSrcBlending = srcBlend; - mDestBlending = destBlend; -} - - -bool JParticleEmitter::Done() -{ - return !mActive && mActiveParticleCount==0; -} - - -void JParticleEmitter::SetActive(bool flag) -{ - mActive = flag; -} - - -void JParticleEmitter::MoveAllParticles(float x, float y) -{ - int size = mParticles.size(); - for (int i=0;imActive) - { - mParticles[i]->Move(x, y); - } - } - - -} - -void JParticleEmitter::SetMaxParticleCount(int count) -{ - mMaxParticleCount = count; -} - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#include + +#include "../include/JGE.h" +#include "../include/JParticleSystem.h" +#include "../include/JParticleEffect.h" +#include "../include/JParticleEmitter.h" + + +//------------------------------------------------------------------------------------- +JParticleEmitter::JParticleEmitter(JParticleEffect* parent) +{ + mParent = parent; + mType = TYPE_POINT; + mSrcBlending = BLEND_SRC_ALPHA; + mDestBlending = BLEND_ONE; + + mQuad = NULL; + + mQuadIndex = 0; + mWidth = 8; + mHeight = 8; + + mEmitTimer = 0.0f; + mActive = false; + + mMaxParticleCount = MAX_PARTICLE_COUNT; + + mParticles.clear(); + mParticles.reserve(INIT_PARTICLE_COUNT); +} + +JParticleEmitter::~JParticleEmitter() +{ + + while (mParticles.size()>0) + { + JParticle* par = mParticles.back(); + mParticles.pop_back(); + delete par; + } +} + +JParticle* JParticleEmitter::GetIdleParticle() +{ + int size = mParticles.size(); + for (int i=0;imActive) + return mParticles[i]; + } + + if (size < mMaxParticleCount) + { + + JParticle*par = new JParticle(); + if (par != NULL) + { + mParticles.push_back(par); + return par; + } + } + + return NULL; +} + +void JParticleEmitter::Start() +{ + mActive = true; + mActiveParticleCount = 0; + mRepeatCounter = mRepeatTimes; + + ReStart(); +} + + +void JParticleEmitter::ReStart() +{ + mQuantity.Init(); + mEmitTimer = 0.0f; + +// if (mQuad == NULL) +// { +// JParticleSystem* particleSys = mParent->GetParticleSystem(); +// mQuad = particleSys->GetParticleQuad(mQuadIndex); +// } + + int count = (int) mQuantity.mCurr; + if (count > 0) + EmitParticles(count); +} + + +void JParticleEmitter::SetQuad(JQuad *quad) +{ + mQuad = quad; +} + + + +void JParticleEmitter::Update(float dt) +{ + // JParticleSystem* particleSys = mParent->GetParticleSystem(); + + mActiveParticleCount = 0; + + if (!mParticles.empty()) + { + int count = 0; + int size = mParticles.size(); + for (int i=0;imActive) + { + count++; + mParticles[i]->Update(dt); + } + } + + mActiveParticleCount = count; + } + + if (!mActive) return; // don't generate more + + mEmitTimer += dt; + if (mEmitTimer > mLife) + { + mEmitTimer = 0.0f; + + if (mEmitterMode == MODE_ONCE) + { + mActive = false; + } + else if (mEmitterMode == MODE_REPEAT) + { + ReStart(); + return; + } + else if (mEmitterMode == MODE_NTIMES) + { + mRepeatCounter--; + if (mRepeatCounter > 0) + { + ReStart(); + return; + } + else + mActive = false; + } + } + + if (!mActive) return; // don't generate more + + // more particles... + int count = 0; + + if (mQuantity.mCurr != 0.0f) + { + + float timeForOneParticle = 1.0f/mQuantity.mCurr; + + float potentialParticles = (float) ((int)(mEmitTimer/timeForOneParticle)); + if (potentialParticles >= 1.0f) + mEmitTimer -= (potentialParticles*timeForOneParticle); + + count = (int)potentialParticles; + } + + //int count = (int)(mQuantity.mCurr * dt); // number of particles for this dt + + mQuantity.Update(dt); + + EmitParticles(count); +} + + +void JParticleEmitter::EmitParticles(int count) +{ + // JParticleSystem* particleSys = mParent->GetParticleSystem(); + + JParticleData *dataPtr; + JParticle* particle; + + float x, y; + + float xOrigin = mParent->GetX(); + float yOrigin = mParent->GetY(); + + for (int i=0;iSetQuad(mQuad); + + dataPtr = particle->GetDataPtr(); + memcpy(dataPtr, mData, sizeof(JParticleData)*FIELD_COUNT); + + float angle = 0.0f; + + switch (mType) + { + case TYPE_POINT: + //particle->SetPosition(mParent->GetX(),mParent->GetY()); + particle->InitPosition(xOrigin, yOrigin, 0, 0); + break; + case TYPE_AREA: + x = (float)((rand()%mWidth) - (mWidth>>1)); + y = (float)((rand()%mHeight) - (mHeight>>1)); + //particle->SetPosition(mParent->GetX()+x,mParent->GetY()+y); + particle->InitPosition(xOrigin, yOrigin, x, y); + break; + case TYPE_HORIZONTAL: + x = (float)((rand()%mWidth) - (mWidth>>1)); + //particle->SetPosition(mParent->GetX()+x,mParent->GetY()); + particle->InitPosition(xOrigin, yOrigin, x, 0); + break; + case TYPE_VERTICAL: + y = (float)((rand()%mHeight) - (mHeight>>1)); + //particle->SetPosition(mParent->GetX(),mParent->GetY()+y); + particle->InitPosition(xOrigin, yOrigin, 0, y); + break; + case TYPE_CIRCLE: + angle = M_PI* 2 * (rand()%1001)/1000.0f; + x = cosf(angle)*mWidth; + y = sinf(angle)*mHeight; + particle->InitPosition(xOrigin, yOrigin, x, y); + break; + + } + + //particle->mSpeed + float speed = mSpeedBase + (mSpeedMax-mSpeedBase) * (rand()%1001)/1000.0f; + + if (mType != TYPE_CIRCLE) + angle = mAngleBase + (mAngleMax-mAngleBase) * (rand()%1001)/1000.0f; + //float x = cosf(angle); + //float y = sinf(angle); + // speed itself is not changing + particle->SetVelocity(cosf(angle)*speed, sinf(angle)*speed); + + particle->SetSize(mSizeBase + (mSizeMax-mSizeBase) * (rand()%1001)/1000.0f); + + float life = mLifeBase + (mLifeMax-mLifeBase) * (rand()%1001)/1000.0f; + particle->Init(life); + + + } + + } + + +} + + +void JParticleEmitter::Render() +{ + JRenderer* renderer = JRenderer::GetInstance(); + + renderer->SetTexBlend(mSrcBlending, mDestBlending); + + int size = mParticles.size(); + for (int i=0;imActive) + { + mParticles[i]->Render(); + } + } + + renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); + + +} + + +void JParticleEmitter::SetBlending(int srcBlend, int destBlend) +{ + mSrcBlending = srcBlend; + mDestBlending = destBlend; +} + + +bool JParticleEmitter::Done() +{ + return !mActive && mActiveParticleCount==0; +} + + +void JParticleEmitter::SetActive(bool flag) +{ + mActive = flag; +} + + +void JParticleEmitter::MoveAllParticles(float x, float y) +{ + int size = mParticles.size(); + for (int i=0;imActive) + { + mParticles[i]->Move(x, y); + } + } + + +} + +void JParticleEmitter::SetMaxParticleCount(int count) +{ + mMaxParticleCount = count; +} + diff --git a/JGE/src/JParticleSystem.cpp b/JGE/src/JParticleSystem.cpp index eaa08ee62..87bef258c 100644 --- a/JGE/src/JParticleSystem.cpp +++ b/JGE/src/JParticleSystem.cpp @@ -1,124 +1,124 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - - -#include - -#include "../include/JGE.h" -#include "../include/JParticleSystem.h" -#include "../include/JParticleEffect.h" - - - -//------------------------------------------------------------------------------------- -JParticleSystem::JParticleSystem() -{ - - mActive = false; - -} - - -JParticleSystem::~JParticleSystem() -{ - mEffects.clear(); - - -} - - -void JParticleSystem::ClearAll() -{ - mEffects.clear(); -} - - -void JParticleSystem::Update(float dt) -{ - if (!mEffects.empty()) - { - JParticleEffect* effect; - std::list::iterator curr = mEffects.begin(); - while (curr != mEffects.end()) - { - effect = *curr; - effect->Update(dt); - if (effect->Done()) - { - mEffects.erase(curr++); - } - else - curr++; - } - } - -} - - -void JParticleSystem::Render() -{ - - if (!mEffects.empty()) - { - JParticleEffect* effect; - std::list::iterator curr = mEffects.begin(); - while (curr != mEffects.end()) - { - effect = *curr; - effect->Render(); - - curr++; - } - } -} - - - - -void JParticleSystem::StartEffect(JParticleEffect* effect) -{ - std::list::iterator curr = mEffects.begin(); - while (curr != mEffects.end()) - { - if (effect == *curr && effect->GetParticleSystem() == this) - { - effect->Start(); - return; - } - curr++; - } - mEffects.push_back(effect); - effect->SetParticleSystem(this); - effect->Start(); -} - - -void JParticleSystem::StopAllEffects() -{ - - if (!mEffects.empty()) - { - JParticleEffect* effect; - std::list::iterator curr = mEffects.begin(); - while (curr != mEffects.end()) - { - effect = *curr; - effect->Stop(); - curr++; - } - } - - -} - -bool JParticleSystem::IsActive() { return mActive; } - -void JParticleSystem::SetActive(bool flag) { mActive = flag; } - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + + +#include + +#include "../include/JGE.h" +#include "../include/JParticleSystem.h" +#include "../include/JParticleEffect.h" + + + +//------------------------------------------------------------------------------------- +JParticleSystem::JParticleSystem() +{ + + mActive = false; + +} + + +JParticleSystem::~JParticleSystem() +{ + mEffects.clear(); + + +} + + +void JParticleSystem::ClearAll() +{ + mEffects.clear(); +} + + +void JParticleSystem::Update(float dt) +{ + if (!mEffects.empty()) + { + JParticleEffect* effect; + std::list::iterator curr = mEffects.begin(); + while (curr != mEffects.end()) + { + effect = *curr; + effect->Update(dt); + if (effect->Done()) + { + mEffects.erase(curr++); + } + else + curr++; + } + } + +} + + +void JParticleSystem::Render() +{ + + if (!mEffects.empty()) + { + JParticleEffect* effect; + std::list::iterator curr = mEffects.begin(); + while (curr != mEffects.end()) + { + effect = *curr; + effect->Render(); + + curr++; + } + } +} + + + + +void JParticleSystem::StartEffect(JParticleEffect* effect) +{ + std::list::iterator curr = mEffects.begin(); + while (curr != mEffects.end()) + { + if (effect == *curr && effect->GetParticleSystem() == this) + { + effect->Start(); + return; + } + curr++; + } + mEffects.push_back(effect); + effect->SetParticleSystem(this); + effect->Start(); +} + + +void JParticleSystem::StopAllEffects() +{ + + if (!mEffects.empty()) + { + JParticleEffect* effect; + std::list::iterator curr = mEffects.begin(); + while (curr != mEffects.end()) + { + effect = *curr; + effect->Stop(); + curr++; + } + } + + +} + +bool JParticleSystem::IsActive() { return mActive; } + +void JParticleSystem::SetActive(bool flag) { mActive = flag; } + diff --git a/JGE/src/JSpline.cpp b/JGE/src/JSpline.cpp index c456d8da9..05d17958e 100644 --- a/JGE/src/JSpline.cpp +++ b/JGE/src/JSpline.cpp @@ -1,203 +1,203 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#include - -#include "../include/JFileSystem.h" -#include "../include/JSpline.h" - -#include "tinyxml/tinyxml.h" - -#define SMALL_NUMBER 0.0001f - - -JSpline::JSpline() -{ - mCount = 0; - - mMidPoints.reserve(32); - mPixels.reserve(32); -} - - -JSpline::~JSpline() -{ - mCount = 0; - - mMidPoints.clear(); - mPixels.clear(); -} - - -bool JSpline::Load(const char *filename, float xscale, float yscale) -{ - JFileSystem *fileSystem = JFileSystem::GetInstance(); - - if (fileSystem == NULL) return false; - if (!fileSystem->OpenFile(filename)) return false; - - int size = fileSystem->GetFileSize(); - char *xmlBuffer = new char[size]; - fileSystem->ReadFile(xmlBuffer, size); - - TiXmlDocument doc; - doc.Parse(xmlBuffer); - - mCount = 0; - - mMidPoints.clear(); - mPixels.clear(); - - - TiXmlNode* node = 0; - //TiXmlElement* todoElement = 0; - TiXmlElement* element; - - node = doc.RootElement(); - - float xx, yy; - - for(element = node->FirstChildElement(); element; element = element->NextSiblingElement()) - { - xx = 0.0f; - yy = 0.0f; - element->QueryFloatAttribute("x", &xx); - element->QueryFloatAttribute("y", &yy); - - Point pt(xx*xscale, yy*yscale); - AddControlPoint(pt); - - } - - fileSystem->CloseFile(); - delete[] xmlBuffer; - - return true; -} - - - -void JSpline::PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3) -{ - float t2 = t * t; - float t3 = t2 * t; - out.x = 0.5f * (( 2.0f * p1.x ) + - ( -p0.x + p2.x ) * t + - ( 2.0f * p0.x - 5.0f * p1.x + 4 * p2.x - p3.x ) * t2 + - ( -p0.x + 3.0f * p1.x - 3.0f * p2.x + p3.x ) * t3 ); - - out.y = 0.5f * ( ( 2.0f * p1.y ) + - ( -p0.y + p2.y ) * t + - ( 2.0f * p0.y - 5.0f * p1.y + 4 * p2.y - p3.y ) * t2 + - ( -p0.y + 3.0f * p1.y - 3.0f * p2.y + p3.y ) * t3 ); - -} - - - -void JSpline::GeneratePixels() -{ - float x, y; - - float inc = SMALL_NUMBER; - - mPixels.clear(); - - x = mMidPoints[1].x; - y = mMidPoints[1].y; - - Point newPt(x, y); - Point extraPt; - - mPixels.push_back(newPt); - - for (int n=0; n < (int)mMidPoints.size()-3; n++) - { - float t = inc; - while (t <= 1.0f) - { - PointOnCurve(newPt, t, mMidPoints[n], mMidPoints[n+1], mMidPoints[n+2], mMidPoints[n+3]); - - float dx = newPt.x-x; - float dy = newPt.y-y; - - float dist = sqrtf(dx*dx + dy*dy); - if (dist >= MID_POINT_THRESHOLD) - { - // - //extraPt.x = (newPt.x+x)/2; - //extraPt.y = (newPt.y+y)/2; - //mPixels.push_back(extraPt); - // - mPixels.push_back(newPt); - x = newPt.x; - y = newPt.y; - } - - t += inc; - } - } - - - mCount = mPixels.size(); - -} - - -void JSpline::AddControlPoint(const Point &pt) -{ - mMidPoints.push_back(pt); -} - - -void JSpline::GetControlPoint(Point &point, int index) -{ - if (index < (int)mMidPoints.size()) - { - point.x = mMidPoints[index].x; - point.y = mMidPoints[index].y; - } -} - - -void JSpline::GetPixel(Point &point, int index) -{ - if (index < (int)mPixels.size()) - { - point.x = mPixels[index].x; - point.y = mPixels[index].y; - } -} - -int JSpline::GetPixelCount() -{ - return mCount; -} - - -void JSpline::Render(float x, float y, PIXEL_TYPE color, PIXEL_TYPE controlColor) -{ - if (mCount > 0) - { - JRenderer* renderer = JRenderer::GetInstance(); -// renderer->SetLineWidth(1.2f); - - int size = mPixels.size(); - - for (int i=0;iDrawLine(x+mPixels[i].x, y+mPixels[i].y, x+mPixels[i+1].x, y+mPixels[i+1].y, color); - - size = mMidPoints.size(); - for (int i=0; i < size; i++) - renderer->FillRect(mMidPoints[i].x-3, mMidPoints[i].y-3, 6, 6, controlColor); - } - -} - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#include + +#include "../include/JFileSystem.h" +#include "../include/JSpline.h" + +#include "tinyxml/tinyxml.h" + +#define SMALL_NUMBER 0.0001f + + +JSpline::JSpline() +{ + mCount = 0; + + mMidPoints.reserve(32); + mPixels.reserve(32); +} + + +JSpline::~JSpline() +{ + mCount = 0; + + mMidPoints.clear(); + mPixels.clear(); +} + + +bool JSpline::Load(const char *filename, float xscale, float yscale) +{ + JFileSystem *fileSystem = JFileSystem::GetInstance(); + + if (fileSystem == NULL) return false; + if (!fileSystem->OpenFile(filename)) return false; + + int size = fileSystem->GetFileSize(); + char *xmlBuffer = new char[size]; + fileSystem->ReadFile(xmlBuffer, size); + + TiXmlDocument doc; + doc.Parse(xmlBuffer); + + mCount = 0; + + mMidPoints.clear(); + mPixels.clear(); + + + TiXmlNode* node = 0; + //TiXmlElement* todoElement = 0; + TiXmlElement* element; + + node = doc.RootElement(); + + float xx, yy; + + for(element = node->FirstChildElement(); element; element = element->NextSiblingElement()) + { + xx = 0.0f; + yy = 0.0f; + element->QueryFloatAttribute("x", &xx); + element->QueryFloatAttribute("y", &yy); + + Point pt(xx*xscale, yy*yscale); + AddControlPoint(pt); + + } + + fileSystem->CloseFile(); + delete[] xmlBuffer; + + return true; +} + + + +void JSpline::PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3) +{ + float t2 = t * t; + float t3 = t2 * t; + out.x = 0.5f * (( 2.0f * p1.x ) + + ( -p0.x + p2.x ) * t + + ( 2.0f * p0.x - 5.0f * p1.x + 4 * p2.x - p3.x ) * t2 + + ( -p0.x + 3.0f * p1.x - 3.0f * p2.x + p3.x ) * t3 ); + + out.y = 0.5f * ( ( 2.0f * p1.y ) + + ( -p0.y + p2.y ) * t + + ( 2.0f * p0.y - 5.0f * p1.y + 4 * p2.y - p3.y ) * t2 + + ( -p0.y + 3.0f * p1.y - 3.0f * p2.y + p3.y ) * t3 ); + +} + + + +void JSpline::GeneratePixels() +{ + float x, y; + + float inc = SMALL_NUMBER; + + mPixels.clear(); + + x = mMidPoints[1].x; + y = mMidPoints[1].y; + + Point newPt(x, y); + Point extraPt; + + mPixels.push_back(newPt); + + for (int n=0; n < (int)mMidPoints.size()-3; n++) + { + float t = inc; + while (t <= 1.0f) + { + PointOnCurve(newPt, t, mMidPoints[n], mMidPoints[n+1], mMidPoints[n+2], mMidPoints[n+3]); + + float dx = newPt.x-x; + float dy = newPt.y-y; + + float dist = sqrtf(dx*dx + dy*dy); + if (dist >= MID_POINT_THRESHOLD) + { + // + //extraPt.x = (newPt.x+x)/2; + //extraPt.y = (newPt.y+y)/2; + //mPixels.push_back(extraPt); + // + mPixels.push_back(newPt); + x = newPt.x; + y = newPt.y; + } + + t += inc; + } + } + + + mCount = mPixels.size(); + +} + + +void JSpline::AddControlPoint(const Point &pt) +{ + mMidPoints.push_back(pt); +} + + +void JSpline::GetControlPoint(Point &point, int index) +{ + if (index < (int)mMidPoints.size()) + { + point.x = mMidPoints[index].x; + point.y = mMidPoints[index].y; + } +} + + +void JSpline::GetPixel(Point &point, int index) +{ + if (index < (int)mPixels.size()) + { + point.x = mPixels[index].x; + point.y = mPixels[index].y; + } +} + +int JSpline::GetPixelCount() +{ + return mCount; +} + + +void JSpline::Render(float x, float y, PIXEL_TYPE color, PIXEL_TYPE controlColor) +{ + if (mCount > 0) + { + JRenderer* renderer = JRenderer::GetInstance(); +// renderer->SetLineWidth(1.2f); + + int size = mPixels.size(); + + for (int i=0;iDrawLine(x+mPixels[i].x, y+mPixels[i].y, x+mPixels[i+1].x, y+mPixels[i+1].y, color); + + size = mMidPoints.size(); + for (int i=0; i < size; i++) + renderer->FillRect(mMidPoints[i].x-3, mMidPoints[i].y-3, 6, 6, controlColor); + } + +} + diff --git a/JGE/src/JSprite.cpp b/JGE/src/JSprite.cpp index 00b8cf513..8bdd835ad 100644 --- a/JGE/src/JSprite.cpp +++ b/JGE/src/JSprite.cpp @@ -1,511 +1,511 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - - -#include "../include/JSprite.h" - -JRenderer* JSprite::mRenderer = NULL; - -//------------------------------------------------------------------------------------------------ -JSprite::JSprite(JTexture *tex, float x, float y, float width, float height, bool flipped) -{ - mRenderer = JRenderer::GetInstance(); - - //mQuad = new JQuad(tex, x, y, width, height); - //Rect *rect = new Rect((int)x, (int)y, (int)width, (int)height); - //mFrames[0] = rect; - mFrameCount = 0; - mCurrentFrame = 0; - mX = 0.0f; - mY = 0.0f; - mTimer = 0; - - mAnimationType = ANIMATION_TYPE_LOOPING; - mDelta = 1; - mAnimating = false; - mDuration = 100.0f; - mAlpha = 255.0f; - mHScale = 1.0f; - mVScale = 1.0f; - mRotation = 0.0f; - mDirection = 0.0f; - mSpeed = 0.0f; - - mColor = ARGB(0,255,255,255); - - mFrames.clear(); - mFrames.reserve(8); - - mTex = tex; - - if (mTex != NULL) - { - mActive = true; - AddFrame(x, y, width, height, flipped); - } - else - mActive = false; -} - - -//------------------------------------------------------------------------------------------------ -JSprite::~JSprite() -{ -// for (int i=0;i0) - { - JQuad* quad = mFrames.back(); - mFrames.pop_back(); - if (quad != NULL) - delete quad; - } - -} - - -//------------------------------------------------------------------------------------------------ -void JSprite::Update(float dt) -{ - if (!mAnimating) return; - - mTimer += dt; - if (mTimer > mDuration) - { - mTimer = 0; - mCurrentFrame+=mDelta; - - if (mCurrentFrame >= mFrameCount) - { - if (mAnimationType == ANIMATION_TYPE_LOOPING) - mCurrentFrame = 0; - else if (mAnimationType == ANIMATION_TYPE_ONCE_AND_GONE) - mActive = false; - else if (mAnimationType == ANIMATION_TYPE_ONCE_AND_STAY) - { - mCurrentFrame = mFrameCount-1; - mAnimating = false; - } - else if (mAnimationType == ANIMATION_TYPE_ONCE_AND_BACK) - { - mCurrentFrame = 0; - mAnimating = false; - } - else // ping pong - { - mDelta *= -1; - mCurrentFrame += mDelta; - } - } - else if (mCurrentFrame < 0) - { - if (mAnimationType == ANIMATION_TYPE_PINGPONG) - { - mDelta *= -1; - mCurrentFrame += mDelta; - } - } - } - - - -} - - -//------------------------------------------------------------------------------------------------ -void JSprite::SetAnimationType(int type) -{ - mAnimationType = type; -} - - -//------------------------------------------------------------------------------------------------ -void JSprite::Render() -{ - if (mActive) - { - //mQuad->SetTextureRect((float)mFrames[mCurrentFrame]->x, (float)mFrames[mCurrentFrame]->y, - // (float)mFrames[mCurrentFrame]->width, (float)mFrames[mCurrentFrame]->height); - //if (mDoAlpha) - -// { - int alpha = (int)mAlpha; -// //mQuad->SetColor(ARGB(alpha,255,255,255)); - - -#if defined (WIN32) || defined (LINUX) || defined (IOS) - mFrames[mCurrentFrame]->SetColor(alpha<<24 | mColor); -// mQuad->SetFlip(mFlipped[mCurrentFrame], false); -#else - mFrames[mCurrentFrame]->SetColor(MAKE_COLOR(alpha, mColor)); -#endif -// mQuad->SetHFlip(mFlipped[mCurrentFrame]); -// } - //if (mDoRotation != 0.0f || mHScale != 1.0f || mVScale != 1.0f) - mRenderer->RenderQuad(mFrames[mCurrentFrame], mX, mY, mRotation, mHScale, mVScale); - //else - // mRenderer->RenderQuad(mFrames[mCurrentFrame], mX, mY); - } -} - - -//------------------------------------------------------------------------------------------------ -void JSprite::AddFrame(float x, float y, float width, float height, bool flipped) -{ - //mFlipped[mFrameCount] = flipped; - //mFrames[mFrameCount++] = new JQuad(mTex, x, y, width, height); - - JQuad* quad = new JQuad(mTex, x, y, width, height); - if (quad != NULL) - { - quad->SetHFlip(flipped); - mFrames.push_back(quad); - - mFrameCount = mFrames.size(); - } -} - -//------------------------------------------------------------------------------- -void JSprite::AddFrame(JTexture* tex, float x, float y, float width, float height, bool flipped) -{ - mTex = tex; - AddFrame(x, y, width, height, flipped); -} - - - -//------------------------------------------------------------------------------------------------ - -void JSprite::SetDuration(float duration) -{ - mDuration = duration; -} - - -//------------------------------------------------------------------------------------------------ -void JSprite::SetPosition(float x, float y) -{ - mX = x; - mY = y; - -} - - - -void JSprite::RestartAnimation() -{ - mAlpha = 255.0f; - mHScale = 1.0f; - mVScale = 1.0f; - mRotation = 0.0f; - - mCurrentFrame = 0; - StartAnimation(); -} - - -void JSprite::SetDirection(float x, float y) -{ - float dx = x - mX; - float dy = y - mY; - - //from atan2: - // -pi/2 - // | - // | - // pi ----+---- 0 - // | - // | - // pi/2 - - SetDirection(atan2f(dy, dx)); - -} - - -void JSprite::SetFlip(bool flip, int index) -{ - int size = (int)mFrames.size(); - if (index == -1) - { - for (int i=0;iSetHFlip(flip); - } - else - { - if (index >= 0 && index < size) - mFrames[index]->SetHFlip(flip); - } - -} - - -// void JSprite::SetBBox(int x, int y, int width, int height) -// { -// mBBoxX = x; -// mBBoxY = y; -// mBBoxWidth = width; -// mBBoxHeight = height; -// } - - - -void JSprite::StartAnimation() -{ - mActive = true; - mAnimating = true; - mCurrentFrame = 0; -} - -void JSprite::StopAnimation() { mAnimating = false; } -bool JSprite::IsAnimating() { return mAnimating; } - -void JSprite::SetAlpha(float alpha) { mAlpha = alpha; } -void JSprite::SetScale(float hscale, float vscale) { mHScale = hscale; mVScale = vscale; } -void JSprite::SetScale(float scale) { mHScale = scale; mVScale = scale; } -float JSprite::GetScale() { return mHScale; } -void JSprite::SetRotation(float rot) { mRotation = rot; } - -//JQuad* JSprite::GetQuad() { return mQuad; } - -float JSprite::GetXVelocity() { return cosf(mDirection)*mSpeed; } -float JSprite::GetYVelocity() { return sinf(mDirection)*mSpeed; } - -void JSprite::SetSpeed(float speed) { mSpeed = speed; } -float JSprite::GetSpeed() { return mSpeed; } -void JSprite::SetDirection(float angle) { mDirection = angle; } - -void JSprite::SetHotSpot(float x, float y, int index) -{ - int size = (int)mFrames.size(); - - if (index == -1) - { - for (int i=0;iSetHotSpot(x, y); - } - else - { - if (index >= 0 && index < size) - mFrames[index]->SetHotSpot(x, y); - } - -} - -#if defined (WIN32) || defined (LINUX) || defined (IOS) -void JSprite::SetColor(PIXEL_TYPE color) { mColor = (color&0x00ffffff); } -#else -void JSprite::SetColor(PIXEL_TYPE color) { mColor = (color&~MASK_ALPHA); } -#endif - -// void JSprite::SetBlendMode(int blend, int index) -// { -// if (index == -1) -// { -// for (int i=0;imBlend = blend; -// } -// else -// { -// if (index >= 0 && index < MAX_FRAMES) -// mFrames[index]->mBlend = blend; -// } -// -// } - -float JSprite::GetAlpha() { return mAlpha; } -float JSprite::GetDirection() { return mDirection; } -float JSprite::GetRotation() { return mRotation; } - -void JSprite::SetId(int id) { mId = id; } -int JSprite::GetId() { return mId; } - -int JSprite::GetCurrentFrameIndex() { return mCurrentFrame; } -void JSprite::SetCurrentFrameIndex(int frame) -{ - if (frame < (int)mFrames.size()) - mCurrentFrame = frame; -} - - -JQuad* JSprite::GetCurrentFrame() -{ - if (mCurrentFrame < (signed int)mFrames.size()) - return mFrames[mCurrentFrame]; - else - return NULL; -} - -int JSprite::GetFrameCount() -{ - return (int) mFrames.size(); -} - - -JQuad* JSprite::GetFrame(int index) -{ - if (index < (signed int)mFrames.size()) - return mFrames[index]; - else - return NULL; -} - - -float JSprite::GetX() { return mX; } -float JSprite::GetY() { return mY; } - -void JSprite::SetX(float x) { mX = x; } -void JSprite::SetY(float y) { mY = y; } - -void JSprite::SetActive(bool f) -{ - mActive = f; - if (mActive) - { - if (mFrames.size()==0) - mActive = false; - } -} - -bool JSprite::IsActive() { return mActive; } - -void JSprite::Move(float dx, float dy) -{ - mX += dx; - mY += dy; -} - - -// ------------------------------------------------------------------------------------------------ -JSpriteList::JSpriteList(int count) -{ - - mCount = count; - mList = new JSprite*[count]; - //mVictims = new JSpriteList*[count]; - - for (int i=0;iIsActive()) - { - mList[i]->Update(dt); -// if (mVictims[i]!= NULL) -// mVictims[i]->CheckCollision(mList[i]); - } - } -} - - -void JSpriteList::Render() -{ - for (int i=0;iIsActive()) - mList[i]->Render(); -} - - -void JSpriteList::AddSprite(JSprite *sprite)//, JSpriteList* victim) -{ - for (int i=0;iIsActive()) - { - mList[i]->SetActive(true); - mList[i]->SetPosition(x, y); - mList[i]->RestartAnimation(); - - return mList[i]; - } - } - - return NULL; -} - - -void JSpriteList::Activate(float x, float y, int index) -{ - if (index < mCount) - { - if (mList[index] != NULL) - { - mList[index]->SetActive(true); - mList[index]->SetPosition(x, y); - mList[index]->RestartAnimation(); - - } - } -} - -JSprite* JSpriteList::GetSprite(int index) -{ - if (index < mCount) - { - return mList[index]; - } - - return NULL; -} - -void JSpriteList::EnableAll(bool flag) -{ - for (int i=0;iSetActive(flag); - mList[i]->RestartAnimation(); - } - } -} +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + + +#include "../include/JSprite.h" + +JRenderer* JSprite::mRenderer = NULL; + +//------------------------------------------------------------------------------------------------ +JSprite::JSprite(JTexture *tex, float x, float y, float width, float height, bool flipped) +{ + mRenderer = JRenderer::GetInstance(); + + //mQuad = new JQuad(tex, x, y, width, height); + //Rect *rect = new Rect((int)x, (int)y, (int)width, (int)height); + //mFrames[0] = rect; + mFrameCount = 0; + mCurrentFrame = 0; + mX = 0.0f; + mY = 0.0f; + mTimer = 0; + + mAnimationType = ANIMATION_TYPE_LOOPING; + mDelta = 1; + mAnimating = false; + mDuration = 100.0f; + mAlpha = 255.0f; + mHScale = 1.0f; + mVScale = 1.0f; + mRotation = 0.0f; + mDirection = 0.0f; + mSpeed = 0.0f; + + mColor = ARGB(0,255,255,255); + + mFrames.clear(); + mFrames.reserve(8); + + mTex = tex; + + if (mTex != NULL) + { + mActive = true; + AddFrame(x, y, width, height, flipped); + } + else + mActive = false; +} + + +//------------------------------------------------------------------------------------------------ +JSprite::~JSprite() +{ +// for (int i=0;i0) + { + JQuad* quad = mFrames.back(); + mFrames.pop_back(); + if (quad != NULL) + delete quad; + } + +} + + +//------------------------------------------------------------------------------------------------ +void JSprite::Update(float dt) +{ + if (!mAnimating) return; + + mTimer += dt; + if (mTimer > mDuration) + { + mTimer = 0; + mCurrentFrame+=mDelta; + + if (mCurrentFrame >= mFrameCount) + { + if (mAnimationType == ANIMATION_TYPE_LOOPING) + mCurrentFrame = 0; + else if (mAnimationType == ANIMATION_TYPE_ONCE_AND_GONE) + mActive = false; + else if (mAnimationType == ANIMATION_TYPE_ONCE_AND_STAY) + { + mCurrentFrame = mFrameCount-1; + mAnimating = false; + } + else if (mAnimationType == ANIMATION_TYPE_ONCE_AND_BACK) + { + mCurrentFrame = 0; + mAnimating = false; + } + else // ping pong + { + mDelta *= -1; + mCurrentFrame += mDelta; + } + } + else if (mCurrentFrame < 0) + { + if (mAnimationType == ANIMATION_TYPE_PINGPONG) + { + mDelta *= -1; + mCurrentFrame += mDelta; + } + } + } + + + +} + + +//------------------------------------------------------------------------------------------------ +void JSprite::SetAnimationType(int type) +{ + mAnimationType = type; +} + + +//------------------------------------------------------------------------------------------------ +void JSprite::Render() +{ + if (mActive) + { + //mQuad->SetTextureRect((float)mFrames[mCurrentFrame]->x, (float)mFrames[mCurrentFrame]->y, + // (float)mFrames[mCurrentFrame]->width, (float)mFrames[mCurrentFrame]->height); + //if (mDoAlpha) + +// { + int alpha = (int)mAlpha; +// //mQuad->SetColor(ARGB(alpha,255,255,255)); + + +#if defined (WIN32) || defined (LINUX) || defined (IOS) + mFrames[mCurrentFrame]->SetColor(alpha<<24 | mColor); +// mQuad->SetFlip(mFlipped[mCurrentFrame], false); +#else + mFrames[mCurrentFrame]->SetColor(MAKE_COLOR(alpha, mColor)); +#endif +// mQuad->SetHFlip(mFlipped[mCurrentFrame]); +// } + //if (mDoRotation != 0.0f || mHScale != 1.0f || mVScale != 1.0f) + mRenderer->RenderQuad(mFrames[mCurrentFrame], mX, mY, mRotation, mHScale, mVScale); + //else + // mRenderer->RenderQuad(mFrames[mCurrentFrame], mX, mY); + } +} + + +//------------------------------------------------------------------------------------------------ +void JSprite::AddFrame(float x, float y, float width, float height, bool flipped) +{ + //mFlipped[mFrameCount] = flipped; + //mFrames[mFrameCount++] = new JQuad(mTex, x, y, width, height); + + JQuad* quad = new JQuad(mTex, x, y, width, height); + if (quad != NULL) + { + quad->SetHFlip(flipped); + mFrames.push_back(quad); + + mFrameCount = mFrames.size(); + } +} + +//------------------------------------------------------------------------------- +void JSprite::AddFrame(JTexture* tex, float x, float y, float width, float height, bool flipped) +{ + mTex = tex; + AddFrame(x, y, width, height, flipped); +} + + + +//------------------------------------------------------------------------------------------------ + +void JSprite::SetDuration(float duration) +{ + mDuration = duration; +} + + +//------------------------------------------------------------------------------------------------ +void JSprite::SetPosition(float x, float y) +{ + mX = x; + mY = y; + +} + + + +void JSprite::RestartAnimation() +{ + mAlpha = 255.0f; + mHScale = 1.0f; + mVScale = 1.0f; + mRotation = 0.0f; + + mCurrentFrame = 0; + StartAnimation(); +} + + +void JSprite::SetDirection(float x, float y) +{ + float dx = x - mX; + float dy = y - mY; + + //from atan2: + // -pi/2 + // | + // | + // pi ----+---- 0 + // | + // | + // pi/2 + + SetDirection(atan2f(dy, dx)); + +} + + +void JSprite::SetFlip(bool flip, int index) +{ + int size = (int)mFrames.size(); + if (index == -1) + { + for (int i=0;iSetHFlip(flip); + } + else + { + if (index >= 0 && index < size) + mFrames[index]->SetHFlip(flip); + } + +} + + +// void JSprite::SetBBox(int x, int y, int width, int height) +// { +// mBBoxX = x; +// mBBoxY = y; +// mBBoxWidth = width; +// mBBoxHeight = height; +// } + + + +void JSprite::StartAnimation() +{ + mActive = true; + mAnimating = true; + mCurrentFrame = 0; +} + +void JSprite::StopAnimation() { mAnimating = false; } +bool JSprite::IsAnimating() { return mAnimating; } + +void JSprite::SetAlpha(float alpha) { mAlpha = alpha; } +void JSprite::SetScale(float hscale, float vscale) { mHScale = hscale; mVScale = vscale; } +void JSprite::SetScale(float scale) { mHScale = scale; mVScale = scale; } +float JSprite::GetScale() { return mHScale; } +void JSprite::SetRotation(float rot) { mRotation = rot; } + +//JQuad* JSprite::GetQuad() { return mQuad; } + +float JSprite::GetXVelocity() { return cosf(mDirection)*mSpeed; } +float JSprite::GetYVelocity() { return sinf(mDirection)*mSpeed; } + +void JSprite::SetSpeed(float speed) { mSpeed = speed; } +float JSprite::GetSpeed() { return mSpeed; } +void JSprite::SetDirection(float angle) { mDirection = angle; } + +void JSprite::SetHotSpot(float x, float y, int index) +{ + int size = (int)mFrames.size(); + + if (index == -1) + { + for (int i=0;iSetHotSpot(x, y); + } + else + { + if (index >= 0 && index < size) + mFrames[index]->SetHotSpot(x, y); + } + +} + +#if defined (WIN32) || defined (LINUX) || defined (IOS) +void JSprite::SetColor(PIXEL_TYPE color) { mColor = (color&0x00ffffff); } +#else +void JSprite::SetColor(PIXEL_TYPE color) { mColor = (color&~MASK_ALPHA); } +#endif + +// void JSprite::SetBlendMode(int blend, int index) +// { +// if (index == -1) +// { +// for (int i=0;imBlend = blend; +// } +// else +// { +// if (index >= 0 && index < MAX_FRAMES) +// mFrames[index]->mBlend = blend; +// } +// +// } + +float JSprite::GetAlpha() { return mAlpha; } +float JSprite::GetDirection() { return mDirection; } +float JSprite::GetRotation() { return mRotation; } + +void JSprite::SetId(int id) { mId = id; } +int JSprite::GetId() { return mId; } + +int JSprite::GetCurrentFrameIndex() { return mCurrentFrame; } +void JSprite::SetCurrentFrameIndex(int frame) +{ + if (frame < (int)mFrames.size()) + mCurrentFrame = frame; +} + + +JQuad* JSprite::GetCurrentFrame() +{ + if (mCurrentFrame < (signed int)mFrames.size()) + return mFrames[mCurrentFrame]; + else + return NULL; +} + +int JSprite::GetFrameCount() +{ + return (int) mFrames.size(); +} + + +JQuad* JSprite::GetFrame(int index) +{ + if (index < (signed int)mFrames.size()) + return mFrames[index]; + else + return NULL; +} + + +float JSprite::GetX() { return mX; } +float JSprite::GetY() { return mY; } + +void JSprite::SetX(float x) { mX = x; } +void JSprite::SetY(float y) { mY = y; } + +void JSprite::SetActive(bool f) +{ + mActive = f; + if (mActive) + { + if (mFrames.size()==0) + mActive = false; + } +} + +bool JSprite::IsActive() { return mActive; } + +void JSprite::Move(float dx, float dy) +{ + mX += dx; + mY += dy; +} + + +// ------------------------------------------------------------------------------------------------ +JSpriteList::JSpriteList(int count) +{ + + mCount = count; + mList = new JSprite*[count]; + //mVictims = new JSpriteList*[count]; + + for (int i=0;iIsActive()) + { + mList[i]->Update(dt); +// if (mVictims[i]!= NULL) +// mVictims[i]->CheckCollision(mList[i]); + } + } +} + + +void JSpriteList::Render() +{ + for (int i=0;iIsActive()) + mList[i]->Render(); +} + + +void JSpriteList::AddSprite(JSprite *sprite)//, JSpriteList* victim) +{ + for (int i=0;iIsActive()) + { + mList[i]->SetActive(true); + mList[i]->SetPosition(x, y); + mList[i]->RestartAnimation(); + + return mList[i]; + } + } + + return NULL; +} + + +void JSpriteList::Activate(float x, float y, int index) +{ + if (index < mCount) + { + if (mList[index] != NULL) + { + mList[index]->SetActive(true); + mList[index]->SetPosition(x, y); + mList[index]->RestartAnimation(); + + } + } +} + +JSprite* JSpriteList::GetSprite(int index) +{ + if (index < mCount) + { + return mList[index]; + } + + return NULL; +} + +void JSpriteList::EnableAll(bool flag) +{ + for (int i=0;iSetActive(flag); + mList[i]->RestartAnimation(); + } + } +} diff --git a/JGE/src/JTTFont.cpp b/JGE/src/JTTFont.cpp index fdbdd4b58..a0dd3f58a 100644 --- a/JGE/src/JTTFont.cpp +++ b/JGE/src/JTTFont.cpp @@ -1,649 +1,649 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - -#include -#include -#include - -#include "../include/JFileSystem.h" -#include "../include/JTTFont.h" -#include "../include/Encoding.h" - -#include -#include FT_FREETYPE_H - -#ifdef WIN32 - #pragma comment( lib, "freetype.lib" ) -#endif - -#include "../include/JGE.h" -#include "../include/JRenderer.h" - - -#ifndef WIN32 - -// in JGBKFont.cpp -extern void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width); - -#endif - - -JTTFont::JTTFont(int cacheImageSize) -{ - - mColor = ARGB(255,255,255,255); - mSize = 0; - mAngle = 0.0; - mLibrary = 0; - mFace = 0; - - mFontLoaded = false; - mSharingFont = false; - mAntialias = true; - - mTexture = NULL; - - switch (cacheImageSize) - { - case CACHE_IMAGE_64x64: - mTexWidth = 64; - mTexHeight = 64; - break; - case CACHE_IMAGE_128x128: - mTexWidth = 128; - mTexHeight = 128; - break; - case CACHE_IMAGE_512x512: - mTexWidth = 512; - mTexHeight = 512; - break; - default: - mTexWidth = 256; - mTexHeight = 256; - break; - - } - - mTexture = JRenderer::GetInstance()->CreateTexture(mTexWidth, mTexHeight); - - for (int i=0;i TTF_CACHE_SIZE) - mMaxCharCount = TTF_CACHE_SIZE; - - - FT_Set_Transform(mFace, 0, 0); - - // JTTFont.h says setting font size will clear the cache - for (int i = 0; i < TTF_CACHE_SIZE; i++) - mCachedCode[i] = 0; - - return true; - } - else - return false; -} - - -FT_Library JTTFont::GetFontLibrary() -{ - return mLibrary; -} - - -FT_Byte* JTTFont::GetFontBits() -{ - return mFontBits; -} - - -int JTTFont::GetFontBitsSize() -{ - return mFontBitsSize; -} - - -bool JTTFont::Load(JTTFont* fontSource, int size, int mode) -{ - mLibrary = fontSource->GetFontLibrary(); - if (mLibrary) - { - mFontBits = fontSource->GetFontBits(); - mFontBitsSize = fontSource->GetFontBitsSize(); - - if (mFontBits && FT_New_Memory_Face(mLibrary, mFontBits, mFontBitsSize, 0, &mFace ) == 0) - { - mSharingFont = true; - mFontSource = fontSource; - - SetSize(size); - - if (mode == MODE_PRECACHE_ASCII) - PreCacheASCII(); - else if (mode == MODE_PRECACHE_ASCII_EX) - PreCacheExtendedASCII(); - - mFontLoaded = true; - - return true; - } - } - - return false; -} - - -bool JTTFont::Load(const char *filename, int size, int mode) -{ - - if (FT_Init_FreeType( &mLibrary ) == 0) - { - JFileSystem* fileSystem = JFileSystem::GetInstance(); - if (fileSystem->OpenFile(filename)) - { - mFontBitsSize = fileSystem->GetFileSize(); - - mFontBits = (FT_Byte*)malloc(mFontBitsSize); - - fileSystem->ReadFile(mFontBits, mFontBitsSize); - fileSystem->CloseFile(); - - if (FT_New_Memory_Face(mLibrary, mFontBits, mFontBitsSize, 0, &mFace ) == 0) - { - SetSize(size); - mFontLoaded = true; - - if (mode == MODE_PRECACHE_ASCII) - return PreCacheASCII(); - else if (mode == MODE_PRECACHE_ASCII_EX) - return PreCacheExtendedASCII(); - - - return true; - } - } - - } - - return false; -} - - -void JTTFont::Unload(void) -{ - FT_Done_Face(mFace); - mFace = 0; - mFontLoaded = false; - - if (!mSharingFont) - { - FT_Done_FreeType(mLibrary); - mLibrary = 0; - free(mFontBits); - } -} - - -int JTTFont::PreCacheChar(u16 ch, u16 cachedCode) -{ - for (int i=0;iGetFontLibrary() == NULL) - return -1; - - FT_GlyphSlot slot = mFace->glyph; - - #if defined (WIN32) || defined (LINUX) || defined (IOS) - DWORD *texBuffer = new DWORD[mMaxCharWidth*mMaxCharHeight]; - memset(texBuffer, 0, mMaxCharWidth*mMaxCharHeight*sizeof(DWORD)); - #else - - u8* pTexture = (u8*) mTexture->mBits; - - #endif - - int y = (mCurr/mColCount)*mMaxCharHeight; - int x = (mCurr%mColCount)*mMaxCharWidth; - int ret = -1; - - int renderFlag = FT_LOAD_RENDER; - if (!mAntialias) - renderFlag |= FT_LOAD_TARGET_MONO; - if (FT_Load_Char(mFace, ch, renderFlag) == 0) - { - int top = mSize-slot->bitmap_top+1; - - #if defined (WIN32) || defined (LINUX) || defined (IOS) - int offset = top*mMaxCharWidth + slot->bitmap_left + 2; - #else - int xx = x + slot->bitmap_left + 2; - int yy = y + top; - - for (int i=0;ibitmap.rows&&rows>=0;i++) - { - for (int j=0;jbitmap.width;j++) - { - grey = slot->bitmap.buffer[i * slot->bitmap.width + j]; - - #if defined (WIN32) || defined (LINUX) || defined (IOS) - texBuffer[i*mMaxCharWidth+j+offset] = RGBA(255, 255, 255, grey); - #else - SwizzlePlot(pTexture, ARGB(grey,255,255,255), (xx+j)*PIXEL_SIZE, yy+i, mTexWidth*PIXEL_SIZE); - #endif - } - rows--; - - } - } - else - { - u8 bits, mask; - for (int i=0;ibitmap.rows&&rows>=0;i++) - { - for (int j=0;jbitmap.pitch;j++) - { - bits = slot->bitmap.buffer[i * slot->bitmap.pitch + j]; - mask = 0x80; - for (int k=0;k<8;k++) - { - if (bits&mask) - { - #if defined (WIN32) || defined (LINUX) || defined (IOS) - texBuffer[i*mMaxCharWidth+j*8+k+offset] = RGBA(255, 255, 255, 255); - #else - SwizzlePlot(pTexture, ARGB(255,255,255,255), (xx+j*8+k)*PIXEL_SIZE, yy+i, mTexWidth*PIXEL_SIZE); - #endif - } - - mask>>=1; - } - } - rows--; - - } - } - } - - mXAdvance[mCurr] = (u8)(slot->advance.x>>6); - - #if defined (WIN32) || defined (LINUX) || defined (IOS) - glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, mMaxCharWidth, mMaxCharHeight, GL_RGBA, GL_UNSIGNED_BYTE, texBuffer); - #else - sceKernelDcacheWritebackAll(); - #endif - - mCachedCode[mCurr] = cachedCode; - ret = mCurr; - - mQuads[mCurr++]->SetTextureRect((float)(x+2), (float)(y+1), (float)(slot->bitmap_left+slot->bitmap.width), (float)mMaxCharHeight-1); - - if (mCurr >= mMaxCharCount) - mCurr = 0; - - #if defined (WIN32) || defined (LINUX) - delete [] texBuffer; - #endif - - return ret; -} - - -int JTTFont::GetCachedChar(u16 cachedCode) -{ - for (int i=0;iBindTexture(mTexture); - - u16 ch; - int index; - - while ((ch=*text++)!=0) - { - index = PreCacheChar(ch, ch); - if (index != -1) - { - if (render) - { - mQuads[index]->SetColor(mColor); - renderer->RenderQuad(mQuads[index], x, y); - } - x += mXAdvance[index]; - } - } - - return (int)x; -} - - -int JTTFont::RenderString(const char *text, float x, float y, bool render) -{ - JRenderer* renderer = JRenderer::GetInstance(); - renderer->BindTexture(mTexture); - - const u8* str = (const u8*) text; - u8 ch; - int index; - - if (mASCIIDirectMapping) - { - while ((ch=*str++)!=0) - { - index = ch-32; - if (render) - { - mQuads[index]->SetColor(mColor); - renderer->RenderQuad(mQuads[index], x, y); - } - x += mXAdvance[index]; - } - - } - else - { - while ((ch=*str++)!=0) - { - index = PreCacheChar(ch, ch); - if (index != -1) - { - if (render) - { - mQuads[index]->SetColor(mColor); - renderer->RenderQuad(mQuads[index], x, y); - } - x += mXAdvance[index]; - } - } - } - - return (int)x; -} - - -int JTTFont::RenderString(const u8 *text, float x, float y, bool render) -{ - JRenderer* renderer = JRenderer::GetInstance(); - renderer->BindTexture(mTexture); - - u8 ch; - int index; - float xo = x; - - while ((ch=*text)!=0) - { - if (ch == 0x0a) { - text++; - x = xo; - y += mSize; - continue; - } - if (ch < 0x80) - { - index = PreCacheChar(ch, ch); - text++; - } - else - { - u8 b1 = *text; - u8 b2 = *(text+1); - u16 n = b2; - n <<= 8; - n |= b1; - index = GetCachedChar(n); - if (index == -1) - { - u16 unicode = charsets_gbk_to_ucs(text); - index = PreCacheChar(unicode, n); // use GBK code for caching - } - text += 2; - } - if (index != -1) - { - if (render) - { - mQuads[index]->SetColor(mColor); - renderer->RenderQuad(mQuads[index], x, y); - } - x += mXAdvance[index]; - } - } - - return (int)x; -} - - -bool JTTFont::PreCacheASCII() -{ - int count = 127-32+1; - if (count > mMaxCharCount) - count = mMaxCharCount; - - { - int i = 32; - mCurr = 0; - for (int n=0;n mMaxCharCount) - count = mMaxCharCount; - - { - int i = 32; - mCurr = 0; - for (int n=0;n<=count;n++) - { - PreCacheChar(i, i); - i++; - } - - mASCIIDirectMapping = true; - //return true; - } - - return true; -} - - -void JTTFont::SetAntialias(bool flag) -{ - mAntialias = flag; -} +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + +#include +#include +#include + +#include "../include/JFileSystem.h" +#include "../include/JTTFont.h" +#include "../include/Encoding.h" + +#include +#include FT_FREETYPE_H + +#ifdef WIN32 + #pragma comment( lib, "freetype.lib" ) +#endif + +#include "../include/JGE.h" +#include "../include/JRenderer.h" + + +#ifndef WIN32 + +// in JGBKFont.cpp +extern void SwizzlePlot(u8* out, PIXEL_TYPE color, int i, int j, unsigned int width); + +#endif + + +JTTFont::JTTFont(int cacheImageSize) +{ + + mColor = ARGB(255,255,255,255); + mSize = 0; + mAngle = 0.0; + mLibrary = 0; + mFace = 0; + + mFontLoaded = false; + mSharingFont = false; + mAntialias = true; + + mTexture = NULL; + + switch (cacheImageSize) + { + case CACHE_IMAGE_64x64: + mTexWidth = 64; + mTexHeight = 64; + break; + case CACHE_IMAGE_128x128: + mTexWidth = 128; + mTexHeight = 128; + break; + case CACHE_IMAGE_512x512: + mTexWidth = 512; + mTexHeight = 512; + break; + default: + mTexWidth = 256; + mTexHeight = 256; + break; + + } + + mTexture = JRenderer::GetInstance()->CreateTexture(mTexWidth, mTexHeight); + + for (int i=0;i TTF_CACHE_SIZE) + mMaxCharCount = TTF_CACHE_SIZE; + + + FT_Set_Transform(mFace, 0, 0); + + // JTTFont.h says setting font size will clear the cache + for (int i = 0; i < TTF_CACHE_SIZE; i++) + mCachedCode[i] = 0; + + return true; + } + else + return false; +} + + +FT_Library JTTFont::GetFontLibrary() +{ + return mLibrary; +} + + +FT_Byte* JTTFont::GetFontBits() +{ + return mFontBits; +} + + +int JTTFont::GetFontBitsSize() +{ + return mFontBitsSize; +} + + +bool JTTFont::Load(JTTFont* fontSource, int size, int mode) +{ + mLibrary = fontSource->GetFontLibrary(); + if (mLibrary) + { + mFontBits = fontSource->GetFontBits(); + mFontBitsSize = fontSource->GetFontBitsSize(); + + if (mFontBits && FT_New_Memory_Face(mLibrary, mFontBits, mFontBitsSize, 0, &mFace ) == 0) + { + mSharingFont = true; + mFontSource = fontSource; + + SetSize(size); + + if (mode == MODE_PRECACHE_ASCII) + PreCacheASCII(); + else if (mode == MODE_PRECACHE_ASCII_EX) + PreCacheExtendedASCII(); + + mFontLoaded = true; + + return true; + } + } + + return false; +} + + +bool JTTFont::Load(const char *filename, int size, int mode) +{ + + if (FT_Init_FreeType( &mLibrary ) == 0) + { + JFileSystem* fileSystem = JFileSystem::GetInstance(); + if (fileSystem->OpenFile(filename)) + { + mFontBitsSize = fileSystem->GetFileSize(); + + mFontBits = (FT_Byte*)malloc(mFontBitsSize); + + fileSystem->ReadFile(mFontBits, mFontBitsSize); + fileSystem->CloseFile(); + + if (FT_New_Memory_Face(mLibrary, mFontBits, mFontBitsSize, 0, &mFace ) == 0) + { + SetSize(size); + mFontLoaded = true; + + if (mode == MODE_PRECACHE_ASCII) + return PreCacheASCII(); + else if (mode == MODE_PRECACHE_ASCII_EX) + return PreCacheExtendedASCII(); + + + return true; + } + } + + } + + return false; +} + + +void JTTFont::Unload(void) +{ + FT_Done_Face(mFace); + mFace = 0; + mFontLoaded = false; + + if (!mSharingFont) + { + FT_Done_FreeType(mLibrary); + mLibrary = 0; + free(mFontBits); + } +} + + +int JTTFont::PreCacheChar(u16 ch, u16 cachedCode) +{ + for (int i=0;iGetFontLibrary() == NULL) + return -1; + + FT_GlyphSlot slot = mFace->glyph; + + #if defined (WIN32) || defined (LINUX) || defined (IOS) + DWORD *texBuffer = new DWORD[mMaxCharWidth*mMaxCharHeight]; + memset(texBuffer, 0, mMaxCharWidth*mMaxCharHeight*sizeof(DWORD)); + #else + + u8* pTexture = (u8*) mTexture->mBits; + + #endif + + int y = (mCurr/mColCount)*mMaxCharHeight; + int x = (mCurr%mColCount)*mMaxCharWidth; + int ret = -1; + + int renderFlag = FT_LOAD_RENDER; + if (!mAntialias) + renderFlag |= FT_LOAD_TARGET_MONO; + if (FT_Load_Char(mFace, ch, renderFlag) == 0) + { + int top = mSize-slot->bitmap_top+1; + + #if defined (WIN32) || defined (LINUX) || defined (IOS) + int offset = top*mMaxCharWidth + slot->bitmap_left + 2; + #else + int xx = x + slot->bitmap_left + 2; + int yy = y + top; + + for (int i=0;ibitmap.rows&&rows>=0;i++) + { + for (int j=0;jbitmap.width;j++) + { + grey = slot->bitmap.buffer[i * slot->bitmap.width + j]; + + #if defined (WIN32) || defined (LINUX) || defined (IOS) + texBuffer[i*mMaxCharWidth+j+offset] = RGBA(255, 255, 255, grey); + #else + SwizzlePlot(pTexture, ARGB(grey,255,255,255), (xx+j)*PIXEL_SIZE, yy+i, mTexWidth*PIXEL_SIZE); + #endif + } + rows--; + + } + } + else + { + u8 bits, mask; + for (int i=0;ibitmap.rows&&rows>=0;i++) + { + for (int j=0;jbitmap.pitch;j++) + { + bits = slot->bitmap.buffer[i * slot->bitmap.pitch + j]; + mask = 0x80; + for (int k=0;k<8;k++) + { + if (bits&mask) + { + #if defined (WIN32) || defined (LINUX) || defined (IOS) + texBuffer[i*mMaxCharWidth+j*8+k+offset] = RGBA(255, 255, 255, 255); + #else + SwizzlePlot(pTexture, ARGB(255,255,255,255), (xx+j*8+k)*PIXEL_SIZE, yy+i, mTexWidth*PIXEL_SIZE); + #endif + } + + mask>>=1; + } + } + rows--; + + } + } + } + + mXAdvance[mCurr] = (u8)(slot->advance.x>>6); + + #if defined (WIN32) || defined (LINUX) || defined (IOS) + glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, mMaxCharWidth, mMaxCharHeight, GL_RGBA, GL_UNSIGNED_BYTE, texBuffer); + #else + sceKernelDcacheWritebackAll(); + #endif + + mCachedCode[mCurr] = cachedCode; + ret = mCurr; + + mQuads[mCurr++]->SetTextureRect((float)(x+2), (float)(y+1), (float)(slot->bitmap_left+slot->bitmap.width), (float)mMaxCharHeight-1); + + if (mCurr >= mMaxCharCount) + mCurr = 0; + + #if defined (WIN32) || defined (LINUX) + delete [] texBuffer; + #endif + + return ret; +} + + +int JTTFont::GetCachedChar(u16 cachedCode) +{ + for (int i=0;iBindTexture(mTexture); + + u16 ch; + int index; + + while ((ch=*text++)!=0) + { + index = PreCacheChar(ch, ch); + if (index != -1) + { + if (render) + { + mQuads[index]->SetColor(mColor); + renderer->RenderQuad(mQuads[index], x, y); + } + x += mXAdvance[index]; + } + } + + return (int)x; +} + + +int JTTFont::RenderString(const char *text, float x, float y, bool render) +{ + JRenderer* renderer = JRenderer::GetInstance(); + renderer->BindTexture(mTexture); + + const u8* str = (const u8*) text; + u8 ch; + int index; + + if (mASCIIDirectMapping) + { + while ((ch=*str++)!=0) + { + index = ch-32; + if (render) + { + mQuads[index]->SetColor(mColor); + renderer->RenderQuad(mQuads[index], x, y); + } + x += mXAdvance[index]; + } + + } + else + { + while ((ch=*str++)!=0) + { + index = PreCacheChar(ch, ch); + if (index != -1) + { + if (render) + { + mQuads[index]->SetColor(mColor); + renderer->RenderQuad(mQuads[index], x, y); + } + x += mXAdvance[index]; + } + } + } + + return (int)x; +} + + +int JTTFont::RenderString(const u8 *text, float x, float y, bool render) +{ + JRenderer* renderer = JRenderer::GetInstance(); + renderer->BindTexture(mTexture); + + u8 ch; + int index; + float xo = x; + + while ((ch=*text)!=0) + { + if (ch == 0x0a) { + text++; + x = xo; + y += mSize; + continue; + } + if (ch < 0x80) + { + index = PreCacheChar(ch, ch); + text++; + } + else + { + u8 b1 = *text; + u8 b2 = *(text+1); + u16 n = b2; + n <<= 8; + n |= b1; + index = GetCachedChar(n); + if (index == -1) + { + u16 unicode = charsets_gbk_to_ucs(text); + index = PreCacheChar(unicode, n); // use GBK code for caching + } + text += 2; + } + if (index != -1) + { + if (render) + { + mQuads[index]->SetColor(mColor); + renderer->RenderQuad(mQuads[index], x, y); + } + x += mXAdvance[index]; + } + } + + return (int)x; +} + + +bool JTTFont::PreCacheASCII() +{ + int count = 127-32+1; + if (count > mMaxCharCount) + count = mMaxCharCount; + + { + int i = 32; + mCurr = 0; + for (int n=0;n mMaxCharCount) + count = mMaxCharCount; + + { + int i = 32; + mCurr = 0; + for (int n=0;n<=count;n++) + { + PreCacheChar(i, i); + i++; + } + + mASCIIDirectMapping = true; + //return true; + } + + return true; +} + + +void JTTFont::SetAntialias(bool flag) +{ + mAntialias = flag; +} diff --git a/JGE/src/Vector2D.cpp b/JGE/src/Vector2D.cpp index 838791cb3..12b627143 100644 --- a/JGE/src/Vector2D.cpp +++ b/JGE/src/Vector2D.cpp @@ -1,81 +1,81 @@ -//------------------------------------------------------------------------------------- -// -// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. -// -// Licensed under the BSD license, see LICENSE in JGE root for details. -// -// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) -// -//------------------------------------------------------------------------------------- - - -#include "../include/Vector2D.h" - - -float Vector2D::Length(void) const -{ - return sqrtf(x*x + y*y); -} - -float Vector2D::Normalize(void) -{ - float fLength = Length(); - - if (fLength == 0.0f) - return 0.0f; - - (*this) *= (1.0f / fLength); - - return fLength; -} - - -Vector2D Vector2D::Direction(void) const -{ - Vector2D temp(*this); - - temp.Normalize(); - - return temp; -} - -float Vector2D::Angle(const Vector2D& xE) -{ - float dot = (*this) * xE; - float cross = (*this) ^ xE; - - // angle between segments - float angle = atan2f(cross, dot); - - return angle; -} - - -Vector2D& Vector2D::Rotate(float angle) -{ - float tx = x; - x = x * cosf(angle) - y * sinf(angle); - y = tx * sinf(angle) + y * cosf(angle); - - return *this; -} - - - -Vector2D& Vector2D::Rotate(const Vector2D& xCentre, float fAngle) -{ - Vector2D D = *this - xCentre; - D.Rotate(fAngle); - - *this = xCentre + D; - - return *this; -} - - -void Vector2D::Clamp(const Vector2D& min, const Vector2D& max) -{ - x = (x < min.x)? min.x : (x > max.x)? max.x : x; - x = (y < min.y)? min.y : (y > max.y)? max.y : y; -} - +//------------------------------------------------------------------------------------- +// +// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows. +// +// Licensed under the BSD license, see LICENSE in JGE root for details. +// +// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) +// +//------------------------------------------------------------------------------------- + + +#include "../include/Vector2D.h" + + +float Vector2D::Length(void) const +{ + return sqrtf(x*x + y*y); +} + +float Vector2D::Normalize(void) +{ + float fLength = Length(); + + if (fLength == 0.0f) + return 0.0f; + + (*this) *= (1.0f / fLength); + + return fLength; +} + + +Vector2D Vector2D::Direction(void) const +{ + Vector2D temp(*this); + + temp.Normalize(); + + return temp; +} + +float Vector2D::Angle(const Vector2D& xE) +{ + float dot = (*this) * xE; + float cross = (*this) ^ xE; + + // angle between segments + float angle = atan2f(cross, dot); + + return angle; +} + + +Vector2D& Vector2D::Rotate(float angle) +{ + float tx = x; + x = x * cosf(angle) - y * sinf(angle); + y = tx * sinf(angle) + y * cosf(angle); + + return *this; +} + + + +Vector2D& Vector2D::Rotate(const Vector2D& xCentre, float fAngle) +{ + Vector2D D = *this - xCentre; + D.Rotate(fAngle); + + *this = xCentre + D; + + return *this; +} + + +void Vector2D::Clamp(const Vector2D& min, const Vector2D& max) +{ + x = (x < min.x)? min.x : (x > max.x)? max.x : x; + x = (y < min.y)? min.y : (y > max.y)? max.y : y; +} + diff --git a/JGE/src/hge/hgecolor.cpp b/JGE/src/hge/hgecolor.cpp index f0cec6eb1..7b643e432 100644 --- a/JGE/src/hge/hgecolor.cpp +++ b/JGE/src/hge/hgecolor.cpp @@ -1,89 +1,89 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeColor*** helper classes implementation -*/ - - -#include "../../include/hge/hgecolor.h" -#include - -#ifndef min - #define min(x, y) ((xy)?x:y) -#endif - -void hgeColorHSV::SetHWColor(DWORD col) -{ - float r, g, b; - float minv, maxv, delta; - float del_R, del_G, del_B; - - a = (col>>24) / 255.0f; - r = ((col>>16) & 0xFF) / 255.0f; - g = ((col>>8) & 0xFF) / 255.0f; - b = (col & 0xFF) / 255.0f; - - minv = min(min(r, g), b); - maxv = max(max(r, g), b); - delta = maxv - minv; - - v = maxv; - - if (delta == 0) - { - h = 0; - s = 0; - } - else - { - s = delta / maxv; - del_R = (((maxv - r) / 6) + (delta / 2)) / delta; - del_G = (((maxv - g) / 6) + (delta / 2)) / delta; - del_B = (((maxv - b) / 6) + (delta / 2)) / delta; - - if (r == maxv) {h = del_B - del_G;} - else if (g == maxv) {h = (1 / 3) + del_R - del_B;} - else if (b == maxv) {h = (2 / 3) + del_G - del_R;} - - if (h < 0) h += 1; - if (h > 1) h -= 1; - } -} - -DWORD hgeColorHSV::GetHWColor() const -{ - float r, g, b; - float xh, i, p1, p2, p3; - - if (s == 0) - { - r = v; - g = v; - b = v; - } - else - { - xh = h * 6; - if(xh == 6) xh=0; - i = floorf(xh); - p1 = v * (1 - s); - p2 = v * (1 - s * (xh - i)); - p3 = v * (1 - s * (1 - (xh - i))); - - if (i == 0) {r = v; g = p3; b = p1;} - else if (i == 1) {r = p2; g = v; b = p1;} - else if (i == 2) {r = p1; g = v; b = p3;} - else if (i == 3) {r = p1; g = p2; b = v; } - else if (i == 4) {r = p3; g = p1; b = v; } - else {r = v; g = p1; b = p2;} - } - - return (ARGB((int)(a*255.0f), (int)(r*255.0f), (int)(g*255.0f), (int)(b*255.0f))); -} - +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** hgeColor*** helper classes implementation +*/ + + +#include "../../include/hge/hgecolor.h" +#include + +#ifndef min + #define min(x, y) ((xy)?x:y) +#endif + +void hgeColorHSV::SetHWColor(DWORD col) +{ + float r, g, b; + float minv, maxv, delta; + float del_R, del_G, del_B; + + a = (col>>24) / 255.0f; + r = ((col>>16) & 0xFF) / 255.0f; + g = ((col>>8) & 0xFF) / 255.0f; + b = (col & 0xFF) / 255.0f; + + minv = min(min(r, g), b); + maxv = max(max(r, g), b); + delta = maxv - minv; + + v = maxv; + + if (delta == 0) + { + h = 0; + s = 0; + } + else + { + s = delta / maxv; + del_R = (((maxv - r) / 6) + (delta / 2)) / delta; + del_G = (((maxv - g) / 6) + (delta / 2)) / delta; + del_B = (((maxv - b) / 6) + (delta / 2)) / delta; + + if (r == maxv) {h = del_B - del_G;} + else if (g == maxv) {h = (1 / 3) + del_R - del_B;} + else if (b == maxv) {h = (2 / 3) + del_G - del_R;} + + if (h < 0) h += 1; + if (h > 1) h -= 1; + } +} + +DWORD hgeColorHSV::GetHWColor() const +{ + float r, g, b; + float xh, i, p1, p2, p3; + + if (s == 0) + { + r = v; + g = v; + b = v; + } + else + { + xh = h * 6; + if(xh == 6) xh=0; + i = floorf(xh); + p1 = v * (1 - s); + p2 = v * (1 - s * (xh - i)); + p3 = v * (1 - s * (1 - (xh - i))); + + if (i == 0) {r = v; g = p3; b = p1;} + else if (i == 1) {r = p2; g = v; b = p1;} + else if (i == 2) {r = p1; g = v; b = p3;} + else if (i == 3) {r = p1; g = p2; b = v; } + else if (i == 4) {r = p3; g = p1; b = v; } + else {r = v; g = p1; b = p2;} + } + + return (ARGB((int)(a*255.0f), (int)(r*255.0f), (int)(g*255.0f), (int)(b*255.0f))); +} + diff --git a/JGE/src/hge/hgedistort.cpp b/JGE/src/hge/hgedistort.cpp index 3eccfc951..1c70d2ec3 100644 --- a/JGE/src/hge/hgedistort.cpp +++ b/JGE/src/hge/hgedistort.cpp @@ -1,252 +1,252 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeDistortionMesh helper class implementation -*/ - -#include "../../include/JGE.h" -#include "../../include/JTypes.h" -#include "../../include/JRenderer.h" -#include "../../include/JFileSystem.h" - -#include "../../include/hge/hgedistort.h" - - -//HGE *hgeDistortionMesh::hge=0; - - -hgeDistortionMesh::hgeDistortionMesh(int cols, int rows) -{ - int i; - - //hge=hgeCreate(HGE_VERSION); - - nRows=rows; - nCols=cols; - cellw=cellh=0; - //quad.tex=0; - //quad.blend=BLEND_COLORMUL | BLEND_ALPHABLEND | BLEND_ZWRITE; - - quad = NULL; - - disp_array=new Vertex[rows*cols]; - - for(i=0;imTex) - { - tw=(float)quad->mTex->mTexWidth; - th=(float)quad->mTex->mTexHeight; - } - else - { - tw = w; - th = h; - } - - cellw=w/(nCols-1); - cellh=h/(nRows-1); - - for(j=0; jSetTextureRect(disp_array[idx].u, disp_array[idx].v, cellw, cellh); - - points[0].x = x+disp_array[idx+nCols].x; - points[0].y = y+disp_array[idx+nCols].y; - points[0].z = disp_array[idx+nCols].z; - points[0].color = disp_array[idx+nCols].color; - - points[1].x = x+disp_array[idx+nCols+1].x; - points[1].y = y+disp_array[idx+nCols+1].y; - points[1].z = disp_array[idx+nCols+1].z; - points[1].color = disp_array[idx+nCols+1].color; - - points[2].x = x+disp_array[idx+1].x; - points[2].y = y+disp_array[idx+1].y; - points[2].z = disp_array[idx+1].z; - points[2].color = disp_array[idx+1].color; - - points[3].x = x+disp_array[idx].x; - points[3].y = y+disp_array[idx].y; - points[3].z = disp_array[idx].z; - points[3].color = disp_array[idx].color; - - renderer->RenderQuad(quad, points); - - } -} - -void hgeDistortionMesh::SetZ(int col, int row, float z) -{ - if(rowmTex) + { + tw=(float)quad->mTex->mTexWidth; + th=(float)quad->mTex->mTexHeight; + } + else + { + tw = w; + th = h; + } + + cellw=w/(nCols-1); + cellh=h/(nRows-1); + + for(j=0; jSetTextureRect(disp_array[idx].u, disp_array[idx].v, cellw, cellh); + + points[0].x = x+disp_array[idx+nCols].x; + points[0].y = y+disp_array[idx+nCols].y; + points[0].z = disp_array[idx+nCols].z; + points[0].color = disp_array[idx+nCols].color; + + points[1].x = x+disp_array[idx+nCols+1].x; + points[1].y = y+disp_array[idx+nCols+1].y; + points[1].z = disp_array[idx+nCols+1].z; + points[1].color = disp_array[idx+nCols+1].color; + + points[2].x = x+disp_array[idx+1].x; + points[2].y = y+disp_array[idx+1].y; + points[2].z = disp_array[idx+1].z; + points[2].color = disp_array[idx+1].color; + + points[3].x = x+disp_array[idx].x; + points[3].y = y+disp_array[idx].y; + points[3].z = disp_array[idx].z; + points[3].color = disp_array[idx].color; + + renderer->RenderQuad(quad, points); + + } +} + +void hgeDistortionMesh::SetZ(int col, int row, float z) +{ + if(row -#include - -const char FNTHEADERTAG[] = "[HGEFONT]"; -const char FNTBITMAPTAG[] = "Bitmap"; -const char FNTCHARTAG[] = "Char"; - - -//HGE *hgeFont::hge=0; -char hgeFont::buffer[256]; - - -hgeFont::hgeFont(const char *szFont, bool bMipmap __attribute__((unused))) -{ - //void *data; - DWORD size; - char *desc, *pdesc; - char linebuf[256]; - char buf[512], *pbuf; - char chr; - int i, x, y, w, h, a, c; - - // Setup variables - - //hge=hgeCreate(HGE_VERSION); - - fHeight=0.0f; - fScale=1.0f; - fProportion=1.0f; - fRot=0.0f; - fTracking=0.0f; - fSpacing=1.0f; - hTexture=0; - - fZ=0.5f; - //nBlend=BLEND_COLORMUL | BLEND_ALPHABLEND | BLEND_NOZWRITE; - dwCol=ARGB(0xFF,0xFF,0xFF,0xFF); - - memset( &letters, 0, sizeof(letters) ); - memset( &pre, 0, sizeof(letters) ); - memset( &post, 0, sizeof(letters) ); - - // Load font description - - JFileSystem* fileSys = JFileSystem::GetInstance(); - if (!fileSys->OpenFile(szFont)) return; - - //data=hge->Resource_Load(szFont, &size); - //if(!data) return; - size = fileSys->GetFileSize(); - - desc = new char[size+1]; - //memcpy(desc,data,size); - fileSys->ReadFile(desc, size); - desc[size]=0; - - //hge->Resource_Free(data); - fileSys->CloseFile(); - - pdesc=_get_line(desc,linebuf); - if(strcmp(linebuf, FNTHEADERTAG)) - { -// hge->System_Log("Font %s has incorrect format.", szFont); - delete[] desc; - return; - } - - // Parse font description - - JRenderer* renderer = JRenderer::GetInstance(); - - while((pdesc = _get_line(pdesc,linebuf))!=NULL) - { - if(!strncmp(linebuf, FNTBITMAPTAG, sizeof(FNTBITMAPTAG)-1 )) - { - strcpy(buf,szFont); - pbuf=strrchr(buf,'\\'); - if(!pbuf) pbuf=strrchr(buf,'/'); - if(!pbuf) pbuf=buf; - else pbuf++; - if(!sscanf(linebuf, "Bitmap = %s", pbuf)) continue; - - //hTexture=hge->Texture_Load(buf, 0, bMipmap); - hTexture = renderer->LoadTexture(buf); - if(!hTexture) - { - delete[] desc; - return; - } - } - - else if(!strncmp(linebuf, FNTCHARTAG, sizeof(FNTCHARTAG)-1 )) - { - pbuf=strchr(linebuf,'='); - if(!pbuf) continue; - pbuf++; - while(*pbuf==' ') pbuf++; - if(*pbuf=='\"') - { - pbuf++; - i=(unsigned char)*pbuf++; - pbuf++; // skip " - } - else - { - i=0; - while((*pbuf>='0' && *pbuf<='9') || (*pbuf>='A' && *pbuf<='F') || (*pbuf>='a' && *pbuf<='f')) - { - chr=*pbuf; - if(chr >= 'a') chr-='a'-':'; - if(chr >= 'A') chr-='A'-':'; - chr-='0'; - if(chr>0xF) chr=0xF; - i=(i << 4) | chr; - pbuf++; - } - if(i<0 || i>255) continue; - } - sscanf(pbuf, " , %d , %d , %d , %d , %d , %d", &x, &y, &w, &h, &a, &c); - - letters[i] = new JQuad(hTexture, (float)x, (float)y, (float)w, (float)h); - pre[i]=(float)a; - post[i]=(float)c; - if(h>fHeight) fHeight=(float)h; - } - } - - delete[] desc; -} - - -hgeFont::~hgeFont() -{ - for(int i=0; i<256; i++) - if(letters[i]) delete letters[i]; - if(hTexture) delete hTexture; - //hge->Release(); -} - -void hgeFont::Render(float x, float y, int align, const char *string) -{ - int i; - float fx=x; - - JRenderer* renderer = JRenderer::GetInstance(); - - align &= HGETEXT_HORZMASK; - if(align==HGETEXT_RIGHT) fx-=GetStringWidth(string); - if(align==HGETEXT_CENTER) fx-=int(GetStringWidth(string)/2.0f); - - while(*string) - { - if(*string=='\n') - { - y += int(fHeight*fScale*fSpacing); - fx = x; - if(align == HGETEXT_RIGHT) fx -= GetStringWidth(string+1); - if(align == HGETEXT_CENTER) fx -= int(GetStringWidth(string+1)/2.0f); - } - else - { - i=(unsigned char)*string; - if(!letters[i]) i='?'; - if(letters[i]) - { - fx += pre[i]*fScale*fProportion; - //letters[i]->RenderEx(fx, y, fRot, fScale*fProportion, fScale); - renderer->RenderQuad(letters[i], fx, y, fRot, fScale*fProportion, fScale); - fx += (letters[i]->mWidth+post[i]+fTracking)*fScale*fProportion; - } - } - string++; - } -} - -void hgeFont::printf(float x, float y, int align, const char *format, ...) -{ - //char *pArg=(char *) &format+sizeof(format); - - //_vsnprintf(buffer, sizeof(buffer)-1, format, pArg); - //buffer[sizeof(buffer)-1]=0; - //vsprintf(buffer, format, pArg); - va_list list; - - va_start(list, format); - vsprintf(buffer, format, list); - va_end(list); - - Render(x,y,align,buffer); -} - -void hgeFont::printfb(float x, float y, float w, float h, int align, const char *format, ...) -{ - char chr, *pbuf, *prevword, *linestart; - int i,lines=0; - float tx, ty, hh, ww; - //char *pArg=(char *) &format+sizeof(format); - - //_vsnprintf(buffer, sizeof(buffer)-1, format, pArg); - //buffer[sizeof(buffer)-1]=0; - //vsprintf(buffer, format, pArg); - - va_list list; - - va_start(list, format); - vsprintf(buffer, format, list); - va_end(list); - - - linestart=buffer; - pbuf=buffer; - prevword=0; - - for(;;) - { - i=0; - while(pbuf[i] && pbuf[i]!=' ' && pbuf[i]!='\n') i++; - - chr=pbuf[i]; - pbuf[i]=0; - ww=GetStringWidth(linestart); - pbuf[i]=chr; - - if(ww > w) - { - if(pbuf==linestart) - { - pbuf[i]='\n'; - linestart=&pbuf[i+1]; - } - else - { - *prevword='\n'; - linestart=prevword+1; - } - - lines++; - } - - if(pbuf[i]=='\n') - { - prevword=&pbuf[i]; - linestart=&pbuf[i+1]; - pbuf=&pbuf[i+1]; - lines++; - continue; - } - - if(!pbuf[i]) {lines++;break;} - - prevword=&pbuf[i]; - pbuf=&pbuf[i+1]; - } - - tx=x; - ty=y; - hh=fHeight*fSpacing*fScale*lines; - - switch(align & HGETEXT_HORZMASK) - { - case HGETEXT_LEFT: break; - case HGETEXT_RIGHT: tx+=w; break; - case HGETEXT_CENTER: tx+=int(w/2); break; - } - - switch(align & HGETEXT_VERTMASK) - { - case HGETEXT_TOP: break; - case HGETEXT_BOTTOM: ty+=h-hh; break; - case HGETEXT_MIDDLE: ty+=int((h-hh)/2); break; - } - - Render(tx,ty,align,buffer); -} - -float hgeFont::GetStringWidth(const char *string) const -{ - int i; - float linew, w = 0; - - while(*string) - { - linew = 0; - - while(*string && *string != '\n') - { - i=(unsigned char)*string; - if(!letters[i]) i='?'; - if(letters[i]) - linew += letters[i]->mWidth + pre[i] + post[i] + fTracking; - - string++; - } - - if(linew > w) w = linew; - - while (*string == '\n' || *string == '\r') string++; - } - - return w*fScale*fProportion; -} - -void hgeFont::SetColor(PIXEL_TYPE col) -{ - dwCol = col; - - for(int i=0; i<256; i++) - if(letters[i]) - letters[i]->SetColor(col); -} - -void hgeFont::SetZ(float z) -{ - fZ = z; - - //for(int i=0; i<256; i++) - // if(letters[i]) - // letters[i]->SetZ(z); -} - -void hgeFont::SetBlendMode(int blend) -{ - nBlend = blend; - - //for(int i=0; i<256; i++) - // if(letters[i]) - // letters[i]->SetBlendMode(blend); -} - -char *hgeFont::_get_line(char *file, char *line) -{ - int i=0; - - if(!file[i]) return 0; - - while(file[i] && file[i]!='\n' && file[i]!='\r') - { - line[i]=file[i]; - i++; - } - line[i]=0; - - while(file[i] && (file[i]=='\n' || file[i]=='\r')) i++; - - return file + i; -} +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** hgeFont helper class implementation +*/ + +#include "../../include/JGE.h" +#include "../../include/JTypes.h" +#include "../../include/JRenderer.h" +#include "../../include/JFileSystem.h" + +#include "../../include/hge/hgefont.h" +#include +#include + +const char FNTHEADERTAG[] = "[HGEFONT]"; +const char FNTBITMAPTAG[] = "Bitmap"; +const char FNTCHARTAG[] = "Char"; + + +//HGE *hgeFont::hge=0; +char hgeFont::buffer[256]; + + +hgeFont::hgeFont(const char *szFont, bool bMipmap __attribute__((unused))) +{ + //void *data; + DWORD size; + char *desc, *pdesc; + char linebuf[256]; + char buf[512], *pbuf; + char chr; + int i, x, y, w, h, a, c; + + // Setup variables + + //hge=hgeCreate(HGE_VERSION); + + fHeight=0.0f; + fScale=1.0f; + fProportion=1.0f; + fRot=0.0f; + fTracking=0.0f; + fSpacing=1.0f; + hTexture=0; + + fZ=0.5f; + //nBlend=BLEND_COLORMUL | BLEND_ALPHABLEND | BLEND_NOZWRITE; + dwCol=ARGB(0xFF,0xFF,0xFF,0xFF); + + memset( &letters, 0, sizeof(letters) ); + memset( &pre, 0, sizeof(letters) ); + memset( &post, 0, sizeof(letters) ); + + // Load font description + + JFileSystem* fileSys = JFileSystem::GetInstance(); + if (!fileSys->OpenFile(szFont)) return; + + //data=hge->Resource_Load(szFont, &size); + //if(!data) return; + size = fileSys->GetFileSize(); + + desc = new char[size+1]; + //memcpy(desc,data,size); + fileSys->ReadFile(desc, size); + desc[size]=0; + + //hge->Resource_Free(data); + fileSys->CloseFile(); + + pdesc=_get_line(desc,linebuf); + if(strcmp(linebuf, FNTHEADERTAG)) + { +// hge->System_Log("Font %s has incorrect format.", szFont); + delete[] desc; + return; + } + + // Parse font description + + JRenderer* renderer = JRenderer::GetInstance(); + + while((pdesc = _get_line(pdesc,linebuf))!=NULL) + { + if(!strncmp(linebuf, FNTBITMAPTAG, sizeof(FNTBITMAPTAG)-1 )) + { + strcpy(buf,szFont); + pbuf=strrchr(buf,'\\'); + if(!pbuf) pbuf=strrchr(buf,'/'); + if(!pbuf) pbuf=buf; + else pbuf++; + if(!sscanf(linebuf, "Bitmap = %s", pbuf)) continue; + + //hTexture=hge->Texture_Load(buf, 0, bMipmap); + hTexture = renderer->LoadTexture(buf); + if(!hTexture) + { + delete[] desc; + return; + } + } + + else if(!strncmp(linebuf, FNTCHARTAG, sizeof(FNTCHARTAG)-1 )) + { + pbuf=strchr(linebuf,'='); + if(!pbuf) continue; + pbuf++; + while(*pbuf==' ') pbuf++; + if(*pbuf=='\"') + { + pbuf++; + i=(unsigned char)*pbuf++; + pbuf++; // skip " + } + else + { + i=0; + while((*pbuf>='0' && *pbuf<='9') || (*pbuf>='A' && *pbuf<='F') || (*pbuf>='a' && *pbuf<='f')) + { + chr=*pbuf; + if(chr >= 'a') chr-='a'-':'; + if(chr >= 'A') chr-='A'-':'; + chr-='0'; + if(chr>0xF) chr=0xF; + i=(i << 4) | chr; + pbuf++; + } + if(i<0 || i>255) continue; + } + sscanf(pbuf, " , %d , %d , %d , %d , %d , %d", &x, &y, &w, &h, &a, &c); + + letters[i] = new JQuad(hTexture, (float)x, (float)y, (float)w, (float)h); + pre[i]=(float)a; + post[i]=(float)c; + if(h>fHeight) fHeight=(float)h; + } + } + + delete[] desc; +} + + +hgeFont::~hgeFont() +{ + for(int i=0; i<256; i++) + if(letters[i]) delete letters[i]; + if(hTexture) delete hTexture; + //hge->Release(); +} + +void hgeFont::Render(float x, float y, int align, const char *string) +{ + int i; + float fx=x; + + JRenderer* renderer = JRenderer::GetInstance(); + + align &= HGETEXT_HORZMASK; + if(align==HGETEXT_RIGHT) fx-=GetStringWidth(string); + if(align==HGETEXT_CENTER) fx-=int(GetStringWidth(string)/2.0f); + + while(*string) + { + if(*string=='\n') + { + y += int(fHeight*fScale*fSpacing); + fx = x; + if(align == HGETEXT_RIGHT) fx -= GetStringWidth(string+1); + if(align == HGETEXT_CENTER) fx -= int(GetStringWidth(string+1)/2.0f); + } + else + { + i=(unsigned char)*string; + if(!letters[i]) i='?'; + if(letters[i]) + { + fx += pre[i]*fScale*fProportion; + //letters[i]->RenderEx(fx, y, fRot, fScale*fProportion, fScale); + renderer->RenderQuad(letters[i], fx, y, fRot, fScale*fProportion, fScale); + fx += (letters[i]->mWidth+post[i]+fTracking)*fScale*fProportion; + } + } + string++; + } +} + +void hgeFont::printf(float x, float y, int align, const char *format, ...) +{ + //char *pArg=(char *) &format+sizeof(format); + + //_vsnprintf(buffer, sizeof(buffer)-1, format, pArg); + //buffer[sizeof(buffer)-1]=0; + //vsprintf(buffer, format, pArg); + va_list list; + + va_start(list, format); + vsprintf(buffer, format, list); + va_end(list); + + Render(x,y,align,buffer); +} + +void hgeFont::printfb(float x, float y, float w, float h, int align, const char *format, ...) +{ + char chr, *pbuf, *prevword, *linestart; + int i,lines=0; + float tx, ty, hh, ww; + //char *pArg=(char *) &format+sizeof(format); + + //_vsnprintf(buffer, sizeof(buffer)-1, format, pArg); + //buffer[sizeof(buffer)-1]=0; + //vsprintf(buffer, format, pArg); + + va_list list; + + va_start(list, format); + vsprintf(buffer, format, list); + va_end(list); + + + linestart=buffer; + pbuf=buffer; + prevword=0; + + for(;;) + { + i=0; + while(pbuf[i] && pbuf[i]!=' ' && pbuf[i]!='\n') i++; + + chr=pbuf[i]; + pbuf[i]=0; + ww=GetStringWidth(linestart); + pbuf[i]=chr; + + if(ww > w) + { + if(pbuf==linestart) + { + pbuf[i]='\n'; + linestart=&pbuf[i+1]; + } + else + { + *prevword='\n'; + linestart=prevword+1; + } + + lines++; + } + + if(pbuf[i]=='\n') + { + prevword=&pbuf[i]; + linestart=&pbuf[i+1]; + pbuf=&pbuf[i+1]; + lines++; + continue; + } + + if(!pbuf[i]) {lines++;break;} + + prevword=&pbuf[i]; + pbuf=&pbuf[i+1]; + } + + tx=x; + ty=y; + hh=fHeight*fSpacing*fScale*lines; + + switch(align & HGETEXT_HORZMASK) + { + case HGETEXT_LEFT: break; + case HGETEXT_RIGHT: tx+=w; break; + case HGETEXT_CENTER: tx+=int(w/2); break; + } + + switch(align & HGETEXT_VERTMASK) + { + case HGETEXT_TOP: break; + case HGETEXT_BOTTOM: ty+=h-hh; break; + case HGETEXT_MIDDLE: ty+=int((h-hh)/2); break; + } + + Render(tx,ty,align,buffer); +} + +float hgeFont::GetStringWidth(const char *string) const +{ + int i; + float linew, w = 0; + + while(*string) + { + linew = 0; + + while(*string && *string != '\n') + { + i=(unsigned char)*string; + if(!letters[i]) i='?'; + if(letters[i]) + linew += letters[i]->mWidth + pre[i] + post[i] + fTracking; + + string++; + } + + if(linew > w) w = linew; + + while (*string == '\n' || *string == '\r') string++; + } + + return w*fScale*fProportion; +} + +void hgeFont::SetColor(PIXEL_TYPE col) +{ + dwCol = col; + + for(int i=0; i<256; i++) + if(letters[i]) + letters[i]->SetColor(col); +} + +void hgeFont::SetZ(float z) +{ + fZ = z; + + //for(int i=0; i<256; i++) + // if(letters[i]) + // letters[i]->SetZ(z); +} + +void hgeFont::SetBlendMode(int blend) +{ + nBlend = blend; + + //for(int i=0; i<256; i++) + // if(letters[i]) + // letters[i]->SetBlendMode(blend); +} + +char *hgeFont::_get_line(char *file, char *line) +{ + int i=0; + + if(!file[i]) return 0; + + while(file[i] && file[i]!='\n' && file[i]!='\r') + { + line[i]=file[i]; + i++; + } + line[i]=0; + + while(file[i] && (file[i]=='\n' || file[i]=='\r')) i++; + + return file + i; +} diff --git a/JGE/src/hge/hgeparticle.cpp b/JGE/src/hge/hgeparticle.cpp index 2e628e298..453da387c 100644 --- a/JGE/src/hge/hgeparticle.cpp +++ b/JGE/src/hge/hgeparticle.cpp @@ -1,306 +1,306 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeParticleSystem helper class implementation -*/ - -#include "../../include/JGE.h" -#include "../../include/JTypes.h" -#include "../../include/JRenderer.h" -#include "../../include/JFileSystem.h" - -#include "../../include/hge/hgeparticle.h" - - -//HGE *hgeParticleSystem::hge=0; - -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** Core functions implementation: random number generation -*/ - - -unsigned int g_seed=0; - -void Random_Seed(int seed) -{ - if(!seed) g_seed=JGE::GetInstance()->GetTime(); - else g_seed=seed; -} - -int Random_Int(int min, int max) -{ - g_seed=214013*g_seed+2531011; - return min+(g_seed ^ g_seed>>15)%(max-min+1); -} - -float Random_Float(float min, float max) -{ - g_seed=214013*g_seed+2531011; - return min+(g_seed>>16)*(1.0f/65535.0f)*(max-min); -} - - - - -hgeParticleSystem::hgeParticleSystem(const char *filename, JQuad *sprite) -{ - //void *psi; - //hgeParticleSystemInfo psi; - - JFileSystem* fileSys = JFileSystem::GetInstance(); - //hge=hgeCreate(HGE_VERSION); - - //psi=hge->Resource_Load(filename); - if (!fileSys->OpenFile(filename)) return; - - //if(!psi) return; - - //memcpy(&info, psi, sizeof(hgeParticleSystemInfo)); - //hge->Resource_Free(psi); - - // Skip reading the pointer as it may be larger than 4 bytes in the structure - void *dummyPointer; - fileSys->ReadFile(&dummyPointer, 4); - // we're actually trying to read more than the file size now, but it's no problem. - // Note that this fix is only to avoid the largest problems, filling a structure - // by directly reading a file, is really a bad idea ... - fileSys->ReadFile(&(info.nEmission), sizeof(hgeParticleSystemInfo)); - fileSys->CloseFile(); - - info.sprite=sprite; - // info.fGravityMin *= 100; - // info.fGravityMax *= 100; - // info.fSpeedMin *= 100; - // info.fSpeedMax *= 100; - - vecLocation.x=vecPrevLocation.x=0.0f; - vecLocation.y=vecPrevLocation.y=0.0f; - fTx=fTy=0; - - fEmissionResidue=0.0f; - nParticlesAlive=0; - fAge=-2.0; - mTimer = 0.0f; - - rectBoundingBox.Clear(); - bUpdateBoundingBox=false; -} - -hgeParticleSystem::hgeParticleSystem(hgeParticleSystemInfo *psi) -{ - //hge=hgeCreate(HGE_VERSION); - - memcpy(&info, psi, sizeof(hgeParticleSystemInfo)); - - vecLocation.x=vecPrevLocation.x=0.0f; - vecLocation.y=vecPrevLocation.y=0.0f; - fTx=fTy=0; - - fEmissionResidue=0.0f; - nParticlesAlive=0; - fAge=-2.0; - mTimer = 0.0f; - - rectBoundingBox.Clear(); - bUpdateBoundingBox=false; -} - -hgeParticleSystem::hgeParticleSystem(const hgeParticleSystem &ps) -{ - memcpy(this, &ps, sizeof(hgeParticleSystem)); - //hge=hgeCreate(HGE_VERSION); -} - -void hgeParticleSystem::Update(float fDeltaTime) -{ - int i; - float ang; - hgeVector vecAccel, vecAccel2; - - if(fAge >= 0) - { - fAge += fDeltaTime; - if(fAge >= info.fLifetime) fAge = -2.0f; - } - - mTimer += fDeltaTime; - if (mTimer < 0.01f) - return; - - fDeltaTime = mTimer; - mTimer = 0.0f; - - - // update all alive particles - - if(bUpdateBoundingBox) rectBoundingBox.Clear(); - - ParticleBuffer::iterator particle = mParticleBuffer.begin(); - while(particle != mParticleBuffer.end()) - { - particle->fAge += fDeltaTime; - if(particle->fAge >= particle->fTerminalAge) - { - nParticlesAlive--; - ++particle; - mParticleBuffer.pop_front(); - continue; - } - - vecAccel = particle->vecLocation-vecLocation; - vecAccel.Normalize(); - vecAccel2 = vecAccel; - vecAccel *= particle->fRadialAccel; - - // vecAccel2.Rotate(M_PI_2); - // the following is faster - ang = vecAccel2.x; - vecAccel2.x = -vecAccel2.y; - vecAccel2.y = ang; - - vecAccel2 *= particle->fTangentialAccel; - particle->vecVelocity += (vecAccel+vecAccel2)*fDeltaTime; - particle->vecVelocity.y += particle->fGravity*fDeltaTime; - - //par->vecVelocity.y = 0.1f; - particle->vecLocation += particle->vecVelocity; - - particle->fSpin += particle->fSpinDelta*fDeltaTime; - particle->fSize += particle->fSizeDelta*fDeltaTime; - particle->colColor += particle->colColorDelta*fDeltaTime; - - if(bUpdateBoundingBox) rectBoundingBox.Encapsulate(particle->vecLocation.x, particle->vecLocation.y); - - ++particle; - } - - // generate new particles - - if(fAge != -2.0f) - { - float fParticlesNeeded = info.nEmission*fDeltaTime + fEmissionResidue; - int nParticlesCreated = (unsigned int)fParticlesNeeded; - fEmissionResidue=fParticlesNeeded-nParticlesCreated; - - for(i=0; i=MAX_PARTICLES) break; - - hgeParticle newParticle; - newParticle.fAge = 0.0f; - newParticle.fTerminalAge = Random_Float(info.fParticleLifeMin, info.fParticleLifeMax); - - newParticle.vecLocation = vecPrevLocation+(vecLocation-vecPrevLocation)*Random_Float(0.0f, 1.0f); - newParticle.vecLocation.x += Random_Float(-2.0f, 2.0f); - newParticle.vecLocation.y += Random_Float(-2.0f, 2.0f); - - ang=info.fDirection-M_PI_2+Random_Float(0,info.fSpread)-info.fSpread/2.0f; - if(info.bRelative) ang += (vecPrevLocation-vecLocation).Angle()+M_PI_2; - newParticle.vecVelocity.x = cosf(ang); - newParticle.vecVelocity.y = sinf(ang); - newParticle.vecVelocity *= Random_Float(info.fSpeedMin, info.fSpeedMax); - - newParticle.fGravity = Random_Float(info.fGravityMin, info.fGravityMax); - newParticle.fRadialAccel = Random_Float(info.fRadialAccelMin, info.fRadialAccelMax); - newParticle.fTangentialAccel = Random_Float(info.fTangentialAccelMin, info.fTangentialAccelMax); - - newParticle.fSize = Random_Float(info.fSizeStart, info.fSizeStart+(info.fSizeEnd-info.fSizeStart)*info.fSizeVar); - newParticle.fSizeDelta = (info.fSizeEnd-newParticle.fSize) / newParticle.fTerminalAge; - - newParticle.fSpin = Random_Float(info.fSpinStart, info.fSpinStart+(info.fSpinEnd-info.fSpinStart)*info.fSpinVar); - newParticle.fSpinDelta = (info.fSpinEnd-newParticle.fSpin) / newParticle.fTerminalAge; - - newParticle.colColor.r = Random_Float(info.colColorStart.r, info.colColorStart.r+(info.colColorEnd.r-info.colColorStart.r)*info.fColorVar); - newParticle.colColor.g = Random_Float(info.colColorStart.g, info.colColorStart.g+(info.colColorEnd.g-info.colColorStart.g)*info.fColorVar); - newParticle.colColor.b = Random_Float(info.colColorStart.b, info.colColorStart.b+(info.colColorEnd.b-info.colColorStart.b)*info.fColorVar); - newParticle.colColor.a = Random_Float(info.colColorStart.a, info.colColorStart.a+(info.colColorEnd.a-info.colColorStart.a)*info.fAlphaVar); - - newParticle.colColorDelta.r = (info.colColorEnd.r-newParticle.colColor.r) / newParticle.fTerminalAge; - newParticle.colColorDelta.g = (info.colColorEnd.g-newParticle.colColor.g) / newParticle.fTerminalAge; - newParticle.colColorDelta.b = (info.colColorEnd.b-newParticle.colColor.b) / newParticle.fTerminalAge; - newParticle.colColorDelta.a = (info.colColorEnd.a-newParticle.colColor.a) / newParticle.fTerminalAge; - - if(bUpdateBoundingBox) rectBoundingBox.Encapsulate(newParticle.vecLocation.x, newParticle.vecLocation.y); - - mParticleBuffer.push_back(newParticle); - ++nParticlesAlive; - } - } - - vecPrevLocation=vecLocation; -} - -void hgeParticleSystem::MoveTo(float x, float y, bool bMoveParticles) -{ - float dx,dy; - - if(bMoveParticles) - { - dx=x-vecLocation.x; - dy=y-vecLocation.y; - - ParticleBuffer::iterator particle = mParticleBuffer.begin(); - for (; particle != mParticleBuffer.end(); ++particle) - { - particle->vecLocation.x += dx; - particle->vecLocation.y += dy; - } - - vecPrevLocation.x=vecPrevLocation.x + dx; - vecPrevLocation.y=vecPrevLocation.y + dy; - } - else - { - if(fAge==-2.0) { vecPrevLocation.x=x; vecPrevLocation.y=y; } - else { vecPrevLocation.x=vecLocation.x; vecPrevLocation.y=vecLocation.y; } - } - - vecLocation.x=x; - vecLocation.y=y; -} - -void hgeParticleSystem::FireAt(float x, float y) -{ - Stop(); - MoveTo(x,y); - Fire(); -} - -void hgeParticleSystem::Fire() -{ - mTimer = 0.0f; - - if(info.fLifetime==-1.0f) fAge=-1.0f; - else fAge=0.0f; -} - -void hgeParticleSystem::Stop(bool bKillParticles) -{ - fAge=-2.0f; - if(bKillParticles) - { - nParticlesAlive=0; - mParticleBuffer.clear(); - rectBoundingBox.Clear(); - } -} - -void hgeParticleSystem::Render() -{ - ParticleBuffer::iterator particle = mParticleBuffer.begin(); - for (;particle != mParticleBuffer.end(); ++particle) - { - info.sprite->SetColor(particle->colColor.GetHWColor()); - JRenderer::GetInstance()->RenderQuad( - info.sprite, - particle->vecLocation.x+fTx, particle->vecLocation.y+fTy, - particle->fSpin * particle->fAge, - particle->fSize, particle->fSize); - } -} +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** hgeParticleSystem helper class implementation +*/ + +#include "../../include/JGE.h" +#include "../../include/JTypes.h" +#include "../../include/JRenderer.h" +#include "../../include/JFileSystem.h" + +#include "../../include/hge/hgeparticle.h" + + +//HGE *hgeParticleSystem::hge=0; + +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** Core functions implementation: random number generation +*/ + + +unsigned int g_seed=0; + +void Random_Seed(int seed) +{ + if(!seed) g_seed=JGE::GetInstance()->GetTime(); + else g_seed=seed; +} + +int Random_Int(int min, int max) +{ + g_seed=214013*g_seed+2531011; + return min+(g_seed ^ g_seed>>15)%(max-min+1); +} + +float Random_Float(float min, float max) +{ + g_seed=214013*g_seed+2531011; + return min+(g_seed>>16)*(1.0f/65535.0f)*(max-min); +} + + + + +hgeParticleSystem::hgeParticleSystem(const char *filename, JQuad *sprite) +{ + //void *psi; + //hgeParticleSystemInfo psi; + + JFileSystem* fileSys = JFileSystem::GetInstance(); + //hge=hgeCreate(HGE_VERSION); + + //psi=hge->Resource_Load(filename); + if (!fileSys->OpenFile(filename)) return; + + //if(!psi) return; + + //memcpy(&info, psi, sizeof(hgeParticleSystemInfo)); + //hge->Resource_Free(psi); + + // Skip reading the pointer as it may be larger than 4 bytes in the structure + void *dummyPointer; + fileSys->ReadFile(&dummyPointer, 4); + // we're actually trying to read more than the file size now, but it's no problem. + // Note that this fix is only to avoid the largest problems, filling a structure + // by directly reading a file, is really a bad idea ... + fileSys->ReadFile(&(info.nEmission), sizeof(hgeParticleSystemInfo)); + fileSys->CloseFile(); + + info.sprite=sprite; + // info.fGravityMin *= 100; + // info.fGravityMax *= 100; + // info.fSpeedMin *= 100; + // info.fSpeedMax *= 100; + + vecLocation.x=vecPrevLocation.x=0.0f; + vecLocation.y=vecPrevLocation.y=0.0f; + fTx=fTy=0; + + fEmissionResidue=0.0f; + nParticlesAlive=0; + fAge=-2.0; + mTimer = 0.0f; + + rectBoundingBox.Clear(); + bUpdateBoundingBox=false; +} + +hgeParticleSystem::hgeParticleSystem(hgeParticleSystemInfo *psi) +{ + //hge=hgeCreate(HGE_VERSION); + + memcpy(&info, psi, sizeof(hgeParticleSystemInfo)); + + vecLocation.x=vecPrevLocation.x=0.0f; + vecLocation.y=vecPrevLocation.y=0.0f; + fTx=fTy=0; + + fEmissionResidue=0.0f; + nParticlesAlive=0; + fAge=-2.0; + mTimer = 0.0f; + + rectBoundingBox.Clear(); + bUpdateBoundingBox=false; +} + +hgeParticleSystem::hgeParticleSystem(const hgeParticleSystem &ps) +{ + memcpy(this, &ps, sizeof(hgeParticleSystem)); + //hge=hgeCreate(HGE_VERSION); +} + +void hgeParticleSystem::Update(float fDeltaTime) +{ + int i; + float ang; + hgeVector vecAccel, vecAccel2; + + if(fAge >= 0) + { + fAge += fDeltaTime; + if(fAge >= info.fLifetime) fAge = -2.0f; + } + + mTimer += fDeltaTime; + if (mTimer < 0.01f) + return; + + fDeltaTime = mTimer; + mTimer = 0.0f; + + + // update all alive particles + + if(bUpdateBoundingBox) rectBoundingBox.Clear(); + + ParticleBuffer::iterator particle = mParticleBuffer.begin(); + while(particle != mParticleBuffer.end()) + { + particle->fAge += fDeltaTime; + if(particle->fAge >= particle->fTerminalAge) + { + nParticlesAlive--; + ++particle; + mParticleBuffer.pop_front(); + continue; + } + + vecAccel = particle->vecLocation-vecLocation; + vecAccel.Normalize(); + vecAccel2 = vecAccel; + vecAccel *= particle->fRadialAccel; + + // vecAccel2.Rotate(M_PI_2); + // the following is faster + ang = vecAccel2.x; + vecAccel2.x = -vecAccel2.y; + vecAccel2.y = ang; + + vecAccel2 *= particle->fTangentialAccel; + particle->vecVelocity += (vecAccel+vecAccel2)*fDeltaTime; + particle->vecVelocity.y += particle->fGravity*fDeltaTime; + + //par->vecVelocity.y = 0.1f; + particle->vecLocation += particle->vecVelocity; + + particle->fSpin += particle->fSpinDelta*fDeltaTime; + particle->fSize += particle->fSizeDelta*fDeltaTime; + particle->colColor += particle->colColorDelta*fDeltaTime; + + if(bUpdateBoundingBox) rectBoundingBox.Encapsulate(particle->vecLocation.x, particle->vecLocation.y); + + ++particle; + } + + // generate new particles + + if(fAge != -2.0f) + { + float fParticlesNeeded = info.nEmission*fDeltaTime + fEmissionResidue; + int nParticlesCreated = (unsigned int)fParticlesNeeded; + fEmissionResidue=fParticlesNeeded-nParticlesCreated; + + for(i=0; i=MAX_PARTICLES) break; + + hgeParticle newParticle; + newParticle.fAge = 0.0f; + newParticle.fTerminalAge = Random_Float(info.fParticleLifeMin, info.fParticleLifeMax); + + newParticle.vecLocation = vecPrevLocation+(vecLocation-vecPrevLocation)*Random_Float(0.0f, 1.0f); + newParticle.vecLocation.x += Random_Float(-2.0f, 2.0f); + newParticle.vecLocation.y += Random_Float(-2.0f, 2.0f); + + ang=info.fDirection-M_PI_2+Random_Float(0,info.fSpread)-info.fSpread/2.0f; + if(info.bRelative) ang += (vecPrevLocation-vecLocation).Angle()+M_PI_2; + newParticle.vecVelocity.x = cosf(ang); + newParticle.vecVelocity.y = sinf(ang); + newParticle.vecVelocity *= Random_Float(info.fSpeedMin, info.fSpeedMax); + + newParticle.fGravity = Random_Float(info.fGravityMin, info.fGravityMax); + newParticle.fRadialAccel = Random_Float(info.fRadialAccelMin, info.fRadialAccelMax); + newParticle.fTangentialAccel = Random_Float(info.fTangentialAccelMin, info.fTangentialAccelMax); + + newParticle.fSize = Random_Float(info.fSizeStart, info.fSizeStart+(info.fSizeEnd-info.fSizeStart)*info.fSizeVar); + newParticle.fSizeDelta = (info.fSizeEnd-newParticle.fSize) / newParticle.fTerminalAge; + + newParticle.fSpin = Random_Float(info.fSpinStart, info.fSpinStart+(info.fSpinEnd-info.fSpinStart)*info.fSpinVar); + newParticle.fSpinDelta = (info.fSpinEnd-newParticle.fSpin) / newParticle.fTerminalAge; + + newParticle.colColor.r = Random_Float(info.colColorStart.r, info.colColorStart.r+(info.colColorEnd.r-info.colColorStart.r)*info.fColorVar); + newParticle.colColor.g = Random_Float(info.colColorStart.g, info.colColorStart.g+(info.colColorEnd.g-info.colColorStart.g)*info.fColorVar); + newParticle.colColor.b = Random_Float(info.colColorStart.b, info.colColorStart.b+(info.colColorEnd.b-info.colColorStart.b)*info.fColorVar); + newParticle.colColor.a = Random_Float(info.colColorStart.a, info.colColorStart.a+(info.colColorEnd.a-info.colColorStart.a)*info.fAlphaVar); + + newParticle.colColorDelta.r = (info.colColorEnd.r-newParticle.colColor.r) / newParticle.fTerminalAge; + newParticle.colColorDelta.g = (info.colColorEnd.g-newParticle.colColor.g) / newParticle.fTerminalAge; + newParticle.colColorDelta.b = (info.colColorEnd.b-newParticle.colColor.b) / newParticle.fTerminalAge; + newParticle.colColorDelta.a = (info.colColorEnd.a-newParticle.colColor.a) / newParticle.fTerminalAge; + + if(bUpdateBoundingBox) rectBoundingBox.Encapsulate(newParticle.vecLocation.x, newParticle.vecLocation.y); + + mParticleBuffer.push_back(newParticle); + ++nParticlesAlive; + } + } + + vecPrevLocation=vecLocation; +} + +void hgeParticleSystem::MoveTo(float x, float y, bool bMoveParticles) +{ + float dx,dy; + + if(bMoveParticles) + { + dx=x-vecLocation.x; + dy=y-vecLocation.y; + + ParticleBuffer::iterator particle = mParticleBuffer.begin(); + for (; particle != mParticleBuffer.end(); ++particle) + { + particle->vecLocation.x += dx; + particle->vecLocation.y += dy; + } + + vecPrevLocation.x=vecPrevLocation.x + dx; + vecPrevLocation.y=vecPrevLocation.y + dy; + } + else + { + if(fAge==-2.0) { vecPrevLocation.x=x; vecPrevLocation.y=y; } + else { vecPrevLocation.x=vecLocation.x; vecPrevLocation.y=vecLocation.y; } + } + + vecLocation.x=x; + vecLocation.y=y; +} + +void hgeParticleSystem::FireAt(float x, float y) +{ + Stop(); + MoveTo(x,y); + Fire(); +} + +void hgeParticleSystem::Fire() +{ + mTimer = 0.0f; + + if(info.fLifetime==-1.0f) fAge=-1.0f; + else fAge=0.0f; +} + +void hgeParticleSystem::Stop(bool bKillParticles) +{ + fAge=-2.0f; + if(bKillParticles) + { + nParticlesAlive=0; + mParticleBuffer.clear(); + rectBoundingBox.Clear(); + } +} + +void hgeParticleSystem::Render() +{ + ParticleBuffer::iterator particle = mParticleBuffer.begin(); + for (;particle != mParticleBuffer.end(); ++particle) + { + info.sprite->SetColor(particle->colColor.GetHWColor()); + JRenderer::GetInstance()->RenderQuad( + info.sprite, + particle->vecLocation.x+fTx, particle->vecLocation.y+fTy, + particle->fSpin * particle->fAge, + particle->fSize, particle->fSize); + } +} diff --git a/JGE/src/hge/hgepmanager.cpp b/JGE/src/hge/hgepmanager.cpp index 45972a1dc..a0cbe4f4f 100644 --- a/JGE/src/hge/hgepmanager.cpp +++ b/JGE/src/hge/hgepmanager.cpp @@ -1,91 +1,91 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeParticleManager helper class implementation -*/ - - -#include "../../include/hge/hgeparticle.h" - - -hgeParticleManager::hgeParticleManager() -{ - nPS=0; - tX=tY=0.0f; -} - -hgeParticleManager::~hgeParticleManager() -{ - int i; - for(i=0;iUpdate(dt); - if(psList[i]->GetAge()==-2.0f && psList[i]->GetParticlesAlive()==0) - { - delete psList[i]; - psList[i]=psList[nPS-1]; - nPS--; - i--; - } - } -} - -void hgeParticleManager::Render() -{ - int i; - for(i=0;iRender(); -} - -hgeParticleSystem* hgeParticleManager::SpawnPS(hgeParticleSystemInfo *psi, float x, float y) -{ - if(nPS==MAX_PSYSTEMS) return 0; - psList[nPS]=new hgeParticleSystem(psi); - psList[nPS]->FireAt(x,y); - psList[nPS]->Transpose(tX,tY); - nPS++; - return psList[nPS-1]; -} - -bool hgeParticleManager::IsPSAlive(hgeParticleSystem *ps) const -{ - int i; - for(i=0;iTranspose(x,y); - tX=x; tY=y; -} - -void hgeParticleManager::KillPS(hgeParticleSystem *ps) -{ - int i; - for(i=0;iUpdate(dt); + if(psList[i]->GetAge()==-2.0f && psList[i]->GetParticlesAlive()==0) + { + delete psList[i]; + psList[i]=psList[nPS-1]; + nPS--; + i--; + } + } +} + +void hgeParticleManager::Render() +{ + int i; + for(i=0;iRender(); +} + +hgeParticleSystem* hgeParticleManager::SpawnPS(hgeParticleSystemInfo *psi, float x, float y) +{ + if(nPS==MAX_PSYSTEMS) return 0; + psList[nPS]=new hgeParticleSystem(psi); + psList[nPS]->FireAt(x,y); + psList[nPS]->Transpose(tX,tY); + nPS++; + return psList[nPS-1]; +} + +bool hgeParticleManager::IsPSAlive(hgeParticleSystem *ps) const +{ + int i; + for(i=0;iTranspose(x,y); + tX=x; tY=y; +} + +void hgeParticleManager::KillPS(hgeParticleSystem *ps) +{ + int i; + for(i=0;i - - -void hgeRect::Encapsulate(float x, float y) -{ - if(bClean) - { - x1=x2=x; - y1=y2=y; - bClean=false; - } - else - { - if(xx2) x2=x; - if(yy2) y2=y; - } -} - -bool hgeRect::TestPoint(float x, float y) const -{ - if(x>=x1 && x=y1 && yx1 - rect->x2) < (x2 - x1 + rect->x2 - rect->x1)) - if(fabs(y1 + y2 - rect->y1 - rect->y2) < (y2 - y1 + rect->y2 - rect->y1)) - return true; - - return false; -} +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** hgeRect helper class implementation +*/ + + +#include "../../include/hge/hgerect.h" +#include + + +void hgeRect::Encapsulate(float x, float y) +{ + if(bClean) + { + x1=x2=x; + y1=y2=y; + bClean=false; + } + else + { + if(xx2) x2=x; + if(yy2) y2=y; + } +} + +bool hgeRect::TestPoint(float x, float y) const +{ + if(x>=x1 && x=y1 && yx1 - rect->x2) < (x2 - x1 + rect->x2 - rect->x1)) + if(fabs(y1 + y2 - rect->y1 - rect->y2) < (y2 - y1 + rect->y2 - rect->y1)) + return true; + + return false; +} diff --git a/JGE/src/hge/hgevector.cpp b/JGE/src/hge/hgevector.cpp index ac178dde2..eef263197 100644 --- a/JGE/src/hge/hgevector.cpp +++ b/JGE/src/hge/hgevector.cpp @@ -1,69 +1,69 @@ -/* -** Haaf's Game Engine 1.7 -** Copyright (C) 2003-2007, Relish Games -** hge.relishgames.com -** -** hgeVector helper class implementation -*/ - - -#include "../../include/hge/hgevector.h" - -float InvSqrt(float x) -{ - union - { - int intPart; - float floatPart; - } convertor; - - convertor.floatPart = x; - convertor.intPart = 0x5f3759df - (convertor.intPart >> 1); - return convertor.floatPart*(1.5f - 0.4999f*x*convertor.floatPart*convertor.floatPart); -} - -/* -hgeVector *hgeVector::Normalize() -{ - float lenRcp; - - lenRcp=sqrtf(Dot(this)); - - if(lenRcp) - { - lenRcp=1.0f/lenRcp; - - x*=lenRcp; - y*=lenRcp; - } - - return this; -} -*/ - -float hgeVector::Angle(const hgeVector *v) const -{ - if(v) - { - hgeVector s=*this, t=*v; - - s.Normalize(); t.Normalize(); - return acosf(s.Dot(&t)); - } - else return atan2f(y, x); -} - -hgeVector *hgeVector::Rotate(float a) -{ - hgeVector v; - - v.x=x*cosf(a) - y*sinf(a); - v.y=x*sinf(a) + y*cosf(a); - - x=v.x; y=v.y; - - return this; -} - - - +/* +** Haaf's Game Engine 1.7 +** Copyright (C) 2003-2007, Relish Games +** hge.relishgames.com +** +** hgeVector helper class implementation +*/ + + +#include "../../include/hge/hgevector.h" + +float InvSqrt(float x) +{ + union + { + int intPart; + float floatPart; + } convertor; + + convertor.floatPart = x; + convertor.intPart = 0x5f3759df - (convertor.intPart >> 1); + return convertor.floatPart*(1.5f - 0.4999f*x*convertor.floatPart*convertor.floatPart); +} + +/* +hgeVector *hgeVector::Normalize() +{ + float lenRcp; + + lenRcp=sqrtf(Dot(this)); + + if(lenRcp) + { + lenRcp=1.0f/lenRcp; + + x*=lenRcp; + y*=lenRcp; + } + + return this; +} +*/ + +float hgeVector::Angle(const hgeVector *v) const +{ + if(v) + { + hgeVector s=*this, t=*v; + + s.Normalize(); t.Normalize(); + return acosf(s.Dot(&t)); + } + else return atan2f(y, x); +} + +hgeVector *hgeVector::Rotate(float a) +{ + hgeVector v; + + v.x=x*cosf(a) - y*sinf(a); + v.y=x*sinf(a) + y*cosf(a); + + x=v.x; y=v.y; + + return this; +} + + + diff --git a/JGE/src/unzip/ChangeLogUnzip b/JGE/src/unzip/ChangeLogUnzip index e62af147d..50ca6a9e0 100644 --- a/JGE/src/unzip/ChangeLogUnzip +++ b/JGE/src/unzip/ChangeLogUnzip @@ -1,67 +1,67 @@ -Change in 1.01e (12 feb 05) -- Fix in zipOpen2 for globalcomment (Rolf Kalbermatter) -- Fix possible memory leak in unzip.c (Zoran Stevanovic) - -Change in 1.01b (20 may 04) -- Integrate patch from Debian package (submited by Mark Brown) -- Add tools mztools from Xavier Roche - -Change in 1.01 (8 may 04) -- fix buffer overrun risk in unzip.c (Xavier Roche) -- fix a minor buffer insecurity in minizip.c (Mike Whittaker) - -Change in 1.00: (10 sept 03) -- rename to 1.00 -- cosmetic code change - -Change in 0.22: (19 May 03) -- crypting support (unless you define NOCRYPT) -- append file in existing zipfile - -Change in 0.21: (10 Mar 03) -- bug fixes - -Change in 0.17: (27 Jan 02) -- bug fixes - -Change in 0.16: (19 Jan 02) -- Support of ioapi for virtualize zip file access - -Change in 0.15: (19 Mar 98) -- fix memory leak in minizip.c - -Change in 0.14: (10 Mar 98) -- fix bugs in minizip.c sample for zipping big file -- fix problem in month in date handling -- fix bug in unzlocal_GetCurrentFileInfoInternal in unzip.c for - comment handling - -Change in 0.13: (6 Mar 98) -- fix bugs in zip.c -- add real minizip sample - -Change in 0.12: (4 Mar 98) -- add zip.c and zip.h for creates .zip file -- fix change_file_date in miniunz.c for Unix (Jean-loup Gailly) -- fix miniunz.c for file without specific record for directory - -Change in 0.11: (3 Mar 98) -- fix bug in unzGetCurrentFileInfo for get extra field and comment -- enhance miniunz sample, remove the bad unztst.c sample - -Change in 0.10: (2 Mar 98) -- fix bug in unzReadCurrentFile -- rename unzip* to unz* function and structure -- remove Windows-like hungary notation variable name -- modify some structure in unzip.h -- add somes comment in source -- remove unzipGetcCurrentFile function -- replace ZUNZEXPORT by ZEXPORT -- add unzGetLocalExtrafield for get the local extrafield info -- add a new sample, miniunz.c - -Change in 0.4: (25 Feb 98) -- suppress the type unzipFileInZip. - Only on file in the zipfile can be open at the same time -- fix somes typo in code -- added tm_unz structure in unzip_file_info (date/time in readable format) +Change in 1.01e (12 feb 05) +- Fix in zipOpen2 for globalcomment (Rolf Kalbermatter) +- Fix possible memory leak in unzip.c (Zoran Stevanovic) + +Change in 1.01b (20 may 04) +- Integrate patch from Debian package (submited by Mark Brown) +- Add tools mztools from Xavier Roche + +Change in 1.01 (8 may 04) +- fix buffer overrun risk in unzip.c (Xavier Roche) +- fix a minor buffer insecurity in minizip.c (Mike Whittaker) + +Change in 1.00: (10 sept 03) +- rename to 1.00 +- cosmetic code change + +Change in 0.22: (19 May 03) +- crypting support (unless you define NOCRYPT) +- append file in existing zipfile + +Change in 0.21: (10 Mar 03) +- bug fixes + +Change in 0.17: (27 Jan 02) +- bug fixes + +Change in 0.16: (19 Jan 02) +- Support of ioapi for virtualize zip file access + +Change in 0.15: (19 Mar 98) +- fix memory leak in minizip.c + +Change in 0.14: (10 Mar 98) +- fix bugs in minizip.c sample for zipping big file +- fix problem in month in date handling +- fix bug in unzlocal_GetCurrentFileInfoInternal in unzip.c for + comment handling + +Change in 0.13: (6 Mar 98) +- fix bugs in zip.c +- add real minizip sample + +Change in 0.12: (4 Mar 98) +- add zip.c and zip.h for creates .zip file +- fix change_file_date in miniunz.c for Unix (Jean-loup Gailly) +- fix miniunz.c for file without specific record for directory + +Change in 0.11: (3 Mar 98) +- fix bug in unzGetCurrentFileInfo for get extra field and comment +- enhance miniunz sample, remove the bad unztst.c sample + +Change in 0.10: (2 Mar 98) +- fix bug in unzReadCurrentFile +- rename unzip* to unz* function and structure +- remove Windows-like hungary notation variable name +- modify some structure in unzip.h +- add somes comment in source +- remove unzipGetcCurrentFile function +- replace ZUNZEXPORT by ZEXPORT +- add unzGetLocalExtrafield for get the local extrafield info +- add a new sample, miniunz.c + +Change in 0.4: (25 Feb 98) +- suppress the type unzipFileInZip. + Only on file in the zipfile can be open at the same time +- fix somes typo in code +- added tm_unz structure in unzip_file_info (date/time in readable format) diff --git a/JGE/src/unzip/Makefile b/JGE/src/unzip/Makefile index fbba3ac95..84eaad20d 100644 --- a/JGE/src/unzip/Makefile +++ b/JGE/src/unzip/Makefile @@ -1,25 +1,25 @@ -CC=cc -CFLAGS=-O -I../.. - -UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a -ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a - -.c.o: - $(CC) -c $(CFLAGS) $*.c - -all: miniunz minizip - -miniunz: $(UNZ_OBJS) - $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) - -minizip: $(ZIP_OBJS) - $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) - -test: miniunz minizip - ./minizip test readme.txt - ./miniunz -l test.zip - mv readme.txt readme.old - ./miniunz test.zip - -clean: - /bin/rm -f *.o *~ minizip miniunz +CC=cc +CFLAGS=-O -I../.. + +UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a +ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a + +.c.o: + $(CC) -c $(CFLAGS) $*.c + +all: miniunz minizip + +miniunz: $(UNZ_OBJS) + $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) + +minizip: $(ZIP_OBJS) + $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) + +test: miniunz minizip + ./minizip test readme.txt + ./miniunz -l test.zip + mv readme.txt readme.old + ./miniunz test.zip + +clean: + /bin/rm -f *.o *~ minizip miniunz diff --git a/JGE/src/unzip/crypt.h b/JGE/src/unzip/crypt.h index f14a628b4..622f4bc2e 100644 --- a/JGE/src/unzip/crypt.h +++ b/JGE/src/unzip/crypt.h @@ -1,132 +1,132 @@ -/* crypt.h -- base code for crypt/uncrypt ZIPfile - - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This code is a modified version of crypting code in Infozip distribution - - The encryption/decryption parts of this source code (as opposed to the - non-echoing password parts) were originally written in Europe. The - whole source package can be freely distributed, including from the USA. - (Prior to January 2000, re-export from the US was a violation of US law.) - - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - - If you don't need crypting in your application, just define symbols - NOCRYPT and NOUNCRYPT. - - This code support the "Traditional PKWARE Encryption". - - The new AES encryption added on Zip format by Winzip (see the page - http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong - Encryption is not supported. -*/ - -#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) - -/*********************************************************************** - * Return the next byte in the pseudo-random sequence - */ -static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) -{ - unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an - * unpredictable manner on 16-bit systems; not a problem - * with any known compiler so far, though */ - - temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; - return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); -} - -/*********************************************************************** - * Update the encryption keys with the next byte of plain text - */ -static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) -{ - (*(pkeys+0)) = CRC32((*(pkeys+0)), c); - (*(pkeys+1)) += (*(pkeys+0)) & 0xff; - (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; - { - register int keyshift = (int)((*(pkeys+1)) >> 24); - (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); - } - return c; -} - - -/*********************************************************************** - * Initialize the encryption keys and the random header according to - * the given password. - */ -static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) -{ - *(pkeys+0) = 305419896L; - *(pkeys+1) = 591751049L; - *(pkeys+2) = 878082192L; - while (*passwd != '\0') { - update_keys(pkeys,pcrc_32_tab,(int)*passwd); - passwd++; - } -} - -#define zdecode(pkeys,pcrc_32_tab,c) \ - (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) - -#define zencode(pkeys,pcrc_32_tab,c,t) \ - (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) - -#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED - -#define RAND_HEAD_LEN 12 - /* "last resort" source for second part of crypt seed pattern */ -# ifndef ZCR_SEED2 -# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ -# endif - -static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) - const char *passwd; /* password string */ - unsigned char *buf; /* where to write header */ - int bufSize; - unsigned long* pkeys; - const unsigned long* pcrc_32_tab; - unsigned long crcForCrypting; -{ - int n; /* index in random header */ - int t; /* temporary */ - int c; /* random byte */ - unsigned char header[RAND_HEAD_LEN-2]; /* random header */ - static unsigned calls = 0; /* ensure different random header each time */ - - if (bufSize> 7) & 0xff; - header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); - } - /* Encrypt random header (last two bytes is high word of crc) */ - init_keys(passwd, pkeys, pcrc_32_tab); - for (n = 0; n < RAND_HEAD_LEN-2; n++) - { - buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); - } - buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); - buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); - return n; -} - -#endif +/* crypt.h -- base code for crypt/uncrypt ZIPfile + + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This code is a modified version of crypting code in Infozip distribution + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + + If you don't need crypting in your application, just define symbols + NOCRYPT and NOUNCRYPT. + + This code support the "Traditional PKWARE Encryption". + + The new AES encryption added on Zip format by Winzip (see the page + http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong + Encryption is not supported. +*/ + +#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) + +/*********************************************************************** + * Return the next byte in the pseudo-random sequence + */ +static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) +{ + unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an + * unpredictable manner on 16-bit systems; not a problem + * with any known compiler so far, though */ + + temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; + return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); +} + +/*********************************************************************** + * Update the encryption keys with the next byte of plain text + */ +static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) +{ + (*(pkeys+0)) = CRC32((*(pkeys+0)), c); + (*(pkeys+1)) += (*(pkeys+0)) & 0xff; + (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; + { + register int keyshift = (int)((*(pkeys+1)) >> 24); + (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); + } + return c; +} + + +/*********************************************************************** + * Initialize the encryption keys and the random header according to + * the given password. + */ +static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) +{ + *(pkeys+0) = 305419896L; + *(pkeys+1) = 591751049L; + *(pkeys+2) = 878082192L; + while (*passwd != '\0') { + update_keys(pkeys,pcrc_32_tab,(int)*passwd); + passwd++; + } +} + +#define zdecode(pkeys,pcrc_32_tab,c) \ + (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) + +#define zencode(pkeys,pcrc_32_tab,c,t) \ + (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) + +#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED + +#define RAND_HEAD_LEN 12 + /* "last resort" source for second part of crypt seed pattern */ +# ifndef ZCR_SEED2 +# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ +# endif + +static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) + const char *passwd; /* password string */ + unsigned char *buf; /* where to write header */ + int bufSize; + unsigned long* pkeys; + const unsigned long* pcrc_32_tab; + unsigned long crcForCrypting; +{ + int n; /* index in random header */ + int t; /* temporary */ + int c; /* random byte */ + unsigned char header[RAND_HEAD_LEN-2]; /* random header */ + static unsigned calls = 0; /* ensure different random header each time */ + + if (bufSize> 7) & 0xff; + header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); + } + /* Encrypt random header (last two bytes is high word of crc) */ + init_keys(passwd, pkeys, pcrc_32_tab); + for (n = 0; n < RAND_HEAD_LEN-2; n++) + { + buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); + } + buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); + buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); + return n; +} + +#endif diff --git a/JGE/src/unzip/ioapi.c b/JGE/src/unzip/ioapi.c index 7f20c182f..f1bee23e6 100644 --- a/JGE/src/unzip/ioapi.c +++ b/JGE/src/unzip/ioapi.c @@ -1,177 +1,177 @@ -/* ioapi.c -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant -*/ - -#include -#include -#include - -#include "zlib.h" -#include "ioapi.h" - - - -/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ - -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif - -#ifndef SEEK_END -#define SEEK_END 2 -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif - -voidpf ZCALLBACK fopen_file_func OF(( - voidpf opaque, - const char* filename, - int mode)); - -uLong ZCALLBACK fread_file_func OF(( - voidpf opaque, - voidpf stream, - void* buf, - uLong size)); - -uLong ZCALLBACK fwrite_file_func OF(( - voidpf opaque, - voidpf stream, - const void* buf, - uLong size)); - -long ZCALLBACK ftell_file_func OF(( - voidpf opaque, - voidpf stream)); - -long ZCALLBACK fseek_file_func OF(( - voidpf opaque, - voidpf stream, - uLong offset, - int origin)); - -int ZCALLBACK fclose_file_func OF(( - voidpf opaque, - voidpf stream)); - -int ZCALLBACK ferror_file_func OF(( - voidpf opaque, - voidpf stream)); - - -voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) - voidpf opaque; - const char* filename; - int mode; -{ - FILE* file = NULL; - const char* mode_fopen = NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; - - if ((filename!=NULL) && (mode_fopen != NULL)) - file = fopen(filename, mode_fopen); - return file; -} - - -uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - void* buf; - uLong size; -{ - uLong ret; - ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); - return ret; -} - - -uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - const void* buf; - uLong size; -{ - uLong ret; - ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); - return ret; -} - -long ZCALLBACK ftell_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - long ret; - ret = ftell((FILE *)stream); - return ret; -} - -long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) - voidpf opaque; - voidpf stream; - uLong offset; - int origin; -{ - int fseek_origin=0; - long ret; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - fseek_origin = SEEK_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END : - fseek_origin = SEEK_END; - break; - case ZLIB_FILEFUNC_SEEK_SET : - fseek_origin = SEEK_SET; - break; - default: return -1; - } - ret = 0; - fseek((FILE *)stream, offset, fseek_origin); - return ret; -} - -int ZCALLBACK fclose_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - int ret; - ret = fclose((FILE *)stream); - return ret; -} - -int ZCALLBACK ferror_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - int ret; - ret = ferror((FILE *)stream); - return ret; -} - -void fill_fopen_filefunc (pzlib_filefunc_def) - zlib_filefunc_def* pzlib_filefunc_def; -{ - pzlib_filefunc_def->zopen_file = fopen_file_func; - pzlib_filefunc_def->zread_file = fread_file_func; - pzlib_filefunc_def->zwrite_file = fwrite_file_func; - pzlib_filefunc_def->ztell_file = ftell_file_func; - pzlib_filefunc_def->zseek_file = fseek_file_func; - pzlib_filefunc_def->zclose_file = fclose_file_func; - pzlib_filefunc_def->zerror_file = ferror_file_func; - pzlib_filefunc_def->opaque = NULL; -} +/* ioapi.c -- IO base function header for compress/uncompress .zip + files using zlib + zip or unzip API + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant +*/ + +#include +#include +#include + +#include "zlib.h" +#include "ioapi.h" + + + +/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ + +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif + +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + +voidpf ZCALLBACK fopen_file_func OF(( + voidpf opaque, + const char* filename, + int mode)); + +uLong ZCALLBACK fread_file_func OF(( + voidpf opaque, + voidpf stream, + void* buf, + uLong size)); + +uLong ZCALLBACK fwrite_file_func OF(( + voidpf opaque, + voidpf stream, + const void* buf, + uLong size)); + +long ZCALLBACK ftell_file_func OF(( + voidpf opaque, + voidpf stream)); + +long ZCALLBACK fseek_file_func OF(( + voidpf opaque, + voidpf stream, + uLong offset, + int origin)); + +int ZCALLBACK fclose_file_func OF(( + voidpf opaque, + voidpf stream)); + +int ZCALLBACK ferror_file_func OF(( + voidpf opaque, + voidpf stream)); + + +voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) + voidpf opaque; + const char* filename; + int mode; +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + file = fopen(filename, mode_fopen); + return file; +} + + +uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) + voidpf opaque; + voidpf stream; + void* buf; + uLong size; +{ + uLong ret; + ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + + +uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) + voidpf opaque; + voidpf stream; + const void* buf; + uLong size; +{ + uLong ret; + ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +long ZCALLBACK ftell_file_func (opaque, stream) + voidpf opaque; + voidpf stream; +{ + long ret; + ret = ftell((FILE *)stream); + return ret; +} + +long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) + voidpf opaque; + voidpf stream; + uLong offset; + int origin; +{ + int fseek_origin=0; + long ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + ret = 0; + fseek((FILE *)stream, offset, fseek_origin); + return ret; +} + +int ZCALLBACK fclose_file_func (opaque, stream) + voidpf opaque; + voidpf stream; +{ + int ret; + ret = fclose((FILE *)stream); + return ret; +} + +int ZCALLBACK ferror_file_func (opaque, stream) + voidpf opaque; + voidpf stream; +{ + int ret; + ret = ferror((FILE *)stream); + return ret; +} + +void fill_fopen_filefunc (pzlib_filefunc_def) + zlib_filefunc_def* pzlib_filefunc_def; +{ + pzlib_filefunc_def->zopen_file = fopen_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell_file = ftell_file_func; + pzlib_filefunc_def->zseek_file = fseek_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} diff --git a/JGE/src/unzip/ioapi.h b/JGE/src/unzip/ioapi.h index e73a3b2bd..7d457baab 100644 --- a/JGE/src/unzip/ioapi.h +++ b/JGE/src/unzip/ioapi.h @@ -1,75 +1,75 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant -*/ - -#ifndef _ZLIBIOAPI_H -#define _ZLIBIOAPI_H - - -#define ZLIB_FILEFUNC_SEEK_CUR (1) -#define ZLIB_FILEFUNC_SEEK_END (2) -#define ZLIB_FILEFUNC_SEEK_SET (0) - -#define ZLIB_FILEFUNC_MODE_READ (1) -#define ZLIB_FILEFUNC_MODE_WRITE (2) -#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) - -#define ZLIB_FILEFUNC_MODE_EXISTING (4) -#define ZLIB_FILEFUNC_MODE_CREATE (8) - - -#ifndef ZCALLBACK - -#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) -#define ZCALLBACK CALLBACK -#else -#define ZCALLBACK -#endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); -typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); -typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); - -typedef struct zlib_filefunc_def_s -{ - open_file_func zopen_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell_file_func ztell_file; - seek_file_func zseek_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc_def; - - - -void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) -#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) -#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) -#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) -#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) -#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) - - -#ifdef __cplusplus -} -#endif - -#endif - +/* ioapi.h -- IO base function header for compress/uncompress .zip + files using zlib + zip or unzip API + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant +*/ + +#ifndef _ZLIBIOAPI_H +#define _ZLIBIOAPI_H + + +#define ZLIB_FILEFUNC_SEEK_CUR (1) +#define ZLIB_FILEFUNC_SEEK_END (2) +#define ZLIB_FILEFUNC_SEEK_SET (0) + +#define ZLIB_FILEFUNC_MODE_READ (1) +#define ZLIB_FILEFUNC_MODE_WRITE (2) +#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) + +#define ZLIB_FILEFUNC_MODE_EXISTING (4) +#define ZLIB_FILEFUNC_MODE_CREATE (8) + + +#ifndef ZCALLBACK + +#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) +#define ZCALLBACK CALLBACK +#else +#define ZCALLBACK +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); +typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); +typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); +typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); +typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); + +typedef struct zlib_filefunc_def_s +{ + open_file_func zopen_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell_file_func ztell_file; + seek_file_func zseek_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc_def; + + + +void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + +#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) +#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) +#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) +#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) +#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) +#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) + + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/JGE/src/unzip/iowin32.c b/JGE/src/unzip/iowin32.c index 694bc033b..a9b5f7839 100644 --- a/JGE/src/unzip/iowin32.c +++ b/JGE/src/unzip/iowin32.c @@ -1,270 +1,270 @@ -/* iowin32.c -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - This IO API version uses the Win32 API (for Microsoft Windows) - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant -*/ - -#include - -#include "zlib.h" -#include "ioapi.h" -#include "iowin32.h" - -#ifndef INVALID_HANDLE_VALUE -#define INVALID_HANDLE_VALUE (0xFFFFFFFF) -#endif - -#ifndef INVALID_SET_FILE_POINTER -#define INVALID_SET_FILE_POINTER ((DWORD)-1) -#endif - -voidpf ZCALLBACK win32_open_file_func OF(( - voidpf opaque, - const char* filename, - int mode)); - -uLong ZCALLBACK win32_read_file_func OF(( - voidpf opaque, - voidpf stream, - void* buf, - uLong size)); - -uLong ZCALLBACK win32_write_file_func OF(( - voidpf opaque, - voidpf stream, - const void* buf, - uLong size)); - -long ZCALLBACK win32_tell_file_func OF(( - voidpf opaque, - voidpf stream)); - -long ZCALLBACK win32_seek_file_func OF(( - voidpf opaque, - voidpf stream, - uLong offset, - int origin)); - -int ZCALLBACK win32_close_file_func OF(( - voidpf opaque, - voidpf stream)); - -int ZCALLBACK win32_error_file_func OF(( - voidpf opaque, - voidpf stream)); - -typedef struct -{ - HANDLE hf; - int error; -} WIN32FILE_IOWIN; - -voidpf ZCALLBACK win32_open_file_func (opaque, filename, mode) - voidpf opaque; - const char* filename; - int mode; -{ - const char* mode_fopen = NULL; - DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; - HANDLE hFile = 0; - voidpf ret=NULL; - - dwDesiredAccess = dwShareMode = dwFlagsAndAttributes = 0; - - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - { - dwDesiredAccess = GENERIC_READ; - dwCreationDisposition = OPEN_EXISTING; - dwShareMode = FILE_SHARE_READ; - } - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - { - dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; - dwCreationDisposition = OPEN_EXISTING; - } - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - { - dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; - dwCreationDisposition = CREATE_ALWAYS; - } - - if ((filename!=NULL) && (dwDesiredAccess != 0)) - hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, - dwCreationDisposition, dwFlagsAndAttributes, NULL); - - if (hFile == INVALID_HANDLE_VALUE) - hFile = NULL; - - if (hFile != NULL) - { - WIN32FILE_IOWIN w32fiow; - w32fiow.hf = hFile; - w32fiow.error = 0; - ret = malloc(sizeof(WIN32FILE_IOWIN)); - if (ret==NULL) - CloseHandle(hFile); - else *((WIN32FILE_IOWIN*)ret) = w32fiow; - } - return ret; -} - - -uLong ZCALLBACK win32_read_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - void* buf; - uLong size; -{ - uLong ret=0; - HANDLE hFile = NULL; - if (stream!=NULL) - hFile = ((WIN32FILE_IOWIN*)stream) -> hf; - if (hFile != NULL) - if (!ReadFile(hFile, buf, size, &ret, NULL)) - { - DWORD dwErr = GetLastError(); - if (dwErr == ERROR_HANDLE_EOF) - dwErr = 0; - ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; - } - - return ret; -} - - -uLong ZCALLBACK win32_write_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - const void* buf; - uLong size; -{ - uLong ret=0; - HANDLE hFile = NULL; - if (stream!=NULL) - hFile = ((WIN32FILE_IOWIN*)stream) -> hf; - - if (hFile !=NULL) - if (!WriteFile(hFile, buf, size, &ret, NULL)) - { - DWORD dwErr = GetLastError(); - if (dwErr == ERROR_HANDLE_EOF) - dwErr = 0; - ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; - } - - return ret; -} - -long ZCALLBACK win32_tell_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - long ret=-1; - HANDLE hFile = NULL; - if (stream!=NULL) - hFile = ((WIN32FILE_IOWIN*)stream) -> hf; - if (hFile != NULL) - { - DWORD dwSet = SetFilePointer(hFile, 0, NULL, FILE_CURRENT); - if (dwSet == INVALID_SET_FILE_POINTER) - { - DWORD dwErr = GetLastError(); - ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; - ret = -1; - } - else - ret=(long)dwSet; - } - return ret; -} - -long ZCALLBACK win32_seek_file_func (opaque, stream, offset, origin) - voidpf opaque; - voidpf stream; - uLong offset; - int origin; -{ - DWORD dwMoveMethod=0xFFFFFFFF; - HANDLE hFile = NULL; - - long ret=-1; - if (stream!=NULL) - hFile = ((WIN32FILE_IOWIN*)stream) -> hf; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - dwMoveMethod = FILE_CURRENT; - break; - case ZLIB_FILEFUNC_SEEK_END : - dwMoveMethod = FILE_END; - break; - case ZLIB_FILEFUNC_SEEK_SET : - dwMoveMethod = FILE_BEGIN; - break; - default: return -1; - } - - if (hFile != NULL) - { - DWORD dwSet = SetFilePointer(hFile, offset, NULL, dwMoveMethod); - if (dwSet == INVALID_SET_FILE_POINTER) - { - DWORD dwErr = GetLastError(); - ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; - ret = -1; - } - else - ret=0; - } - return ret; -} - -int ZCALLBACK win32_close_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - int ret=-1; - - if (stream!=NULL) - { - HANDLE hFile; - hFile = ((WIN32FILE_IOWIN*)stream) -> hf; - if (hFile != NULL) - { - CloseHandle(hFile); - ret=0; - } - free(stream); - } - return ret; -} - -int ZCALLBACK win32_error_file_func (opaque, stream) - voidpf opaque; - voidpf stream; -{ - int ret=-1; - if (stream!=NULL) - { - ret = ((WIN32FILE_IOWIN*)stream) -> error; - } - return ret; -} - -void fill_win32_filefunc (pzlib_filefunc_def) - zlib_filefunc_def* pzlib_filefunc_def; -{ - pzlib_filefunc_def->zopen_file = win32_open_file_func; - pzlib_filefunc_def->zread_file = win32_read_file_func; - pzlib_filefunc_def->zwrite_file = win32_write_file_func; - pzlib_filefunc_def->ztell_file = win32_tell_file_func; - pzlib_filefunc_def->zseek_file = win32_seek_file_func; - pzlib_filefunc_def->zclose_file = win32_close_file_func; - pzlib_filefunc_def->zerror_file = win32_error_file_func; - pzlib_filefunc_def->opaque=NULL; -} +/* iowin32.c -- IO base function header for compress/uncompress .zip + files using zlib + zip or unzip API + This IO API version uses the Win32 API (for Microsoft Windows) + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant +*/ + +#include + +#include "zlib.h" +#include "ioapi.h" +#include "iowin32.h" + +#ifndef INVALID_HANDLE_VALUE +#define INVALID_HANDLE_VALUE (0xFFFFFFFF) +#endif + +#ifndef INVALID_SET_FILE_POINTER +#define INVALID_SET_FILE_POINTER ((DWORD)-1) +#endif + +voidpf ZCALLBACK win32_open_file_func OF(( + voidpf opaque, + const char* filename, + int mode)); + +uLong ZCALLBACK win32_read_file_func OF(( + voidpf opaque, + voidpf stream, + void* buf, + uLong size)); + +uLong ZCALLBACK win32_write_file_func OF(( + voidpf opaque, + voidpf stream, + const void* buf, + uLong size)); + +long ZCALLBACK win32_tell_file_func OF(( + voidpf opaque, + voidpf stream)); + +long ZCALLBACK win32_seek_file_func OF(( + voidpf opaque, + voidpf stream, + uLong offset, + int origin)); + +int ZCALLBACK win32_close_file_func OF(( + voidpf opaque, + voidpf stream)); + +int ZCALLBACK win32_error_file_func OF(( + voidpf opaque, + voidpf stream)); + +typedef struct +{ + HANDLE hf; + int error; +} WIN32FILE_IOWIN; + +voidpf ZCALLBACK win32_open_file_func (opaque, filename, mode) + voidpf opaque; + const char* filename; + int mode; +{ + const char* mode_fopen = NULL; + DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; + HANDLE hFile = 0; + voidpf ret=NULL; + + dwDesiredAccess = dwShareMode = dwFlagsAndAttributes = 0; + + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + { + dwDesiredAccess = GENERIC_READ; + dwCreationDisposition = OPEN_EXISTING; + dwShareMode = FILE_SHARE_READ; + } + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + { + dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; + dwCreationDisposition = OPEN_EXISTING; + } + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + { + dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; + dwCreationDisposition = CREATE_ALWAYS; + } + + if ((filename!=NULL) && (dwDesiredAccess != 0)) + hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, + dwCreationDisposition, dwFlagsAndAttributes, NULL); + + if (hFile == INVALID_HANDLE_VALUE) + hFile = NULL; + + if (hFile != NULL) + { + WIN32FILE_IOWIN w32fiow; + w32fiow.hf = hFile; + w32fiow.error = 0; + ret = malloc(sizeof(WIN32FILE_IOWIN)); + if (ret==NULL) + CloseHandle(hFile); + else *((WIN32FILE_IOWIN*)ret) = w32fiow; + } + return ret; +} + + +uLong ZCALLBACK win32_read_file_func (opaque, stream, buf, size) + voidpf opaque; + voidpf stream; + void* buf; + uLong size; +{ + uLong ret=0; + HANDLE hFile = NULL; + if (stream!=NULL) + hFile = ((WIN32FILE_IOWIN*)stream) -> hf; + if (hFile != NULL) + if (!ReadFile(hFile, buf, size, &ret, NULL)) + { + DWORD dwErr = GetLastError(); + if (dwErr == ERROR_HANDLE_EOF) + dwErr = 0; + ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; + } + + return ret; +} + + +uLong ZCALLBACK win32_write_file_func (opaque, stream, buf, size) + voidpf opaque; + voidpf stream; + const void* buf; + uLong size; +{ + uLong ret=0; + HANDLE hFile = NULL; + if (stream!=NULL) + hFile = ((WIN32FILE_IOWIN*)stream) -> hf; + + if (hFile !=NULL) + if (!WriteFile(hFile, buf, size, &ret, NULL)) + { + DWORD dwErr = GetLastError(); + if (dwErr == ERROR_HANDLE_EOF) + dwErr = 0; + ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; + } + + return ret; +} + +long ZCALLBACK win32_tell_file_func (opaque, stream) + voidpf opaque; + voidpf stream; +{ + long ret=-1; + HANDLE hFile = NULL; + if (stream!=NULL) + hFile = ((WIN32FILE_IOWIN*)stream) -> hf; + if (hFile != NULL) + { + DWORD dwSet = SetFilePointer(hFile, 0, NULL, FILE_CURRENT); + if (dwSet == INVALID_SET_FILE_POINTER) + { + DWORD dwErr = GetLastError(); + ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; + ret = -1; + } + else + ret=(long)dwSet; + } + return ret; +} + +long ZCALLBACK win32_seek_file_func (opaque, stream, offset, origin) + voidpf opaque; + voidpf stream; + uLong offset; + int origin; +{ + DWORD dwMoveMethod=0xFFFFFFFF; + HANDLE hFile = NULL; + + long ret=-1; + if (stream!=NULL) + hFile = ((WIN32FILE_IOWIN*)stream) -> hf; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + dwMoveMethod = FILE_CURRENT; + break; + case ZLIB_FILEFUNC_SEEK_END : + dwMoveMethod = FILE_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + dwMoveMethod = FILE_BEGIN; + break; + default: return -1; + } + + if (hFile != NULL) + { + DWORD dwSet = SetFilePointer(hFile, offset, NULL, dwMoveMethod); + if (dwSet == INVALID_SET_FILE_POINTER) + { + DWORD dwErr = GetLastError(); + ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; + ret = -1; + } + else + ret=0; + } + return ret; +} + +int ZCALLBACK win32_close_file_func (opaque, stream) + voidpf opaque; + voidpf stream; +{ + int ret=-1; + + if (stream!=NULL) + { + HANDLE hFile; + hFile = ((WIN32FILE_IOWIN*)stream) -> hf; + if (hFile != NULL) + { + CloseHandle(hFile); + ret=0; + } + free(stream); + } + return ret; +} + +int ZCALLBACK win32_error_file_func (opaque, stream) + voidpf opaque; + voidpf stream; +{ + int ret=-1; + if (stream!=NULL) + { + ret = ((WIN32FILE_IOWIN*)stream) -> error; + } + return ret; +} + +void fill_win32_filefunc (pzlib_filefunc_def) + zlib_filefunc_def* pzlib_filefunc_def; +{ + pzlib_filefunc_def->zopen_file = win32_open_file_func; + pzlib_filefunc_def->zread_file = win32_read_file_func; + pzlib_filefunc_def->zwrite_file = win32_write_file_func; + pzlib_filefunc_def->ztell_file = win32_tell_file_func; + pzlib_filefunc_def->zseek_file = win32_seek_file_func; + pzlib_filefunc_def->zclose_file = win32_close_file_func; + pzlib_filefunc_def->zerror_file = win32_error_file_func; + pzlib_filefunc_def->opaque=NULL; +} diff --git a/JGE/src/unzip/iowin32.h b/JGE/src/unzip/iowin32.h index e9c5f8b90..a3a437adf 100644 --- a/JGE/src/unzip/iowin32.h +++ b/JGE/src/unzip/iowin32.h @@ -1,21 +1,21 @@ -/* iowin32.h -- IO base function header for compress/uncompress .zip - files using zlib + zip or unzip API - This IO API version uses the Win32 API (for Microsoft Windows) - - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant -*/ - -#include - - -#ifdef __cplusplus -extern "C" { -#endif - -void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -#ifdef __cplusplus -} -#endif +/* iowin32.h -- IO base function header for compress/uncompress .zip + files using zlib + zip or unzip API + This IO API version uses the Win32 API (for Microsoft Windows) + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant +*/ + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + +#ifdef __cplusplus +} +#endif diff --git a/JGE/src/unzip/miniunz.c b/JGE/src/unzip/miniunz.c index 82d870264..f59993888 100644 --- a/JGE/src/unzip/miniunz.c +++ b/JGE/src/unzip/miniunz.c @@ -1,585 +1,585 @@ -/* - miniunz.c - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant -*/ - - -#include -#include -#include -#include -#include -#include - -#ifdef unix -# include -# include -#else -# include -# include -#endif - -#include "unzip.h" - -#define CASESENSITIVITY (0) -#define WRITEBUFFERSIZE (8192) -#define MAXFILENAME (256) - -#ifdef WIN32 -#define USEWIN32IOAPI -#include "iowin32.h" -#endif -/* - mini unzip, demo of unzip package - - usage : - Usage : miniunz [-exvlo] file.zip [file_to_extract] [-d extractdir] - - list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT - if it exists -*/ - - -/* change_file_date : change the date/time of a file - filename : the filename of the file where date/time must be modified - dosdate : the new date at the MSDos format (4 bytes) - tmu_date : the SAME new date at the tm_unz format */ -void change_file_date(filename,dosdate,tmu_date) - const char *filename; - uLong dosdate; - tm_unz tmu_date; -{ -#ifdef WIN32 - HANDLE hFile; - FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite; - - hFile = CreateFile(filename,GENERIC_READ | GENERIC_WRITE, - 0,NULL,OPEN_EXISTING,0,NULL); - GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite); - DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal); - LocalFileTimeToFileTime(&ftLocal,&ftm); - SetFileTime(hFile,&ftm,&ftLastAcc,&ftm); - CloseHandle(hFile); -#else -#ifdef unix - struct utimbuf ut; - struct tm newdate; - newdate.tm_sec = tmu_date.tm_sec; - newdate.tm_min=tmu_date.tm_min; - newdate.tm_hour=tmu_date.tm_hour; - newdate.tm_mday=tmu_date.tm_mday; - newdate.tm_mon=tmu_date.tm_mon; - if (tmu_date.tm_year > 1900) - newdate.tm_year=tmu_date.tm_year - 1900; - else - newdate.tm_year=tmu_date.tm_year ; - newdate.tm_isdst=-1; - - ut.actime=ut.modtime=mktime(&newdate); - utime(filename,&ut); -#endif -#endif -} - - -/* mymkdir and change_file_date are not 100 % portable - As I don't know well Unix, I wait feedback for the unix portion */ - -int mymkdir(dirname) - const char* dirname; -{ - int ret=0; -#ifdef WIN32 - ret = mkdir(dirname); -#else -#ifdef unix - ret = mkdir (dirname,0775); -#endif -#endif - return ret; -} - -int makedir (newdir) - char *newdir; -{ - char *buffer ; - char *p; - int len = (int)strlen(newdir); - - if (len <= 0) - return 0; - - buffer = (char*)malloc(len+1); - strcpy(buffer,newdir); - - if (buffer[len-1] == '/') { - buffer[len-1] = '\0'; - } - if (mymkdir(buffer) == 0) - { - free(buffer); - return 1; - } - - p = buffer+1; - while (1) - { - char hold; - - while(*p && *p != '\\' && *p != '/') - p++; - hold = *p; - *p = 0; - if ((mymkdir(buffer) == -1) && (errno == ENOENT)) - { - printf("couldn't create directory %s\n",buffer); - free(buffer); - return 0; - } - if (hold == 0) - break; - *p++ = hold; - } - free(buffer); - return 1; -} - -void do_banner() -{ - printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n"); - printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); -} - -void do_help() -{ - printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \ - " -e Extract without pathname (junk paths)\n" \ - " -x Extract with pathname\n" \ - " -v list files\n" \ - " -l list files\n" \ - " -d directory to extract into\n" \ - " -o overwrite files without prompting\n" \ - " -p extract crypted file using password\n\n"); -} - - -int do_list(uf) - unzFile uf; -{ - uLong i; - unz_global_info gi; - int err; - - err = unzGetGlobalInfo (uf,&gi); - if (err!=UNZ_OK) - printf("error %d with zipfile in unzGetGlobalInfo \n",err); - printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); - printf(" ------ ------ ---- ----- ---- ---- ------ ----\n"); - for (i=0;i0) - ratio = (file_info.compressed_size*100)/file_info.uncompressed_size; - - /* display a '*' if the file is crypted */ - if ((file_info.flag & 1) != 0) - charCrypt='*'; - - if (file_info.compression_method==0) - string_method="Stored"; - else - if (file_info.compression_method==Z_DEFLATED) - { - uInt iLevel=(uInt)((file_info.flag & 0x6)/2); - if (iLevel==0) - string_method="Defl:N"; - else if (iLevel==1) - string_method="Defl:X"; - else if ((iLevel==2) || (iLevel==3)) - string_method="Defl:F"; /* 2:fast , 3 : extra fast*/ - } - else - string_method="Unkn. "; - - printf("%7lu %6s%c%7lu %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n", - file_info.uncompressed_size,string_method, - charCrypt, - file_info.compressed_size, - ratio, - (uLong)file_info.tmu_date.tm_mon + 1, - (uLong)file_info.tmu_date.tm_mday, - (uLong)file_info.tmu_date.tm_year % 100, - (uLong)file_info.tmu_date.tm_hour,(uLong)file_info.tmu_date.tm_min, - (uLong)file_info.crc,filename_inzip); - if ((i+1)='a') && (rep<='z')) - rep -= 0x20; - } - while ((rep!='Y') && (rep!='N') && (rep!='A')); - } - - if (rep == 'N') - skip = 1; - - if (rep == 'A') - *popt_overwrite=1; - } - - if ((skip==0) && (err==UNZ_OK)) - { - fout=fopen(write_filename,"wb"); - - /* some zipfile don't contain directory alone before file */ - if ((fout==NULL) && ((*popt_extract_without_path)==0) && - (filename_withoutpath!=(char*)filename_inzip)) - { - char c=*(filename_withoutpath-1); - *(filename_withoutpath-1)='\0'; - makedir(write_filename); - *(filename_withoutpath-1)=c; - fout=fopen(write_filename,"wb"); - } - - if (fout==NULL) - { - printf("error opening %s\n",write_filename); - } - } - - if (fout!=NULL) - { - printf(" extracting: %s\n",write_filename); - - do - { - err = unzReadCurrentFile(uf,buf,size_buf); - if (err<0) - { - printf("error %d with zipfile in unzReadCurrentFile\n",err); - break; - } - if (err>0) - if (fwrite(buf,err,1,fout)!=1) - { - printf("error in writing extracted file\n"); - err=UNZ_ERRNO; - break; - } - } - while (err>0); - if (fout) - fclose(fout); - - if (err==0) - change_file_date(write_filename,file_info.dosDate, - file_info.tmu_date); - } - - if (err==UNZ_OK) - { - err = unzCloseCurrentFile (uf); - if (err!=UNZ_OK) - { - printf("error %d with zipfile in unzCloseCurrentFile\n",err); - } - } - else - unzCloseCurrentFile(uf); /* don't lose the error */ - } - - free(buf); - return err; -} - - -int do_extract(uf,opt_extract_without_path,opt_overwrite,password) - unzFile uf; - int opt_extract_without_path; - int opt_overwrite; - const char* password; -{ - uLong i; - unz_global_info gi; - int err; - FILE* fout=NULL; - - err = unzGetGlobalInfo (uf,&gi); - if (err!=UNZ_OK) - printf("error %d with zipfile in unzGetGlobalInfo \n",err); - - for (i=0;i +#include +#include +#include +#include +#include + +#ifdef unix +# include +# include +#else +# include +# include +#endif + +#include "unzip.h" + +#define CASESENSITIVITY (0) +#define WRITEBUFFERSIZE (8192) +#define MAXFILENAME (256) + +#ifdef WIN32 +#define USEWIN32IOAPI +#include "iowin32.h" +#endif +/* + mini unzip, demo of unzip package + + usage : + Usage : miniunz [-exvlo] file.zip [file_to_extract] [-d extractdir] + + list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT + if it exists +*/ + + +/* change_file_date : change the date/time of a file + filename : the filename of the file where date/time must be modified + dosdate : the new date at the MSDos format (4 bytes) + tmu_date : the SAME new date at the tm_unz format */ +void change_file_date(filename,dosdate,tmu_date) + const char *filename; + uLong dosdate; + tm_unz tmu_date; +{ +#ifdef WIN32 + HANDLE hFile; + FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite; + + hFile = CreateFile(filename,GENERIC_READ | GENERIC_WRITE, + 0,NULL,OPEN_EXISTING,0,NULL); + GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite); + DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal); + LocalFileTimeToFileTime(&ftLocal,&ftm); + SetFileTime(hFile,&ftm,&ftLastAcc,&ftm); + CloseHandle(hFile); +#else +#ifdef unix + struct utimbuf ut; + struct tm newdate; + newdate.tm_sec = tmu_date.tm_sec; + newdate.tm_min=tmu_date.tm_min; + newdate.tm_hour=tmu_date.tm_hour; + newdate.tm_mday=tmu_date.tm_mday; + newdate.tm_mon=tmu_date.tm_mon; + if (tmu_date.tm_year > 1900) + newdate.tm_year=tmu_date.tm_year - 1900; + else + newdate.tm_year=tmu_date.tm_year ; + newdate.tm_isdst=-1; + + ut.actime=ut.modtime=mktime(&newdate); + utime(filename,&ut); +#endif +#endif +} + + +/* mymkdir and change_file_date are not 100 % portable + As I don't know well Unix, I wait feedback for the unix portion */ + +int mymkdir(dirname) + const char* dirname; +{ + int ret=0; +#ifdef WIN32 + ret = mkdir(dirname); +#else +#ifdef unix + ret = mkdir (dirname,0775); +#endif +#endif + return ret; +} + +int makedir (newdir) + char *newdir; +{ + char *buffer ; + char *p; + int len = (int)strlen(newdir); + + if (len <= 0) + return 0; + + buffer = (char*)malloc(len+1); + strcpy(buffer,newdir); + + if (buffer[len-1] == '/') { + buffer[len-1] = '\0'; + } + if (mymkdir(buffer) == 0) + { + free(buffer); + return 1; + } + + p = buffer+1; + while (1) + { + char hold; + + while(*p && *p != '\\' && *p != '/') + p++; + hold = *p; + *p = 0; + if ((mymkdir(buffer) == -1) && (errno == ENOENT)) + { + printf("couldn't create directory %s\n",buffer); + free(buffer); + return 0; + } + if (hold == 0) + break; + *p++ = hold; + } + free(buffer); + return 1; +} + +void do_banner() +{ + printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n"); + printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); +} + +void do_help() +{ + printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \ + " -e Extract without pathname (junk paths)\n" \ + " -x Extract with pathname\n" \ + " -v list files\n" \ + " -l list files\n" \ + " -d directory to extract into\n" \ + " -o overwrite files without prompting\n" \ + " -p extract crypted file using password\n\n"); +} + + +int do_list(uf) + unzFile uf; +{ + uLong i; + unz_global_info gi; + int err; + + err = unzGetGlobalInfo (uf,&gi); + if (err!=UNZ_OK) + printf("error %d with zipfile in unzGetGlobalInfo \n",err); + printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); + printf(" ------ ------ ---- ----- ---- ---- ------ ----\n"); + for (i=0;i0) + ratio = (file_info.compressed_size*100)/file_info.uncompressed_size; + + /* display a '*' if the file is crypted */ + if ((file_info.flag & 1) != 0) + charCrypt='*'; + + if (file_info.compression_method==0) + string_method="Stored"; + else + if (file_info.compression_method==Z_DEFLATED) + { + uInt iLevel=(uInt)((file_info.flag & 0x6)/2); + if (iLevel==0) + string_method="Defl:N"; + else if (iLevel==1) + string_method="Defl:X"; + else if ((iLevel==2) || (iLevel==3)) + string_method="Defl:F"; /* 2:fast , 3 : extra fast*/ + } + else + string_method="Unkn. "; + + printf("%7lu %6s%c%7lu %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n", + file_info.uncompressed_size,string_method, + charCrypt, + file_info.compressed_size, + ratio, + (uLong)file_info.tmu_date.tm_mon + 1, + (uLong)file_info.tmu_date.tm_mday, + (uLong)file_info.tmu_date.tm_year % 100, + (uLong)file_info.tmu_date.tm_hour,(uLong)file_info.tmu_date.tm_min, + (uLong)file_info.crc,filename_inzip); + if ((i+1)='a') && (rep<='z')) + rep -= 0x20; + } + while ((rep!='Y') && (rep!='N') && (rep!='A')); + } + + if (rep == 'N') + skip = 1; + + if (rep == 'A') + *popt_overwrite=1; + } + + if ((skip==0) && (err==UNZ_OK)) + { + fout=fopen(write_filename,"wb"); + + /* some zipfile don't contain directory alone before file */ + if ((fout==NULL) && ((*popt_extract_without_path)==0) && + (filename_withoutpath!=(char*)filename_inzip)) + { + char c=*(filename_withoutpath-1); + *(filename_withoutpath-1)='\0'; + makedir(write_filename); + *(filename_withoutpath-1)=c; + fout=fopen(write_filename,"wb"); + } + + if (fout==NULL) + { + printf("error opening %s\n",write_filename); + } + } + + if (fout!=NULL) + { + printf(" extracting: %s\n",write_filename); + + do + { + err = unzReadCurrentFile(uf,buf,size_buf); + if (err<0) + { + printf("error %d with zipfile in unzReadCurrentFile\n",err); + break; + } + if (err>0) + if (fwrite(buf,err,1,fout)!=1) + { + printf("error in writing extracted file\n"); + err=UNZ_ERRNO; + break; + } + } + while (err>0); + if (fout) + fclose(fout); + + if (err==0) + change_file_date(write_filename,file_info.dosDate, + file_info.tmu_date); + } + + if (err==UNZ_OK) + { + err = unzCloseCurrentFile (uf); + if (err!=UNZ_OK) + { + printf("error %d with zipfile in unzCloseCurrentFile\n",err); + } + } + else + unzCloseCurrentFile(uf); /* don't lose the error */ + } + + free(buf); + return err; +} + + +int do_extract(uf,opt_extract_without_path,opt_overwrite,password) + unzFile uf; + int opt_extract_without_path; + int opt_overwrite; + const char* password; +{ + uLong i; + unz_global_info gi; + int err; + FILE* fout=NULL; + + err = unzGetGlobalInfo (uf,&gi); + if (err!=UNZ_OK) + printf("error %d with zipfile in unzGetGlobalInfo \n",err); + + for (i=0;i -#include -#include -#include -#include -#include - -#ifdef unix -# include -# include -# include -# include -#else -# include -# include -#endif - -#include "zip.h" - -#ifdef WIN32 -#define USEWIN32IOAPI -#include "iowin32.h" -#endif - - - -#define WRITEBUFFERSIZE (16384) -#define MAXFILENAME (256) - -#ifdef WIN32 -uLong filetime(f, tmzip, dt) - char *f; /* name of file to get info on */ - tm_zip *tmzip; /* return value: access, modific. and creation times */ - uLong *dt; /* dostime */ -{ - int ret = 0; - { - FILETIME ftLocal; - HANDLE hFind; - WIN32_FIND_DATA ff32; - - hFind = FindFirstFile(f,&ff32); - if (hFind != INVALID_HANDLE_VALUE) - { - FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal); - FileTimeToDosDateTime(&ftLocal,((LPWORD)dt)+1,((LPWORD)dt)+0); - FindClose(hFind); - ret = 1; - } - } - return ret; -} -#else -#ifdef unix -uLong filetime(f, tmzip, dt) - char *f; /* name of file to get info on */ - tm_zip *tmzip; /* return value: access, modific. and creation times */ - uLong *dt; /* dostime */ -{ - int ret=0; - struct stat s; /* results of stat() */ - struct tm* filedate; - time_t tm_t=0; - - if (strcmp(f,"-")!=0) - { - char name[MAXFILENAME+1]; - int len = strlen(f); - if (len > MAXFILENAME) - len = MAXFILENAME; - - strncpy(name, f,MAXFILENAME-1); - /* strncpy doesnt append the trailing NULL, of the string is too long. */ - name[ MAXFILENAME ] = '\0'; - - if (name[len - 1] == '/') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - if (stat(name,&s)==0) - { - tm_t = s.st_mtime; - ret = 1; - } - } - filedate = localtime(&tm_t); - - tmzip->tm_sec = filedate->tm_sec; - tmzip->tm_min = filedate->tm_min; - tmzip->tm_hour = filedate->tm_hour; - tmzip->tm_mday = filedate->tm_mday; - tmzip->tm_mon = filedate->tm_mon ; - tmzip->tm_year = filedate->tm_year; - - return ret; -} -#else -uLong filetime(f, tmzip, dt) - char *f; /* name of file to get info on */ - tm_zip *tmzip; /* return value: access, modific. and creation times */ - uLong *dt; /* dostime */ -{ - return 0; -} -#endif -#endif - - - - -int check_exist_file(filename) - const char* filename; -{ - FILE* ftestexist; - int ret = 1; - ftestexist = fopen(filename,"rb"); - if (ftestexist==NULL) - ret = 0; - else - fclose(ftestexist); - return ret; -} - -void do_banner() -{ - printf("MiniZip 1.01b, demo of zLib + Zip package written by Gilles Vollant\n"); - printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); -} - -void do_help() -{ - printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] file.zip [files_to_add]\n\n" \ - " -o Overwrite existing file.zip\n" \ - " -a Append to existing file.zip\n" \ - " -0 Store only\n" \ - " -1 Compress faster\n" \ - " -9 Compress better\n\n"); -} - -/* calculate the CRC32 of a file, - because to encrypt a file, we need known the CRC32 of the file before */ -int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc) -{ - unsigned long calculate_crc=0; - int err=ZIP_OK; - FILE * fin = fopen(filenameinzip,"rb"); - unsigned long size_read = 0; - unsigned long total_read = 0; - if (fin==NULL) - { - err = ZIP_ERRNO; - } - - if (err == ZIP_OK) - do - { - err = ZIP_OK; - size_read = (int)fread(buf,1,size_buf,fin); - if (size_read < size_buf) - if (feof(fin)==0) - { - printf("error in reading %s\n",filenameinzip); - err = ZIP_ERRNO; - } - - if (size_read>0) - calculate_crc = crc32(calculate_crc,buf,size_read); - total_read += size_read; - - } while ((err == ZIP_OK) && (size_read>0)); - - if (fin) - fclose(fin); - - *result_crc=calculate_crc; - printf("file %s crc %x\n",filenameinzip,calculate_crc); - return err; -} - -int main(argc,argv) - int argc; - char *argv[]; -{ - int i; - int opt_overwrite=0; - int opt_compress_level=Z_DEFAULT_COMPRESSION; - int zipfilenamearg = 0; - char filename_try[MAXFILENAME+16]; - int zipok; - int err=0; - int size_buf=0; - void* buf=NULL; - const char* password=NULL; - - - do_banner(); - if (argc==1) - { - do_help(); - return 0; - } - else - { - for (i=1;i='0') && (c<='9')) - opt_compress_level = c-'0'; - - if (((c=='p') || (c=='P')) && (i+1='a') && (rep<='z')) - rep -= 0x20; - } - while ((rep!='Y') && (rep!='N') && (rep!='A')); - if (rep=='N') - zipok = 0; - if (rep=='A') - opt_overwrite = 2; - } - } - - if (zipok==1) - { - zipFile zf; - int errclose; -# ifdef USEWIN32IOAPI - zlib_filefunc_def ffunc; - fill_win32_filefunc(&ffunc); - zf = zipOpen2(filename_try,(opt_overwrite==2) ? 2 : 0,NULL,&ffunc); -# else - zf = zipOpen(filename_try,(opt_overwrite==2) ? 2 : 0); -# endif - - if (zf == NULL) - { - printf("error opening %s\n",filename_try); - err= ZIP_ERRNO; - } - else - printf("creating %s\n",filename_try); - - for (i=zipfilenamearg+1;(i='0') || (argv[i][1]<='9'))) && - (strlen(argv[i]) == 2))) - { - FILE * fin; - int size_read; - const char* filenameinzip = argv[i]; - zip_fileinfo zi; - unsigned long crcFile=0; - - zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour = - zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0; - zi.dosDate = 0; - zi.internal_fa = 0; - zi.external_fa = 0; - filetime(filenameinzip,&zi.tmz_date,&zi.dosDate); - -/* - err = zipOpenNewFileInZip(zf,filenameinzip,&zi, - NULL,0,NULL,0,NULL / * comment * /, - (opt_compress_level != 0) ? Z_DEFLATED : 0, - opt_compress_level); -*/ - if ((password != NULL) && (err==ZIP_OK)) - err = getFileCrc(filenameinzip,buf,size_buf,&crcFile); - - err = zipOpenNewFileInZip3(zf,filenameinzip,&zi, - NULL,0,NULL,0,NULL /* comment*/, - (opt_compress_level != 0) ? Z_DEFLATED : 0, - opt_compress_level,0, - /* -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, */ - -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - password,crcFile); - - if (err != ZIP_OK) - printf("error in opening %s in zipfile\n",filenameinzip); - else - { - fin = fopen(filenameinzip,"rb"); - if (fin==NULL) - { - err=ZIP_ERRNO; - printf("error in opening %s for reading\n",filenameinzip); - } - } - - if (err == ZIP_OK) - do - { - err = ZIP_OK; - size_read = (int)fread(buf,1,size_buf,fin); - if (size_read < size_buf) - if (feof(fin)==0) - { - printf("error in reading %s\n",filenameinzip); - err = ZIP_ERRNO; - } - - if (size_read>0) - { - err = zipWriteInFileInZip (zf,buf,size_read); - if (err<0) - { - printf("error in writing %s in the zipfile\n", - filenameinzip); - } - - } - } while ((err == ZIP_OK) && (size_read>0)); - - if (fin) - fclose(fin); - - if (err<0) - err=ZIP_ERRNO; - else - { - err = zipCloseFileInZip(zf); - if (err!=ZIP_OK) - printf("error in closing %s in the zipfile\n", - filenameinzip); - } - } - } - errclose = zipClose(zf,NULL); - if (errclose != ZIP_OK) - printf("error in closing %s\n",filename_try); - } - else - { - do_help(); - } - - free(buf); - return 0; -} +/* + minizip.c + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant +*/ + +#include +#include +#include +#include +#include +#include + +#ifdef unix +# include +# include +# include +# include +#else +# include +# include +#endif + +#include "zip.h" + +#ifdef WIN32 +#define USEWIN32IOAPI +#include "iowin32.h" +#endif + + + +#define WRITEBUFFERSIZE (16384) +#define MAXFILENAME (256) + +#ifdef WIN32 +uLong filetime(f, tmzip, dt) + char *f; /* name of file to get info on */ + tm_zip *tmzip; /* return value: access, modific. and creation times */ + uLong *dt; /* dostime */ +{ + int ret = 0; + { + FILETIME ftLocal; + HANDLE hFind; + WIN32_FIND_DATA ff32; + + hFind = FindFirstFile(f,&ff32); + if (hFind != INVALID_HANDLE_VALUE) + { + FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal); + FileTimeToDosDateTime(&ftLocal,((LPWORD)dt)+1,((LPWORD)dt)+0); + FindClose(hFind); + ret = 1; + } + } + return ret; +} +#else +#ifdef unix +uLong filetime(f, tmzip, dt) + char *f; /* name of file to get info on */ + tm_zip *tmzip; /* return value: access, modific. and creation times */ + uLong *dt; /* dostime */ +{ + int ret=0; + struct stat s; /* results of stat() */ + struct tm* filedate; + time_t tm_t=0; + + if (strcmp(f,"-")!=0) + { + char name[MAXFILENAME+1]; + int len = strlen(f); + if (len > MAXFILENAME) + len = MAXFILENAME; + + strncpy(name, f,MAXFILENAME-1); + /* strncpy doesnt append the trailing NULL, of the string is too long. */ + name[ MAXFILENAME ] = '\0'; + + if (name[len - 1] == '/') + name[len - 1] = '\0'; + /* not all systems allow stat'ing a file with / appended */ + if (stat(name,&s)==0) + { + tm_t = s.st_mtime; + ret = 1; + } + } + filedate = localtime(&tm_t); + + tmzip->tm_sec = filedate->tm_sec; + tmzip->tm_min = filedate->tm_min; + tmzip->tm_hour = filedate->tm_hour; + tmzip->tm_mday = filedate->tm_mday; + tmzip->tm_mon = filedate->tm_mon ; + tmzip->tm_year = filedate->tm_year; + + return ret; +} +#else +uLong filetime(f, tmzip, dt) + char *f; /* name of file to get info on */ + tm_zip *tmzip; /* return value: access, modific. and creation times */ + uLong *dt; /* dostime */ +{ + return 0; +} +#endif +#endif + + + + +int check_exist_file(filename) + const char* filename; +{ + FILE* ftestexist; + int ret = 1; + ftestexist = fopen(filename,"rb"); + if (ftestexist==NULL) + ret = 0; + else + fclose(ftestexist); + return ret; +} + +void do_banner() +{ + printf("MiniZip 1.01b, demo of zLib + Zip package written by Gilles Vollant\n"); + printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); +} + +void do_help() +{ + printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] file.zip [files_to_add]\n\n" \ + " -o Overwrite existing file.zip\n" \ + " -a Append to existing file.zip\n" \ + " -0 Store only\n" \ + " -1 Compress faster\n" \ + " -9 Compress better\n\n"); +} + +/* calculate the CRC32 of a file, + because to encrypt a file, we need known the CRC32 of the file before */ +int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc) +{ + unsigned long calculate_crc=0; + int err=ZIP_OK; + FILE * fin = fopen(filenameinzip,"rb"); + unsigned long size_read = 0; + unsigned long total_read = 0; + if (fin==NULL) + { + err = ZIP_ERRNO; + } + + if (err == ZIP_OK) + do + { + err = ZIP_OK; + size_read = (int)fread(buf,1,size_buf,fin); + if (size_read < size_buf) + if (feof(fin)==0) + { + printf("error in reading %s\n",filenameinzip); + err = ZIP_ERRNO; + } + + if (size_read>0) + calculate_crc = crc32(calculate_crc,buf,size_read); + total_read += size_read; + + } while ((err == ZIP_OK) && (size_read>0)); + + if (fin) + fclose(fin); + + *result_crc=calculate_crc; + printf("file %s crc %x\n",filenameinzip,calculate_crc); + return err; +} + +int main(argc,argv) + int argc; + char *argv[]; +{ + int i; + int opt_overwrite=0; + int opt_compress_level=Z_DEFAULT_COMPRESSION; + int zipfilenamearg = 0; + char filename_try[MAXFILENAME+16]; + int zipok; + int err=0; + int size_buf=0; + void* buf=NULL; + const char* password=NULL; + + + do_banner(); + if (argc==1) + { + do_help(); + return 0; + } + else + { + for (i=1;i='0') && (c<='9')) + opt_compress_level = c-'0'; + + if (((c=='p') || (c=='P')) && (i+1='a') && (rep<='z')) + rep -= 0x20; + } + while ((rep!='Y') && (rep!='N') && (rep!='A')); + if (rep=='N') + zipok = 0; + if (rep=='A') + opt_overwrite = 2; + } + } + + if (zipok==1) + { + zipFile zf; + int errclose; +# ifdef USEWIN32IOAPI + zlib_filefunc_def ffunc; + fill_win32_filefunc(&ffunc); + zf = zipOpen2(filename_try,(opt_overwrite==2) ? 2 : 0,NULL,&ffunc); +# else + zf = zipOpen(filename_try,(opt_overwrite==2) ? 2 : 0); +# endif + + if (zf == NULL) + { + printf("error opening %s\n",filename_try); + err= ZIP_ERRNO; + } + else + printf("creating %s\n",filename_try); + + for (i=zipfilenamearg+1;(i='0') || (argv[i][1]<='9'))) && + (strlen(argv[i]) == 2))) + { + FILE * fin; + int size_read; + const char* filenameinzip = argv[i]; + zip_fileinfo zi; + unsigned long crcFile=0; + + zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour = + zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0; + zi.dosDate = 0; + zi.internal_fa = 0; + zi.external_fa = 0; + filetime(filenameinzip,&zi.tmz_date,&zi.dosDate); + +/* + err = zipOpenNewFileInZip(zf,filenameinzip,&zi, + NULL,0,NULL,0,NULL / * comment * /, + (opt_compress_level != 0) ? Z_DEFLATED : 0, + opt_compress_level); +*/ + if ((password != NULL) && (err==ZIP_OK)) + err = getFileCrc(filenameinzip,buf,size_buf,&crcFile); + + err = zipOpenNewFileInZip3(zf,filenameinzip,&zi, + NULL,0,NULL,0,NULL /* comment*/, + (opt_compress_level != 0) ? Z_DEFLATED : 0, + opt_compress_level,0, + /* -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, */ + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + password,crcFile); + + if (err != ZIP_OK) + printf("error in opening %s in zipfile\n",filenameinzip); + else + { + fin = fopen(filenameinzip,"rb"); + if (fin==NULL) + { + err=ZIP_ERRNO; + printf("error in opening %s for reading\n",filenameinzip); + } + } + + if (err == ZIP_OK) + do + { + err = ZIP_OK; + size_read = (int)fread(buf,1,size_buf,fin); + if (size_read < size_buf) + if (feof(fin)==0) + { + printf("error in reading %s\n",filenameinzip); + err = ZIP_ERRNO; + } + + if (size_read>0) + { + err = zipWriteInFileInZip (zf,buf,size_read); + if (err<0) + { + printf("error in writing %s in the zipfile\n", + filenameinzip); + } + + } + } while ((err == ZIP_OK) && (size_read>0)); + + if (fin) + fclose(fin); + + if (err<0) + err=ZIP_ERRNO; + else + { + err = zipCloseFileInZip(zf); + if (err!=ZIP_OK) + printf("error in closing %s in the zipfile\n", + filenameinzip); + } + } + } + errclose = zipClose(zf,NULL); + if (errclose != ZIP_OK) + printf("error in closing %s\n",filename_try); + } + else + { + do_help(); + } + + free(buf); + return 0; +} diff --git a/JGE/src/unzip/mztools.c b/JGE/src/unzip/mztools.c index bc5c7982d..8a50ee439 100644 --- a/JGE/src/unzip/mztools.c +++ b/JGE/src/unzip/mztools.c @@ -1,281 +1,281 @@ -/* - Additional tools for Minizip - Code: Xavier Roche '2004 - License: Same as ZLIB (www.gzip.org) -*/ - -/* Code */ -#include -#include -#include -#include "zlib.h" -#include "unzip.h" - -#define READ_8(adr) ((unsigned char)*(adr)) -#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) ) -#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) ) - -#define WRITE_8(buff, n) do { \ - *((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \ -} while(0) -#define WRITE_16(buff, n) do { \ - WRITE_8((unsigned char*)(buff), n); \ - WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \ -} while(0) -#define WRITE_32(buff, n) do { \ - WRITE_16((unsigned char*)(buff), (n) & 0xffff); \ - WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \ -} while(0) - -extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) -const char* file; -const char* fileOut; -const char* fileOutTmp; -uLong* nRecovered; -uLong* bytesRecovered; -{ - int err = Z_OK; - FILE* fpZip = fopen(file, "rb"); - FILE* fpOut = fopen(fileOut, "wb"); - FILE* fpOutCD = fopen(fileOutTmp, "wb"); - if (fpZip != NULL && fpOut != NULL) { - int entries = 0; - uLong totalBytes = 0; - char header[30]; - char filename[256]; - char extra[1024]; - int offset = 0; - int offsetCD = 0; - while ( fread(header, 1, 30, fpZip) == 30 ) { - int currentOffset = offset; - - /* File entry */ - if (READ_32(header) == 0x04034b50) { - unsigned int version = READ_16(header + 4); - unsigned int gpflag = READ_16(header + 6); - unsigned int method = READ_16(header + 8); - unsigned int filetime = READ_16(header + 10); - unsigned int filedate = READ_16(header + 12); - unsigned int crc = READ_32(header + 14); /* crc */ - unsigned int cpsize = READ_32(header + 18); /* compressed size */ - unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */ - unsigned int fnsize = READ_16(header + 26); /* file name length */ - unsigned int extsize = READ_16(header + 28); /* extra field length */ - filename[0] = extra[0] = '\0'; - - /* Header */ - if (fwrite(header, 1, 30, fpOut) == 30) { - offset += 30; - } else { - err = Z_ERRNO; - break; - } - - /* Filename */ - if (fnsize > 0) { - if (fread(filename, 1, fnsize, fpZip) == fnsize) { - if (fwrite(filename, 1, fnsize, fpOut) == fnsize) { - offset += fnsize; - } else { - err = Z_ERRNO; - break; - } - } else { - err = Z_ERRNO; - break; - } - } else { - err = Z_STREAM_ERROR; - break; - } - - /* Extra field */ - if (extsize > 0) { - if (fread(extra, 1, extsize, fpZip) == extsize) { - if (fwrite(extra, 1, extsize, fpOut) == extsize) { - offset += extsize; - } else { - err = Z_ERRNO; - break; - } - } else { - err = Z_ERRNO; - break; - } - } - - /* Data */ - { - int dataSize = cpsize; - if (dataSize == 0) { - dataSize = uncpsize; - } - if (dataSize > 0) { - char* data = malloc(dataSize); - if (data != NULL) { - if ((int)fread(data, 1, dataSize, fpZip) == dataSize) { - if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) { - offset += dataSize; - totalBytes += dataSize; - } else { - err = Z_ERRNO; - } - } else { - err = Z_ERRNO; - } - free(data); - if (err != Z_OK) { - break; - } - } else { - err = Z_MEM_ERROR; - break; - } - } - } - - /* Central directory entry */ - { - char header[46]; - char* comment = ""; - int comsize = (int) strlen(comment); - WRITE_32(header, 0x02014b50); - WRITE_16(header + 4, version); - WRITE_16(header + 6, version); - WRITE_16(header + 8, gpflag); - WRITE_16(header + 10, method); - WRITE_16(header + 12, filetime); - WRITE_16(header + 14, filedate); - WRITE_32(header + 16, crc); - WRITE_32(header + 20, cpsize); - WRITE_32(header + 24, uncpsize); - WRITE_16(header + 28, fnsize); - WRITE_16(header + 30, extsize); - WRITE_16(header + 32, comsize); - WRITE_16(header + 34, 0); /* disk # */ - WRITE_16(header + 36, 0); /* int attrb */ - WRITE_32(header + 38, 0); /* ext attrb */ - WRITE_32(header + 42, currentOffset); - /* Header */ - if (fwrite(header, 1, 46, fpOutCD) == 46) { - offsetCD += 46; - - /* Filename */ - if (fnsize > 0) { - if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) { - offsetCD += fnsize; - } else { - err = Z_ERRNO; - break; - } - } else { - err = Z_STREAM_ERROR; - break; - } - - /* Extra field */ - if (extsize > 0) { - if (fwrite(extra, 1, extsize, fpOutCD) == extsize) { - offsetCD += extsize; - } else { - err = Z_ERRNO; - break; - } - } - - /* Comment field */ - if (comsize > 0) { - if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) { - offsetCD += comsize; - } else { - err = Z_ERRNO; - break; - } - } - - - } else { - err = Z_ERRNO; - break; - } - } - - /* Success */ - entries++; - - } else { - break; - } - } - - /* Final central directory */ - { - int entriesZip = entries; - char header[22]; - char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools"; - int comsize = (int) strlen(comment); - if (entriesZip > 0xffff) { - entriesZip = 0xffff; - } - WRITE_32(header, 0x06054b50); - WRITE_16(header + 4, 0); /* disk # */ - WRITE_16(header + 6, 0); /* disk # */ - WRITE_16(header + 8, entriesZip); /* hack */ - WRITE_16(header + 10, entriesZip); /* hack */ - WRITE_32(header + 12, offsetCD); /* size of CD */ - WRITE_32(header + 16, offset); /* offset to CD */ - WRITE_16(header + 20, comsize); /* comment */ - - /* Header */ - if (fwrite(header, 1, 22, fpOutCD) == 22) { - - /* Comment field */ - if (comsize > 0) { - if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) { - err = Z_ERRNO; - } - } - - } else { - err = Z_ERRNO; - } - } - - /* Final merge (file + central directory) */ - fclose(fpOutCD); - if (err == Z_OK) { - fpOutCD = fopen(fileOutTmp, "rb"); - if (fpOutCD != NULL) { - int nRead; - char buffer[8192]; - while ( (nRead = (int)fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) { - if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) { - err = Z_ERRNO; - break; - } - } - fclose(fpOutCD); - } - } - - /* Close */ - fclose(fpZip); - fclose(fpOut); - - /* Wipe temporary file */ - (void)remove(fileOutTmp); - - /* Number of recovered entries */ - if (err == Z_OK) { - if (nRecovered != NULL) { - *nRecovered = entries; - } - if (bytesRecovered != NULL) { - *bytesRecovered = totalBytes; - } - } - } else { - err = Z_STREAM_ERROR; - } - return err; -} +/* + Additional tools for Minizip + Code: Xavier Roche '2004 + License: Same as ZLIB (www.gzip.org) +*/ + +/* Code */ +#include +#include +#include +#include "zlib.h" +#include "unzip.h" + +#define READ_8(adr) ((unsigned char)*(adr)) +#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) ) +#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) ) + +#define WRITE_8(buff, n) do { \ + *((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \ +} while(0) +#define WRITE_16(buff, n) do { \ + WRITE_8((unsigned char*)(buff), n); \ + WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \ +} while(0) +#define WRITE_32(buff, n) do { \ + WRITE_16((unsigned char*)(buff), (n) & 0xffff); \ + WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \ +} while(0) + +extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) +const char* file; +const char* fileOut; +const char* fileOutTmp; +uLong* nRecovered; +uLong* bytesRecovered; +{ + int err = Z_OK; + FILE* fpZip = fopen(file, "rb"); + FILE* fpOut = fopen(fileOut, "wb"); + FILE* fpOutCD = fopen(fileOutTmp, "wb"); + if (fpZip != NULL && fpOut != NULL) { + int entries = 0; + uLong totalBytes = 0; + char header[30]; + char filename[256]; + char extra[1024]; + int offset = 0; + int offsetCD = 0; + while ( fread(header, 1, 30, fpZip) == 30 ) { + int currentOffset = offset; + + /* File entry */ + if (READ_32(header) == 0x04034b50) { + unsigned int version = READ_16(header + 4); + unsigned int gpflag = READ_16(header + 6); + unsigned int method = READ_16(header + 8); + unsigned int filetime = READ_16(header + 10); + unsigned int filedate = READ_16(header + 12); + unsigned int crc = READ_32(header + 14); /* crc */ + unsigned int cpsize = READ_32(header + 18); /* compressed size */ + unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */ + unsigned int fnsize = READ_16(header + 26); /* file name length */ + unsigned int extsize = READ_16(header + 28); /* extra field length */ + filename[0] = extra[0] = '\0'; + + /* Header */ + if (fwrite(header, 1, 30, fpOut) == 30) { + offset += 30; + } else { + err = Z_ERRNO; + break; + } + + /* Filename */ + if (fnsize > 0) { + if (fread(filename, 1, fnsize, fpZip) == fnsize) { + if (fwrite(filename, 1, fnsize, fpOut) == fnsize) { + offset += fnsize; + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_STREAM_ERROR; + break; + } + + /* Extra field */ + if (extsize > 0) { + if (fread(extra, 1, extsize, fpZip) == extsize) { + if (fwrite(extra, 1, extsize, fpOut) == extsize) { + offset += extsize; + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_ERRNO; + break; + } + } + + /* Data */ + { + int dataSize = cpsize; + if (dataSize == 0) { + dataSize = uncpsize; + } + if (dataSize > 0) { + char* data = malloc(dataSize); + if (data != NULL) { + if ((int)fread(data, 1, dataSize, fpZip) == dataSize) { + if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) { + offset += dataSize; + totalBytes += dataSize; + } else { + err = Z_ERRNO; + } + } else { + err = Z_ERRNO; + } + free(data); + if (err != Z_OK) { + break; + } + } else { + err = Z_MEM_ERROR; + break; + } + } + } + + /* Central directory entry */ + { + char header[46]; + char* comment = ""; + int comsize = (int) strlen(comment); + WRITE_32(header, 0x02014b50); + WRITE_16(header + 4, version); + WRITE_16(header + 6, version); + WRITE_16(header + 8, gpflag); + WRITE_16(header + 10, method); + WRITE_16(header + 12, filetime); + WRITE_16(header + 14, filedate); + WRITE_32(header + 16, crc); + WRITE_32(header + 20, cpsize); + WRITE_32(header + 24, uncpsize); + WRITE_16(header + 28, fnsize); + WRITE_16(header + 30, extsize); + WRITE_16(header + 32, comsize); + WRITE_16(header + 34, 0); /* disk # */ + WRITE_16(header + 36, 0); /* int attrb */ + WRITE_32(header + 38, 0); /* ext attrb */ + WRITE_32(header + 42, currentOffset); + /* Header */ + if (fwrite(header, 1, 46, fpOutCD) == 46) { + offsetCD += 46; + + /* Filename */ + if (fnsize > 0) { + if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) { + offsetCD += fnsize; + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_STREAM_ERROR; + break; + } + + /* Extra field */ + if (extsize > 0) { + if (fwrite(extra, 1, extsize, fpOutCD) == extsize) { + offsetCD += extsize; + } else { + err = Z_ERRNO; + break; + } + } + + /* Comment field */ + if (comsize > 0) { + if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) { + offsetCD += comsize; + } else { + err = Z_ERRNO; + break; + } + } + + + } else { + err = Z_ERRNO; + break; + } + } + + /* Success */ + entries++; + + } else { + break; + } + } + + /* Final central directory */ + { + int entriesZip = entries; + char header[22]; + char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools"; + int comsize = (int) strlen(comment); + if (entriesZip > 0xffff) { + entriesZip = 0xffff; + } + WRITE_32(header, 0x06054b50); + WRITE_16(header + 4, 0); /* disk # */ + WRITE_16(header + 6, 0); /* disk # */ + WRITE_16(header + 8, entriesZip); /* hack */ + WRITE_16(header + 10, entriesZip); /* hack */ + WRITE_32(header + 12, offsetCD); /* size of CD */ + WRITE_32(header + 16, offset); /* offset to CD */ + WRITE_16(header + 20, comsize); /* comment */ + + /* Header */ + if (fwrite(header, 1, 22, fpOutCD) == 22) { + + /* Comment field */ + if (comsize > 0) { + if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) { + err = Z_ERRNO; + } + } + + } else { + err = Z_ERRNO; + } + } + + /* Final merge (file + central directory) */ + fclose(fpOutCD); + if (err == Z_OK) { + fpOutCD = fopen(fileOutTmp, "rb"); + if (fpOutCD != NULL) { + int nRead; + char buffer[8192]; + while ( (nRead = (int)fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) { + if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) { + err = Z_ERRNO; + break; + } + } + fclose(fpOutCD); + } + } + + /* Close */ + fclose(fpZip); + fclose(fpOut); + + /* Wipe temporary file */ + (void)remove(fileOutTmp); + + /* Number of recovered entries */ + if (err == Z_OK) { + if (nRecovered != NULL) { + *nRecovered = entries; + } + if (bytesRecovered != NULL) { + *bytesRecovered = totalBytes; + } + } + } else { + err = Z_STREAM_ERROR; + } + return err; +} diff --git a/JGE/src/unzip/mztools.h b/JGE/src/unzip/mztools.h index 82d1597ad..eee78dc56 100644 --- a/JGE/src/unzip/mztools.h +++ b/JGE/src/unzip/mztools.h @@ -1,31 +1,31 @@ -/* - Additional tools for Minizip - Code: Xavier Roche '2004 - License: Same as ZLIB (www.gzip.org) -*/ - -#ifndef _zip_tools_H -#define _zip_tools_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#include "unzip.h" - -/* Repair a ZIP file (missing central directory) - file: file to recover - fileOut: output file after recovery - fileOutTmp: temporary file name used for recovery -*/ -extern int ZEXPORT unzRepair(const char* file, - const char* fileOut, - const char* fileOutTmp, - uLong* nRecovered, - uLong* bytesRecovered); - -#endif +/* + Additional tools for Minizip + Code: Xavier Roche '2004 + License: Same as ZLIB (www.gzip.org) +*/ + +#ifndef _zip_tools_H +#define _zip_tools_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#include "unzip.h" + +/* Repair a ZIP file (missing central directory) + file: file to recover + fileOut: output file after recovery + fileOutTmp: temporary file name used for recovery +*/ +extern int ZEXPORT unzRepair(const char* file, + const char* fileOut, + const char* fileOutTmp, + uLong* nRecovered, + uLong* bytesRecovered); + +#endif diff --git a/JGE/src/unzip/unzip.c b/JGE/src/unzip/unzip.c index 3a7062980..9ad4766d8 100644 --- a/JGE/src/unzip/unzip.c +++ b/JGE/src/unzip/unzip.c @@ -1,1598 +1,1598 @@ -/* unzip.c -- IO for uncompress .zip files using zlib - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - Read unzip.h for more info -*/ - -/* Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of -compatibility with older software. The following is from the original crypt.c. Code -woven in by Terry Thorsen 1/2003. -*/ -/* - Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] - - The encryption/decryption parts of this source code (as opposed to the - non-echoing password parts) were originally written in Europe. The - whole source package can be freely distributed, including from the USA. - (Prior to January 2000, re-export from the US was a violation of US law.) - */ - -/* - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - */ - - -#include -#include -#include -#include "zlib.h" -#include "unzip.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - - -#ifndef CASESENSITIVITYDEFAULT_NO -# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) -# define CASESENSITIVITYDEFAULT_NO -# endif -#endif - - -#ifndef UNZ_BUFSIZE -#define UNZ_BUFSIZE (16384) -#endif - -#ifndef UNZ_MAXFILENAMEINZIP -#define UNZ_MAXFILENAMEINZIP (256) -#endif - -#ifndef ALLOC -# define ALLOC(size) (malloc(size)) -#endif -#ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} -#endif - -#define SIZECENTRALDIRITEM (0x2e) -#define SIZEZIPLOCALHEADER (0x1e) - - - - -const char unz_copyright[] = - " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; - -/* unz_file_info_interntal contain internal info about a file in zipfile*/ -typedef struct unz_file_info_internal_s -{ - uLong offset_curfile;/* relative offset of local header 4 bytes */ -} unz_file_info_internal; - - -/* file_in_zip_read_info_s contain internal information about a file in zipfile, - when reading and decompress it */ -typedef struct -{ - char *read_buffer; /* internal buffer for compressed data */ - z_stream stream; /* zLib stream structure for inflate */ - - uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ - uLong stream_initialised; /* flag set if stream structure is initialised*/ - - uLong offset_local_extrafield;/* offset of the local extra field */ - uInt size_local_extrafield;/* size of the local extra field */ - uLong pos_local_extrafield; /* position in the local extra field in read*/ - - uLong crc32; /* crc32 of all data uncompressed */ - uLong crc32_wait; /* crc32 we must obtain after decompress all */ - uLong rest_read_compressed; /* number of byte to be decompressed */ - uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/ - zlib_filefunc_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - uLong compression_method; /* compression method (0==store) */ - uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - int raw; -} file_in_zip_read_info_s; - - -/* unz_s contain internal information about the zipfile -*/ -typedef struct -{ - zlib_filefunc_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - unz_global_info gi; /* public global information */ - uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - uLong num_file; /* number of the current file in the zipfile*/ - uLong pos_in_central_dir; /* pos of the current file in the central dir*/ - uLong current_file_ok; /* flag about the usability of the current file*/ - uLong central_pos; /* position of the beginning of the central dir*/ - - uLong size_central_dir; /* size of the central directory */ - uLong offset_central_dir; /* offset of start of central directory with - respect to the starting disk number */ - - unz_file_info cur_file_info; /* public info about the current file in zip*/ - unz_file_info_internal cur_file_info_internal; /* private info about it*/ - file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current - file if we are decompressing it */ - int encrypted; -# ifndef NOUNCRYPT - unsigned long keys[3]; /* keys defining the pseudo-random sequence */ - const unsigned long* pcrc_32_tab; -# endif -} unz_s; - - -#ifndef NOUNCRYPT -#include "crypt.h" -#endif - -/* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been sucessfully opened for reading. -*/ - - -local int unzlocal_getByte OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - int *pi)); - -local int unzlocal_getByte(pzlib_filefunc_def,filestream,pi) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - int *pi; -{ - unsigned char c; - int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); - if (err==1) - { - *pi = (int)c; - return UNZ_OK; - } - else - { - if (ZERROR(*pzlib_filefunc_def,filestream)) - return UNZ_ERRNO; - else - return UNZ_EOF; - } -} - - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets -*/ -local int unzlocal_getShort OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x ; - int i; - int err; - - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int unzlocal_getLong OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x ; - int i; - int err; - - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<16; - - if (err==UNZ_OK) - err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<24; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - - -/* My own strcmpi / strcasecmp */ -local int strcmpcasenosensitive_internal (fileName1,fileName2) - const char* fileName1; - const char* fileName2; -{ - for (;;) - { - char c1=*(fileName1++); - char c2=*(fileName2++); - if ((c1>='a') && (c1<='z')) - c1 -= 0x20; - if ((c2>='a') && (c2<='z')) - c2 -= 0x20; - if (c1=='\0') - return ((c2=='\0') ? 0 : -1); - if (c2=='\0') - return 1; - if (c1c2) - return 1; - } -} - - -#ifdef CASESENSITIVITYDEFAULT_NO -#define CASESENSITIVITYDEFAULTVALUE 2 -#else -#define CASESENSITIVITYDEFAULTVALUE 1 -#endif - -#ifndef STRCMPCASENOSENTIVEFUNCTION -#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal -#endif - -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system - (like 1 on Unix, 2 on Windows) - -*/ -extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity) - const char* fileName1; - const char* fileName2; - int iCaseSensitivity; -{ - if (iCaseSensitivity==0) - iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; - - if (iCaseSensitivity==1) - return strcmp(fileName1,fileName2); - - return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); -} - -#ifndef BUFREADCOMMENT -#define BUFREADCOMMENT (0x400) -#endif - -/* - Locate the Central directory of a zipfile (at the end, just before - the global comment) -*/ -local uLong unzlocal_SearchCentralDir OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream)); - -local uLong unzlocal_SearchCentralDir(pzlib_filefunc_def,filestream) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; -{ - unsigned char* buf; - uLong uSizeFile; - uLong uBackRead; - uLong uMaxBack=0xffff; /* maximum size of global comment */ - uLong uPosFound=0; - - if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); - if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - return uPosFound; -} - -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer - "zlib/zlib114.zip". - If the zipfile cannot be opened (file doesn't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ -extern unzFile ZEXPORT unzOpen2 (path, pzlib_filefunc_def) - const char *path; - zlib_filefunc_def* pzlib_filefunc_def; -{ - unz_s us; - unz_s *s; - uLong central_pos,uL; - - uLong number_disk; /* number of the current dist, used for - spaning ZIP, unsupported, always 0*/ - uLong number_disk_with_CD; /* number the the disk with central dir, used - for spaning ZIP, unsupported, always 0*/ - uLong number_entry_CD; /* total number of entries in - the central dir - (same than number_entry on nospan) */ - - int err=UNZ_OK; - - if (unz_copyright[0]!=' ') - return NULL; - - if (pzlib_filefunc_def==NULL) - fill_fopen_filefunc(&us.z_filefunc); - else - us.z_filefunc = *pzlib_filefunc_def; - - us.filestream= (*(us.z_filefunc.zopen_file))(us.z_filefunc.opaque, - path, - ZLIB_FILEFUNC_MODE_READ | - ZLIB_FILEFUNC_MODE_EXISTING); - if (us.filestream==NULL) - return NULL; - - central_pos = unzlocal_SearchCentralDir(&us.z_filefunc,us.filestream); - if (central_pos==0) - err=UNZ_ERRNO; - - if (ZSEEK(us.z_filefunc, us.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - /* the signature, already checked */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of this disk */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of the disk with the start of the central directory */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central dir on this disk */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central dir */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - if ((number_entry_CD!=us.gi.number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=UNZ_BADZIPFILE; - - /* size of the central directory */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - /* offset of start of central directory with respect to the - starting disk number */ - if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - /* zipfile comment length */ - if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) - err=UNZ_ERRNO; - - if ((central_pospfile_in_zip_read!=NULL) - unzCloseCurrentFile(file); - - ZCLOSE(s->z_filefunc, s->filestream); - TRYFREE(s); - return UNZ_OK; -} - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ -extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info) - unzFile file; - unz_global_info *pglobal_info; -{ - unz_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - *pglobal_info=s->gi; - return UNZ_OK; -} - - -/* - Translate date/time from Dos format to tm_unz (readable more easilty) -*/ -local void unzlocal_DosDateToTmuDate (ulDosDate, ptm) - uLong ulDosDate; - tm_unz* ptm; -{ - uLong uDate; - uDate = (uLong)(ulDosDate>>16); - ptm->tm_mday = (uInt)(uDate&0x1f) ; - ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; - ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; - - ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); - ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; - ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; -} - -/* - Get Info about the current file in the zipfile, with internal only info -*/ -local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file, - unz_file_info *pfile_info, - unz_file_info_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -local int unzlocal_GetCurrentFileInfoInternal (file, - pfile_info, - pfile_info_internal, - szFileName, fileNameBufferSize, - extraField, extraFieldBufferSize, - szComment, commentBufferSize) - unzFile file; - unz_file_info *pfile_info; - unz_file_info_internal *pfile_info_internal; - char *szFileName; - uLong fileNameBufferSize; - void *extraField; - uLong extraFieldBufferSize; - char *szComment; - uLong commentBufferSize; -{ - unz_s* s; - unz_file_info file_info; - unz_file_info_internal file_info_internal; - int err=UNZ_OK; - uLong uMagic; - long lSeek=0; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (ZSEEK(s->z_filefunc, s->filestream, - s->pos_in_central_dir+s->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - - /* we check the magic */ - if (err==UNZ_OK) - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x02014b50) - err=UNZ_BADZIPFILE; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) - err=UNZ_ERRNO; - - unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) - err=UNZ_ERRNO; - - lSeek+=file_info.size_filename; - if ((err==UNZ_OK) && (szFileName!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_filename0) && (fileNameBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek -= uSizeRead; - } - - - if ((err==UNZ_OK) && (extraField!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek += file_info.size_file_extra - uSizeRead; - } - else - lSeek+=file_info.size_file_extra; - - - if ((err==UNZ_OK) && (szComment!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - if ((file_info.size_file_comment>0) && (commentBufferSize>0)) - if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek+=file_info.size_file_comment - uSizeRead; - } - else - lSeek+=file_info.size_file_comment; - - if ((err==UNZ_OK) && (pfile_info!=NULL)) - *pfile_info=file_info; - - if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) - *pfile_info_internal=file_info_internal; - - return err; -} - - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. -*/ -extern int ZEXPORT unzGetCurrentFileInfo (file, - pfile_info, - szFileName, fileNameBufferSize, - extraField, extraFieldBufferSize, - szComment, commentBufferSize) - unzFile file; - unz_file_info *pfile_info; - char *szFileName; - uLong fileNameBufferSize; - void *extraField; - uLong extraFieldBufferSize; - char *szComment; - uLong commentBufferSize; -{ - return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL, - szFileName,fileNameBufferSize, - extraField,extraFieldBufferSize, - szComment,commentBufferSize); -} - -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ -extern int ZEXPORT unzGoToFirstFile (file) - unzFile file; -{ - int err=UNZ_OK; - unz_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - s->pos_in_central_dir=s->offset_central_dir; - s->num_file=0; - err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ -extern int ZEXPORT unzGoToNextFile (file) - unzFile file; -{ - unz_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ - if (s->num_file+1==s->gi.number_entry) - return UNZ_END_OF_LIST_OF_FILE; - - s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + - s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; - s->num_file++; - err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - - -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzipStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ -extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity) - unzFile file; - const char *szFileName; - int iCaseSensitivity; -{ - unz_s* s; - int err; - - /* We remember the 'current' position in the file so that we can jump - * back there if we fail. - */ - unz_file_info cur_file_infoSaved; - unz_file_info_internal cur_file_info_internalSaved; - uLong num_fileSaved; - uLong pos_in_central_dirSaved; - - - if (file==NULL) - return UNZ_PARAMERROR; - - if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) - return UNZ_PARAMERROR; - - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - /* Save the current state */ - num_fileSaved = s->num_file; - pos_in_central_dirSaved = s->pos_in_central_dir; - cur_file_infoSaved = s->cur_file_info; - cur_file_info_internalSaved = s->cur_file_info_internal; - - err = unzGoToFirstFile(file); - - while (err == UNZ_OK) - { - char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; - err = unzGetCurrentFileInfo(file,NULL, - szCurrentFileName,sizeof(szCurrentFileName)-1, - NULL,0,NULL,0); - if (err == UNZ_OK) - { - if (unzStringFileNameCompare(szCurrentFileName, - szFileName,iCaseSensitivity)==0) - return UNZ_OK; - err = unzGoToNextFile(file); - } - } - - /* We failed, so restore the state of the 'current file' to where we - * were. - */ - s->num_file = num_fileSaved ; - s->pos_in_central_dir = pos_in_central_dirSaved ; - s->cur_file_info = cur_file_infoSaved; - s->cur_file_info_internal = cur_file_info_internalSaved; - return err; -} - - -/* -/////////////////////////////////////////// -// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) -// I need random access -// -// Further optimization could be realized by adding an ability -// to cache the directory in memory. The goal being a single -// comprehensive file read to put the file I need in a memory. -*/ - -/* -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; // offset in file - uLong num_of_file; // # of file -} unz_file_pos; -*/ - -extern int ZEXPORT unzGetFilePos(file, file_pos) - unzFile file; - unz_file_pos* file_pos; -{ - unz_s* s; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - file_pos->pos_in_zip_directory = s->pos_in_central_dir; - file_pos->num_of_file = s->num_file; - - return UNZ_OK; -} - -extern int ZEXPORT unzGoToFilePos(file, file_pos) - unzFile file; - unz_file_pos* file_pos; -{ - unz_s* s; - int err; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - - /* jump to the right spot */ - s->pos_in_central_dir = file_pos->pos_in_zip_directory; - s->num_file = file_pos->num_of_file; - - /* set the current file */ - err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - /* return results */ - s->current_file_ok = (err == UNZ_OK); - return err; -} - -/* -// Unzip Helper Functions - should be here? -/////////////////////////////////////////// -*/ - -/* - Read the local header of the current zipfile - Check the coherency of the local header and info in the end of central - directory about this file - store in *piSizeVar the size of extra info in local header - (filename and size of extra field data) -*/ -local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar, - poffset_local_extrafield, - psize_local_extrafield) - unz_s* s; - uInt* piSizeVar; - uLong *poffset_local_extrafield; - uInt *psize_local_extrafield; -{ - uLong uMagic,uData,uFlags; - uLong size_filename; - uLong size_extra_field; - int err=UNZ_OK; - - *piSizeVar = 0; - *poffset_local_extrafield = 0; - *psize_local_extrafield = 0; - - if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + - s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - - if (err==UNZ_OK) - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x04034b50) - err=UNZ_BADZIPFILE; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; -/* - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) - err=UNZ_BADZIPFILE; -*/ - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) - err=UNZ_ERRNO; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) - err=UNZ_BADZIPFILE; - - if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ - err=UNZ_ERRNO; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && - ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) - err=UNZ_BADZIPFILE; - - *piSizeVar += (uInt)size_filename; - - if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) - err=UNZ_ERRNO; - *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + - SIZEZIPLOCALHEADER + size_filename; - *psize_local_extrafield = (uInt)size_extra_field; - - *piSizeVar += (uInt)size_extra_field; - - return err; -} - -/* - Open for reading data the current file in the zipfile. - If there is no error and the file is opened, the return value is UNZ_OK. -*/ -extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password) - unzFile file; - int* method; - int* level; - int raw; - const char* password; -{ - int err=UNZ_OK; - uInt iSizeVar; - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - uLong offset_local_extrafield; /* offset of the local extra field */ - uInt size_local_extrafield; /* size of the local extra field */ -# ifndef NOUNCRYPT - char source[12]; -# else - if (password != NULL) - return UNZ_PARAMERROR; -# endif - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return UNZ_PARAMERROR; - - if (s->pfile_in_zip_read != NULL) - unzCloseCurrentFile(file); - - if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar, - &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) - return UNZ_BADZIPFILE; - - pfile_in_zip_read_info = (file_in_zip_read_info_s*) - ALLOC(sizeof(file_in_zip_read_info_s)); - if (pfile_in_zip_read_info==NULL) - return UNZ_INTERNALERROR; - - pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); - pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; - pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; - pfile_in_zip_read_info->pos_local_extrafield=0; - pfile_in_zip_read_info->raw=raw; - - if (pfile_in_zip_read_info->read_buffer==NULL) - { - TRYFREE(pfile_in_zip_read_info); - return UNZ_INTERNALERROR; - } - - pfile_in_zip_read_info->stream_initialised=0; - - if (method!=NULL) - *method = (int)s->cur_file_info.compression_method; - - if (level!=NULL) - { - *level = 6; - switch (s->cur_file_info.flag & 0x06) - { - case 6 : *level = 1; break; - case 4 : *level = 2; break; - case 2 : *level = 9; break; - } - } - - if ((s->cur_file_info.compression_method!=0) && - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - - pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; - pfile_in_zip_read_info->crc32=0; - pfile_in_zip_read_info->compression_method = - s->cur_file_info.compression_method; - pfile_in_zip_read_info->filestream=s->filestream; - pfile_in_zip_read_info->z_filefunc=s->z_filefunc; - pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; - - pfile_in_zip_read_info->stream.total_out = 0; - - if ((s->cur_file_info.compression_method==Z_DEFLATED) && - (!raw)) - { - pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; - pfile_in_zip_read_info->stream.zfree = (free_func)0; - pfile_in_zip_read_info->stream.opaque = (voidpf)0; - pfile_in_zip_read_info->stream.next_in = (voidpf)0; - pfile_in_zip_read_info->stream.avail_in = 0; - - err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); - if (err == Z_OK) - pfile_in_zip_read_info->stream_initialised=1; - else - { - TRYFREE(pfile_in_zip_read_info); - return err; - } - /* windowBits is passed < 0 to tell that there is no zlib header. - * Note that in this case inflate *requires* an extra "dummy" byte - * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. - * In unzip, i don't wait absolutely Z_STREAM_END because I known the - * size of both compressed and uncompressed data - */ - } - pfile_in_zip_read_info->rest_read_compressed = - s->cur_file_info.compressed_size ; - pfile_in_zip_read_info->rest_read_uncompressed = - s->cur_file_info.uncompressed_size ; - - - pfile_in_zip_read_info->pos_in_zipfile = - s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + - iSizeVar; - - pfile_in_zip_read_info->stream.avail_in = (uInt)0; - - s->pfile_in_zip_read = pfile_in_zip_read_info; - -# ifndef NOUNCRYPT - if (password != NULL) - { - int i; - s->pcrc_32_tab = get_crc_table(); - init_keys(password,s->keys,s->pcrc_32_tab); - if (ZSEEK(s->z_filefunc, s->filestream, - s->pfile_in_zip_read->pos_in_zipfile + - s->pfile_in_zip_read->byte_before_the_zipfile, - SEEK_SET)!=0) - return UNZ_INTERNALERROR; - if(ZREAD(s->z_filefunc, s->filestream,source, 12)<12) - return UNZ_INTERNALERROR; - - for (i = 0; i<12; i++) - zdecode(s->keys,s->pcrc_32_tab,source[i]); - - s->pfile_in_zip_read->pos_in_zipfile+=12; - s->encrypted=1; - } -# endif - - - return UNZ_OK; -} - -extern int ZEXPORT unzOpenCurrentFile (file) - unzFile file; -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); -} - -extern int ZEXPORT unzOpenCurrentFilePassword (file, password) - unzFile file; - const char* password; -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, password); -} - -extern int ZEXPORT unzOpenCurrentFile2 (file,method,level,raw) - unzFile file; - int* method; - int* level; - int raw; -{ - return unzOpenCurrentFile3(file, method, level, raw, NULL); -} - -/* - Read bytes from the current file. - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if somes bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ -extern int ZEXPORT unzReadCurrentFile (file, buf, len) - unzFile file; - voidp buf; - unsigned len; -{ - int err=UNZ_OK; - uInt iRead = 0; - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if ((pfile_in_zip_read_info->read_buffer == NULL)) - return UNZ_END_OF_LIST_OF_FILE; - if (len==0) - return 0; - - pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; - - pfile_in_zip_read_info->stream.avail_out = (uInt)len; - - if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && - (!(pfile_in_zip_read_info->raw))) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_uncompressed; - - if ((len>pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in) && - (pfile_in_zip_read_info->raw)) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in; - - while (pfile_in_zip_read_info->stream.avail_out>0) - { - if ((pfile_in_zip_read_info->stream.avail_in==0) && - (pfile_in_zip_read_info->rest_read_compressed>0)) - { - uInt uReadThis = UNZ_BUFSIZE; - if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; - if (uReadThis == 0) - return UNZ_EOF; - if (ZSEEK(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->pos_in_zipfile + - pfile_in_zip_read_info->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - if (ZREAD(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->read_buffer, - uReadThis)!=uReadThis) - return UNZ_ERRNO; - - -# ifndef NOUNCRYPT - if(s->encrypted) - { - uInt i; - for(i=0;iread_buffer[i] = - zdecode(s->keys,s->pcrc_32_tab, - pfile_in_zip_read_info->read_buffer[i]); - } -# endif - - - pfile_in_zip_read_info->pos_in_zipfile += uReadThis; - - pfile_in_zip_read_info->rest_read_compressed-=uReadThis; - - pfile_in_zip_read_info->stream.next_in = - (Bytef*)pfile_in_zip_read_info->read_buffer; - pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; - } - - if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) - { - uInt uDoCopy,i ; - - if ((pfile_in_zip_read_info->stream.avail_in == 0) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - return (iRead==0) ? UNZ_EOF : iRead; - - if (pfile_in_zip_read_info->stream.avail_out < - pfile_in_zip_read_info->stream.avail_in) - uDoCopy = pfile_in_zip_read_info->stream.avail_out ; - else - uDoCopy = pfile_in_zip_read_info->stream.avail_in ; - - for (i=0;istream.next_out+i) = - *(pfile_in_zip_read_info->stream.next_in+i); - - pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, - pfile_in_zip_read_info->stream.next_out, - uDoCopy); - pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; - pfile_in_zip_read_info->stream.avail_in -= uDoCopy; - pfile_in_zip_read_info->stream.avail_out -= uDoCopy; - pfile_in_zip_read_info->stream.next_out += uDoCopy; - pfile_in_zip_read_info->stream.next_in += uDoCopy; - pfile_in_zip_read_info->stream.total_out += uDoCopy; - iRead += uDoCopy; - } - else - { - uLong uTotalOutBefore,uTotalOutAfter; - const Bytef *bufBefore; - uLong uOutThis; - int flush=Z_SYNC_FLUSH; - - uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; - bufBefore = pfile_in_zip_read_info->stream.next_out; - - /* - if ((pfile_in_zip_read_info->rest_read_uncompressed == - pfile_in_zip_read_info->stream.avail_out) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - flush = Z_FINISH; - */ - err=inflate(&pfile_in_zip_read_info->stream,flush); - - if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) - err = Z_DATA_ERROR; - - uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; - uOutThis = uTotalOutAfter-uTotalOutBefore; - - pfile_in_zip_read_info->crc32 = - crc32(pfile_in_zip_read_info->crc32,bufBefore, - (uInt)(uOutThis)); - - pfile_in_zip_read_info->rest_read_uncompressed -= - uOutThis; - - iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); - - if (err==Z_STREAM_END) - return (iRead==0) ? UNZ_EOF : iRead; - if (err!=Z_OK) - break; - } - } - - if (err==Z_OK) - return iRead; - return err; -} - - -/* - Give the current position in uncompressed data -*/ -extern z_off_t ZEXPORT unztell (file) - unzFile file; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - return (z_off_t)pfile_in_zip_read_info->stream.total_out; -} - - -/* - return 1 if the end of file was reached, 0 elsewhere -*/ -extern int ZEXPORT unzeof (file) - unzFile file; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - if (pfile_in_zip_read_info->rest_read_uncompressed == 0) - return 1; - else - return 0; -} - - - -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field that can be read - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ -extern int ZEXPORT unzGetLocalExtrafield (file,buf,len) - unzFile file; - voidp buf; - unsigned len; -{ - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - uInt read_now; - uLong size_to_read; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - size_to_read = (pfile_in_zip_read_info->size_local_extrafield - - pfile_in_zip_read_info->pos_local_extrafield); - - if (buf==NULL) - return (int)size_to_read; - - if (len>size_to_read) - read_now = (uInt)size_to_read; - else - read_now = (uInt)len ; - - if (read_now==0) - return 0; - - if (ZSEEK(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->offset_local_extrafield + - pfile_in_zip_read_info->pos_local_extrafield, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (ZREAD(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - buf,read_now)!=read_now) - return UNZ_ERRNO; - - return (int)read_now; -} - -/* - Close the file in zip opened with unzipOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ -extern int ZEXPORT unzCloseCurrentFile (file) - unzFile file; -{ - int err=UNZ_OK; - - unz_s* s; - file_in_zip_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && - (!pfile_in_zip_read_info->raw)) - { - if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) - err=UNZ_CRCERROR; - } - - - TRYFREE(pfile_in_zip_read_info->read_buffer); - pfile_in_zip_read_info->read_buffer = NULL; - if (pfile_in_zip_read_info->stream_initialised) - inflateEnd(&pfile_in_zip_read_info->stream); - - pfile_in_zip_read_info->stream_initialised = 0; - TRYFREE(pfile_in_zip_read_info); - - s->pfile_in_zip_read=NULL; - - return err; -} - - -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ -extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf) - unzFile file; - char *szComment; - uLong uSizeBuf; -{ - int err=UNZ_OK; - unz_s* s; - uLong uReadThis ; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - - uReadThis = uSizeBuf; - if (uReadThis>s->gi.size_comment) - uReadThis = s->gi.size_comment; - - if (ZSEEK(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (uReadThis>0) - { - *szComment='\0'; - if (ZREAD(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) - return UNZ_ERRNO; - } - - if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) - *(szComment+s->gi.size_comment)='\0'; - return (int)uReadThis; -} - -/* Additions by RX '2004 */ -extern uLong ZEXPORT unzGetOffset (file) - unzFile file; -{ - unz_s* s; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - if (!s->current_file_ok) - return 0; - if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) - if (s->num_file==s->gi.number_entry) - return 0; - return s->pos_in_central_dir; -} - -extern int ZEXPORT unzSetOffset (file, pos) - unzFile file; - uLong pos; -{ - unz_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz_s*)file; - - s->pos_in_central_dir = pos; - s->num_file = s->gi.number_entry; /* hack */ - err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} +/* unzip.c -- IO for uncompress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + Read unzip.h for more info +*/ + +/* Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of +compatibility with older software. The following is from the original crypt.c. Code +woven in by Terry Thorsen 1/2003. +*/ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* + crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + */ + +/* + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + */ + + +#include +#include +#include +#include "zlib.h" +#include "unzip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + + +#ifndef CASESENSITIVITYDEFAULT_NO +# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) +# define CASESENSITIVITYDEFAULT_NO +# endif +#endif + + +#ifndef UNZ_BUFSIZE +#define UNZ_BUFSIZE (16384) +#endif + +#ifndef UNZ_MAXFILENAMEINZIP +#define UNZ_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) + + + + +const char unz_copyright[] = + " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + +/* unz_file_info_interntal contain internal info about a file in zipfile*/ +typedef struct unz_file_info_internal_s +{ + uLong offset_curfile;/* relative offset of local header 4 bytes */ +} unz_file_info_internal; + + +/* file_in_zip_read_info_s contain internal information about a file in zipfile, + when reading and decompress it */ +typedef struct +{ + char *read_buffer; /* internal buffer for compressed data */ + z_stream stream; /* zLib stream structure for inflate */ + + uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ + uLong stream_initialised; /* flag set if stream structure is initialised*/ + + uLong offset_local_extrafield;/* offset of the local extra field */ + uInt size_local_extrafield;/* size of the local extra field */ + uLong pos_local_extrafield; /* position in the local extra field in read*/ + + uLong crc32; /* crc32 of all data uncompressed */ + uLong crc32_wait; /* crc32 we must obtain after decompress all */ + uLong rest_read_compressed; /* number of byte to be decompressed */ + uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/ + zlib_filefunc_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + uLong compression_method; /* compression method (0==store) */ + uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + int raw; +} file_in_zip_read_info_s; + + +/* unz_s contain internal information about the zipfile +*/ +typedef struct +{ + zlib_filefunc_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + unz_global_info gi; /* public global information */ + uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + uLong num_file; /* number of the current file in the zipfile*/ + uLong pos_in_central_dir; /* pos of the current file in the central dir*/ + uLong current_file_ok; /* flag about the usability of the current file*/ + uLong central_pos; /* position of the beginning of the central dir*/ + + uLong size_central_dir; /* size of the central directory */ + uLong offset_central_dir; /* offset of start of central directory with + respect to the starting disk number */ + + unz_file_info cur_file_info; /* public info about the current file in zip*/ + unz_file_info_internal cur_file_info_internal; /* private info about it*/ + file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current + file if we are decompressing it */ + int encrypted; +# ifndef NOUNCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; +# endif +} unz_s; + + +#ifndef NOUNCRYPT +#include "crypt.h" +#endif + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ + + +local int unzlocal_getByte OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + int *pi)); + +local int unzlocal_getByte(pzlib_filefunc_def,filestream,pi) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + int *pi; +{ + unsigned char c; + int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return UNZ_OK; + } + else + { + if (ZERROR(*pzlib_filefunc_def,filestream)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int unzlocal_getShort OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unzlocal_getLong OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<16; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + + +/* My own strcmpi / strcasecmp */ +local int strcmpcasenosensitive_internal (fileName1,fileName2) + const char* fileName1; + const char* fileName2; +{ + for (;;) + { + char c1=*(fileName1++); + char c2=*(fileName2++); + if ((c1>='a') && (c1<='z')) + c1 -= 0x20; + if ((c2>='a') && (c2<='z')) + c2 -= 0x20; + if (c1=='\0') + return ((c2=='\0') ? 0 : -1); + if (c2=='\0') + return 1; + if (c1c2) + return 1; + } +} + + +#ifdef CASESENSITIVITYDEFAULT_NO +#define CASESENSITIVITYDEFAULTVALUE 2 +#else +#define CASESENSITIVITYDEFAULTVALUE 1 +#endif + +#ifndef STRCMPCASENOSENTIVEFUNCTION +#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal +#endif + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) + +*/ +extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity) + const char* fileName1; + const char* fileName2; + int iCaseSensitivity; +{ + if (iCaseSensitivity==0) + iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; + + if (iCaseSensitivity==1) + return strcmp(fileName1,fileName2); + + return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif + +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local uLong unzlocal_SearchCentralDir OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream)); + +local uLong unzlocal_SearchCentralDir(pzlib_filefunc_def,filestream) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; +{ + unsigned char* buf; + uLong uSizeFile; + uLong uBackRead; + uLong uMaxBack=0xffff; /* maximum size of global comment */ + uLong uPosFound=0; + + if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); + if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer + "zlib/zlib114.zip". + If the zipfile cannot be opened (file doesn't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ +extern unzFile ZEXPORT unzOpen2 (path, pzlib_filefunc_def) + const char *path; + zlib_filefunc_def* pzlib_filefunc_def; +{ + unz_s us; + unz_s *s; + uLong central_pos,uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + uLong number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + + int err=UNZ_OK; + + if (unz_copyright[0]!=' ') + return NULL; + + if (pzlib_filefunc_def==NULL) + fill_fopen_filefunc(&us.z_filefunc); + else + us.z_filefunc = *pzlib_filefunc_def; + + us.filestream= (*(us.z_filefunc.zopen_file))(us.z_filefunc.opaque, + path, + ZLIB_FILEFUNC_MODE_READ | + ZLIB_FILEFUNC_MODE_EXISTING); + if (us.filestream==NULL) + return NULL; + + central_pos = unzlocal_SearchCentralDir(&us.z_filefunc,us.filestream); + if (central_pos==0) + err=UNZ_ERRNO; + + if (ZSEEK(us.z_filefunc, us.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unzlocal_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* zipfile comment length */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((central_pospfile_in_zip_read!=NULL) + unzCloseCurrentFile(file); + + ZCLOSE(s->z_filefunc, s->filestream); + TRYFREE(s); + return UNZ_OK; +} + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ +extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info) + unzFile file; + unz_global_info *pglobal_info; +{ + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + *pglobal_info=s->gi; + return UNZ_OK; +} + + +/* + Translate date/time from Dos format to tm_unz (readable more easilty) +*/ +local void unzlocal_DosDateToTmuDate (ulDosDate, ptm) + uLong ulDosDate; + tm_unz* ptm; +{ + uLong uDate; + uDate = (uLong)(ulDosDate>>16); + ptm->tm_mday = (uInt)(uDate&0x1f) ; + ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; + ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; + + ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); + ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; + ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; +} + +/* + Get Info about the current file in the zipfile, with internal only info +*/ +local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file, + unz_file_info *pfile_info, + unz_file_info_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +local int unzlocal_GetCurrentFileInfoInternal (file, + pfile_info, + pfile_info_internal, + szFileName, fileNameBufferSize, + extraField, extraFieldBufferSize, + szComment, commentBufferSize) + unzFile file; + unz_file_info *pfile_info; + unz_file_info_internal *pfile_info_internal; + char *szFileName; + uLong fileNameBufferSize; + void *extraField; + uLong extraFieldBufferSize; + char *szComment; + uLong commentBufferSize; +{ + unz_s* s; + unz_file_info file_info; + unz_file_info_internal file_info_internal; + int err=UNZ_OK; + uLong uMagic; + long lSeek=0; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (ZSEEK(s->z_filefunc, s->filestream, + s->pos_in_central_dir+s->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + + /* we check the magic */ + if (err==UNZ_OK) + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x02014b50) + err=UNZ_BADZIPFILE; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) + err=UNZ_ERRNO; + + unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) + err=UNZ_ERRNO; + + lSeek+=file_info.size_filename; + if ((err==UNZ_OK) && (szFileName!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_filename0) && (fileNameBufferSize>0)) + if (ZREAD(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek -= uSizeRead; + } + + + if ((err==UNZ_OK) && (extraField!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) + if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek += file_info.size_file_extra - uSizeRead; + } + else + lSeek+=file_info.size_file_extra; + + + if ((err==UNZ_OK) && (szComment!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + if ((file_info.size_file_comment>0) && (commentBufferSize>0)) + if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek+=file_info.size_file_comment - uSizeRead; + } + else + lSeek+=file_info.size_file_comment; + + if ((err==UNZ_OK) && (pfile_info!=NULL)) + *pfile_info=file_info; + + if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) + *pfile_info_internal=file_info_internal; + + return err; +} + + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. +*/ +extern int ZEXPORT unzGetCurrentFileInfo (file, + pfile_info, + szFileName, fileNameBufferSize, + extraField, extraFieldBufferSize, + szComment, commentBufferSize) + unzFile file; + unz_file_info *pfile_info; + char *szFileName; + uLong fileNameBufferSize; + void *extraField; + uLong extraFieldBufferSize; + char *szComment; + uLong commentBufferSize; +{ + return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); +} + +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ +extern int ZEXPORT unzGoToFirstFile (file) + unzFile file; +{ + int err=UNZ_OK; + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + s->pos_in_central_dir=s->offset_central_dir; + s->num_file=0; + err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ +extern int ZEXPORT unzGoToNextFile (file) + unzFile file; +{ + unz_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ + if (s->num_file+1==s->gi.number_entry) + return UNZ_END_OF_LIST_OF_FILE; + + s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + + s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; + s->num_file++; + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzipStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ +extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity) + unzFile file; + const char *szFileName; + int iCaseSensitivity; +{ + unz_s* s; + int err; + + /* We remember the 'current' position in the file so that we can jump + * back there if we fail. + */ + unz_file_info cur_file_infoSaved; + unz_file_info_internal cur_file_info_internalSaved; + uLong num_fileSaved; + uLong pos_in_central_dirSaved; + + + if (file==NULL) + return UNZ_PARAMERROR; + + if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) + return UNZ_PARAMERROR; + + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + /* Save the current state */ + num_fileSaved = s->num_file; + pos_in_central_dirSaved = s->pos_in_central_dir; + cur_file_infoSaved = s->cur_file_info; + cur_file_info_internalSaved = s->cur_file_info_internal; + + err = unzGoToFirstFile(file); + + while (err == UNZ_OK) + { + char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; + err = unzGetCurrentFileInfo(file,NULL, + szCurrentFileName,sizeof(szCurrentFileName)-1, + NULL,0,NULL,0); + if (err == UNZ_OK) + { + if (unzStringFileNameCompare(szCurrentFileName, + szFileName,iCaseSensitivity)==0) + return UNZ_OK; + err = unzGoToNextFile(file); + } + } + + /* We failed, so restore the state of the 'current file' to where we + * were. + */ + s->num_file = num_fileSaved ; + s->pos_in_central_dir = pos_in_central_dirSaved ; + s->cur_file_info = cur_file_infoSaved; + s->cur_file_info_internal = cur_file_info_internalSaved; + return err; +} + + +/* +/////////////////////////////////////////// +// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) +// I need random access +// +// Further optimization could be realized by adding an ability +// to cache the directory in memory. The goal being a single +// comprehensive file read to put the file I need in a memory. +*/ + +/* +typedef struct unz_file_pos_s +{ + uLong pos_in_zip_directory; // offset in file + uLong num_of_file; // # of file +} unz_file_pos; +*/ + +extern int ZEXPORT unzGetFilePos(file, file_pos) + unzFile file; + unz_file_pos* file_pos; +{ + unz_s* s; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + file_pos->pos_in_zip_directory = s->pos_in_central_dir; + file_pos->num_of_file = s->num_file; + + return UNZ_OK; +} + +extern int ZEXPORT unzGoToFilePos(file, file_pos) + unzFile file; + unz_file_pos* file_pos; +{ + unz_s* s; + int err; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + /* jump to the right spot */ + s->pos_in_central_dir = file_pos->pos_in_zip_directory; + s->num_file = file_pos->num_of_file; + + /* set the current file */ + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + /* return results */ + s->current_file_ok = (err == UNZ_OK); + return err; +} + +/* +// Unzip Helper Functions - should be here? +/////////////////////////////////////////// +*/ + +/* + Read the local header of the current zipfile + Check the coherency of the local header and info in the end of central + directory about this file + store in *piSizeVar the size of extra info in local header + (filename and size of extra field data) +*/ +local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar, + poffset_local_extrafield, + psize_local_extrafield) + unz_s* s; + uInt* piSizeVar; + uLong *poffset_local_extrafield; + uInt *psize_local_extrafield; +{ + uLong uMagic,uData,uFlags; + uLong size_filename; + uLong size_extra_field; + int err=UNZ_OK; + + *piSizeVar = 0; + *poffset_local_extrafield = 0; + *psize_local_extrafield = 0; + + if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + + s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + + if (err==UNZ_OK) + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x04034b50) + err=UNZ_BADZIPFILE; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; +/* + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) + err=UNZ_BADZIPFILE; +*/ + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) + err=UNZ_BADZIPFILE; + + if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) + err=UNZ_BADZIPFILE; + + *piSizeVar += (uInt)size_filename; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) + err=UNZ_ERRNO; + *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + + SIZEZIPLOCALHEADER + size_filename; + *psize_local_extrafield = (uInt)size_extra_field; + + *piSizeVar += (uInt)size_extra_field; + + return err; +} + +/* + Open for reading data the current file in the zipfile. + If there is no error and the file is opened, the return value is UNZ_OK. +*/ +extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password) + unzFile file; + int* method; + int* level; + int raw; + const char* password; +{ + int err=UNZ_OK; + uInt iSizeVar; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uLong offset_local_extrafield; /* offset of the local extra field */ + uInt size_local_extrafield; /* size of the local extra field */ +# ifndef NOUNCRYPT + char source[12]; +# else + if (password != NULL) + return UNZ_PARAMERROR; +# endif + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_PARAMERROR; + + if (s->pfile_in_zip_read != NULL) + unzCloseCurrentFile(file); + + if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar, + &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) + return UNZ_BADZIPFILE; + + pfile_in_zip_read_info = (file_in_zip_read_info_s*) + ALLOC(sizeof(file_in_zip_read_info_s)); + if (pfile_in_zip_read_info==NULL) + return UNZ_INTERNALERROR; + + pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); + pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; + pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; + pfile_in_zip_read_info->pos_local_extrafield=0; + pfile_in_zip_read_info->raw=raw; + + if (pfile_in_zip_read_info->read_buffer==NULL) + { + TRYFREE(pfile_in_zip_read_info); + return UNZ_INTERNALERROR; + } + + pfile_in_zip_read_info->stream_initialised=0; + + if (method!=NULL) + *method = (int)s->cur_file_info.compression_method; + + if (level!=NULL) + { + *level = 6; + switch (s->cur_file_info.flag & 0x06) + { + case 6 : *level = 1; break; + case 4 : *level = 2; break; + case 2 : *level = 9; break; + } + } + + if ((s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; + pfile_in_zip_read_info->crc32=0; + pfile_in_zip_read_info->compression_method = + s->cur_file_info.compression_method; + pfile_in_zip_read_info->filestream=s->filestream; + pfile_in_zip_read_info->z_filefunc=s->z_filefunc; + pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; + + pfile_in_zip_read_info->stream.total_out = 0; + + if ((s->cur_file_info.compression_method==Z_DEFLATED) && + (!raw)) + { + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + pfile_in_zip_read_info->stream.next_in = (voidpf)0; + pfile_in_zip_read_info->stream.avail_in = 0; + + err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=1; + else + { + TRYFREE(pfile_in_zip_read_info); + return err; + } + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. + * In unzip, i don't wait absolutely Z_STREAM_END because I known the + * size of both compressed and uncompressed data + */ + } + pfile_in_zip_read_info->rest_read_compressed = + s->cur_file_info.compressed_size ; + pfile_in_zip_read_info->rest_read_uncompressed = + s->cur_file_info.uncompressed_size ; + + + pfile_in_zip_read_info->pos_in_zipfile = + s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + + iSizeVar; + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + + s->pfile_in_zip_read = pfile_in_zip_read_info; + +# ifndef NOUNCRYPT + if (password != NULL) + { + int i; + s->pcrc_32_tab = get_crc_table(); + init_keys(password,s->keys,s->pcrc_32_tab); + if (ZSEEK(s->z_filefunc, s->filestream, + s->pfile_in_zip_read->pos_in_zipfile + + s->pfile_in_zip_read->byte_before_the_zipfile, + SEEK_SET)!=0) + return UNZ_INTERNALERROR; + if(ZREAD(s->z_filefunc, s->filestream,source, 12)<12) + return UNZ_INTERNALERROR; + + for (i = 0; i<12; i++) + zdecode(s->keys,s->pcrc_32_tab,source[i]); + + s->pfile_in_zip_read->pos_in_zipfile+=12; + s->encrypted=1; + } +# endif + + + return UNZ_OK; +} + +extern int ZEXPORT unzOpenCurrentFile (file) + unzFile file; +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); +} + +extern int ZEXPORT unzOpenCurrentFilePassword (file, password) + unzFile file; + const char* password; +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, password); +} + +extern int ZEXPORT unzOpenCurrentFile2 (file,method,level,raw) + unzFile file; + int* method; + int* level; + int raw; +{ + return unzOpenCurrentFile3(file, method, level, raw, NULL); +} + +/* + Read bytes from the current file. + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ +extern int ZEXPORT unzReadCurrentFile (file, buf, len) + unzFile file; + voidp buf; + unsigned len; +{ + int err=UNZ_OK; + uInt iRead = 0; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->read_buffer == NULL)) + return UNZ_END_OF_LIST_OF_FILE; + if (len==0) + return 0; + + pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; + + pfile_in_zip_read_info->stream.avail_out = (uInt)len; + + if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && + (!(pfile_in_zip_read_info->raw))) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_uncompressed; + + if ((len>pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in) && + (pfile_in_zip_read_info->raw)) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in; + + while (pfile_in_zip_read_info->stream.avail_out>0) + { + if ((pfile_in_zip_read_info->stream.avail_in==0) && + (pfile_in_zip_read_info->rest_read_compressed>0)) + { + uInt uReadThis = UNZ_BUFSIZE; + if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; + if (uReadThis == 0) + return UNZ_EOF; + if (ZSEEK(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + if (ZREAD(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->read_buffer, + uReadThis)!=uReadThis) + return UNZ_ERRNO; + + +# ifndef NOUNCRYPT + if(s->encrypted) + { + uInt i; + for(i=0;iread_buffer[i] = + zdecode(s->keys,s->pcrc_32_tab, + pfile_in_zip_read_info->read_buffer[i]); + } +# endif + + + pfile_in_zip_read_info->pos_in_zipfile += uReadThis; + + pfile_in_zip_read_info->rest_read_compressed-=uReadThis; + + pfile_in_zip_read_info->stream.next_in = + (Bytef*)pfile_in_zip_read_info->read_buffer; + pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; + } + + if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) + { + uInt uDoCopy,i ; + + if ((pfile_in_zip_read_info->stream.avail_in == 0) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + return (iRead==0) ? UNZ_EOF : iRead; + + if (pfile_in_zip_read_info->stream.avail_out < + pfile_in_zip_read_info->stream.avail_in) + uDoCopy = pfile_in_zip_read_info->stream.avail_out ; + else + uDoCopy = pfile_in_zip_read_info->stream.avail_in ; + + for (i=0;istream.next_out+i) = + *(pfile_in_zip_read_info->stream.next_in+i); + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, + pfile_in_zip_read_info->stream.next_out, + uDoCopy); + pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; + pfile_in_zip_read_info->stream.avail_in -= uDoCopy; + pfile_in_zip_read_info->stream.avail_out -= uDoCopy; + pfile_in_zip_read_info->stream.next_out += uDoCopy; + pfile_in_zip_read_info->stream.next_in += uDoCopy; + pfile_in_zip_read_info->stream.total_out += uDoCopy; + iRead += uDoCopy; + } + else + { + uLong uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + uLong uOutThis; + int flush=Z_SYNC_FLUSH; + + uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; + bufBefore = pfile_in_zip_read_info->stream.next_out; + + /* + if ((pfile_in_zip_read_info->rest_read_uncompressed == + pfile_in_zip_read_info->stream.avail_out) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + flush = Z_FINISH; + */ + err=inflate(&pfile_in_zip_read_info->stream,flush); + + if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) + err = Z_DATA_ERROR; + + uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->crc32 = + crc32(pfile_in_zip_read_info->crc32,bufBefore, + (uInt)(uOutThis)); + + pfile_in_zip_read_info->rest_read_uncompressed -= + uOutThis; + + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + if (err==Z_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=Z_OK) + break; + } + } + + if (err==Z_OK) + return iRead; + return err; +} + + +/* + Give the current position in uncompressed data +*/ +extern z_off_t ZEXPORT unztell (file) + unzFile file; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + return (z_off_t)pfile_in_zip_read_info->stream.total_out; +} + + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ +extern int ZEXPORT unzeof (file) + unzFile file; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + return 1; + else + return 0; +} + + + +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field that can be read + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ +extern int ZEXPORT unzGetLocalExtrafield (file,buf,len) + unzFile file; + voidp buf; + unsigned len; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uInt read_now; + uLong size_to_read; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + size_to_read = (pfile_in_zip_read_info->size_local_extrafield - + pfile_in_zip_read_info->pos_local_extrafield); + + if (buf==NULL) + return (int)size_to_read; + + if (len>size_to_read) + read_now = (uInt)size_to_read; + else + read_now = (uInt)len ; + + if (read_now==0) + return 0; + + if (ZSEEK(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->offset_local_extrafield + + pfile_in_zip_read_info->pos_local_extrafield, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (ZREAD(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + buf,read_now)!=read_now) + return UNZ_ERRNO; + + return (int)read_now; +} + +/* + Close the file in zip opened with unzipOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ +extern int ZEXPORT unzCloseCurrentFile (file) + unzFile file; +{ + int err=UNZ_OK; + + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && + (!pfile_in_zip_read_info->raw)) + { + if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) + err=UNZ_CRCERROR; + } + + + TRYFREE(pfile_in_zip_read_info->read_buffer); + pfile_in_zip_read_info->read_buffer = NULL; + if (pfile_in_zip_read_info->stream_initialised) + inflateEnd(&pfile_in_zip_read_info->stream); + + pfile_in_zip_read_info->stream_initialised = 0; + TRYFREE(pfile_in_zip_read_info); + + s->pfile_in_zip_read=NULL; + + return err; +} + + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ +extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf) + unzFile file; + char *szComment; + uLong uSizeBuf; +{ + int err=UNZ_OK; + unz_s* s; + uLong uReadThis ; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + uReadThis = uSizeBuf; + if (uReadThis>s->gi.size_comment) + uReadThis = s->gi.size_comment; + + if (ZSEEK(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (uReadThis>0) + { + *szComment='\0'; + if (ZREAD(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) + return UNZ_ERRNO; + } + + if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) + *(szComment+s->gi.size_comment)='\0'; + return (int)uReadThis; +} + +/* Additions by RX '2004 */ +extern uLong ZEXPORT unzGetOffset (file) + unzFile file; +{ + unz_s* s; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return 0; + if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) + if (s->num_file==s->gi.number_entry) + return 0; + return s->pos_in_central_dir; +} + +extern int ZEXPORT unzSetOffset (file, pos) + unzFile file; + uLong pos; +{ + unz_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + s->pos_in_central_dir = pos; + s->num_file = s->gi.number_entry; /* hack */ + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} diff --git a/JGE/src/unzip/unzip.h b/JGE/src/unzip/unzip.h index ce78f2047..0e786782a 100644 --- a/JGE/src/unzip/unzip.h +++ b/JGE/src/unzip/unzip.h @@ -1,356 +1,356 @@ -/* unzip.h -- IO for uncompress .zip files using zlib - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g - WinZip, InfoZip tools and compatible. - - Multi volume ZipFile (span) are not supported. - Encryption compatible with pkzip 2.04g only supported - Old compressions used by old PKZip 1.x are not supported - - - I WAIT FEEDBACK at mail info@winimage.com - Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - -*/ - -/* for more info about .ZIP format, see - http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip - http://www.info-zip.org/pub/infozip/doc/ - PkWare has also a specification at : - ftp://ftp.pkware.com/probdesc.zip -*/ - -#ifndef _unz_H -#define _unz_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagunzFile__ { int unused; } unzFile__; -typedef unzFile__ *unzFile; -#else -typedef voidp unzFile; -#endif - - -#define UNZ_OK (0) -#define UNZ_END_OF_LIST_OF_FILE (-100) -#define UNZ_ERRNO (Z_ERRNO) -#define UNZ_EOF (0) -#define UNZ_PARAMERROR (-102) -#define UNZ_BADZIPFILE (-103) -#define UNZ_INTERNALERROR (-104) -#define UNZ_CRCERROR (-105) - - -/* tm_unz contain date/time info */ -typedef struct tm_unz_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_unz; - -/* unz_global_info structure contain global data about the ZIPfile - These data comes from the end of central dir */ -typedef struct unz_global_info_s -{ - uLong number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ -} unz_global_info; - - -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_info_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - uLong compressed_size; /* compressed size 4 bytes */ - uLong uncompressed_size; /* uncompressed size 4 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ - - tm_unz tmu_date; -} unz_file_info; - - -extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, - const char* fileName2, - int iCaseSensitivity)); -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system - (like 1 on Unix, 2 on Windows) -*/ - - -extern unzFile ZEXPORT unzOpen OF((const char *path)); -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer - "zlib/zlib113.zip". - If the zipfile cannot be opened (file don't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ - -extern unzFile ZEXPORT unzOpen2 OF((const char *path, - zlib_filefunc_def* pzlib_filefunc_def)); -/* - Open a Zip file, like unzOpen, but provide a set of file low level API - for read/write the zip file (see ioapi.h) -*/ - -extern int ZEXPORT unzClose OF((unzFile file)); -/* - Close a ZipFile opened with unzipOpen. - If there is files inside the .Zip opened with unzOpenCurrentFile (see later), - these files MUST be closed with unzipCloseCurrentFile before call unzipClose. - return UNZ_OK if there is no problem. */ - -extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, - unz_global_info *pglobal_info)); -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ - - -extern int ZEXPORT unzGetGlobalComment OF((unzFile file, - char *szComment, - uLong uSizeBuf)); -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ - - -/***************************************************************************/ -/* Unzip package allow you browse the directory of the zipfile */ - -extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ - -extern int ZEXPORT unzGoToNextFile OF((unzFile file)); -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ - -extern int ZEXPORT unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ - - -/* ****************************************** */ -/* Ryan supplied functions */ -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; /* offset in zip file directory */ - uLong num_of_file; /* # of file */ -} unz_file_pos; - -extern int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos); - -extern int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos); - -/* ****************************************** */ - -extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, - unz_file_info *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); -/* - Get Info about the current file - if pfile_info!=NULL, the *pfile_info structure will contain somes info about - the current file - if szFileName!=NULL, the filemane string will be copied in szFileName - (fileNameBufferSize is the size of the buffer) - if extraField!=NULL, the extra field information will be copied in extraField - (extraFieldBufferSize is the size of the buffer). - This is the Central-header version of the extra field - if szComment!=NULL, the comment string of the file will be copied in szComment - (commentBufferSize is the size of the buffer) -*/ - -/***************************************************************************/ -/* for reading the content of the current zipfile, you can open it, read data - from it, and close it (you can close it before reading all the file) - */ - -extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); -/* - Open for reading data the current file in the zipfile. - If there is no error, the return value is UNZ_OK. -*/ - -extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, - const char* password)); -/* - Open for reading data the current file in the zipfile. - password is a crypting password - If there is no error, the return value is UNZ_OK. -*/ - -extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, - int* method, - int* level, - int raw)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - -extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, - int* method, - int* level, - int raw, - const char* password)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - - -extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); -/* - Close the file in zip opened with unzOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ - -extern int ZEXPORT unzReadCurrentFile OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read bytes from the current file (opened by unzOpenCurrentFile) - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if somes bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ - -extern z_off_t ZEXPORT unztell OF((unzFile file)); -/* - Give the current position in uncompressed data -*/ - -extern int ZEXPORT unzeof OF((unzFile file)); -/* - return 1 if the end of file was reached, 0 elsewhere -*/ - -extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ - -/***************************************************************************/ - -/* Get the current file offset */ -extern uLong ZEXPORT unzGetOffset (unzFile file); - -/* Set the current file offset */ -extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); - - - -#ifdef __cplusplus -} -#endif - -#endif /* _unz_H */ +/* unzip.h -- IO for uncompress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + + Multi volume ZipFile (span) are not supported. + Encryption compatible with pkzip 2.04g only supported + Old compressions used by old PKZip 1.x are not supported + + + I WAIT FEEDBACK at mail info@winimage.com + Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +*/ + +/* for more info about .ZIP format, see + http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip + http://www.info-zip.org/pub/infozip/doc/ + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip +*/ + +#ifndef _unz_H +#define _unz_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef voidp unzFile; +#endif + + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info_s +{ + uLong number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + + +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_info_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + uLong compressed_size; /* compressed size 4 bytes */ + uLong uncompressed_size; /* uncompressed size 4 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info; + + +extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, + const char* fileName2, + int iCaseSensitivity)); +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) +*/ + + +extern unzFile ZEXPORT unzOpen OF((const char *path)); +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer + "zlib/zlib113.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ + +extern unzFile ZEXPORT unzOpen2 OF((const char *path, + zlib_filefunc_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unzOpen, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +extern int ZEXPORT unzClose OF((unzFile file)); +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, + unz_global_info *pglobal_info)); +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ + + +extern int ZEXPORT unzGetGlobalComment OF((unzFile file, + char *szComment, + uLong uSizeBuf)); +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +extern int ZEXPORT unzGoToNextFile OF((unzFile file)); +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +extern int ZEXPORT unzLocateFile OF((unzFile file, + const char *szFileName, + int iCaseSensitivity)); +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ + + +/* ****************************************** */ +/* Ryan supplied functions */ +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_pos_s +{ + uLong pos_in_zip_directory; /* offset in zip file directory */ + uLong num_of_file; /* # of file */ +} unz_file_pos; + +extern int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos); + +extern int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos); + +/* ****************************************** */ + +extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain somes info about + the current file + if szFileName!=NULL, the filemane string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (commentBufferSize is the size of the buffer) +*/ + +/***************************************************************************/ +/* for reading the content of the current zipfile, you can open it, read data + from it, and close it (you can close it before reading all the file) + */ + +extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, + const char* password)); +/* + Open for reading data the current file in the zipfile. + password is a crypting password + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, + int* method, + int* level, + int raw)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + +extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, + int* method, + int* level, + int raw, + const char* password)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + + +extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + +extern int ZEXPORT unzReadCurrentFile OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read bytes from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +extern z_off_t ZEXPORT unztell OF((unzFile file)); +/* + Give the current position in uncompressed data +*/ + +extern int ZEXPORT unzeof OF((unzFile file)); +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ + +/***************************************************************************/ + +/* Get the current file offset */ +extern uLong ZEXPORT unzGetOffset (unzFile file); + +/* Set the current file offset */ +extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); + + + +#ifdef __cplusplus +} +#endif + +#endif /* _unz_H */ diff --git a/JGE/src/unzip/zip.c b/JGE/src/unzip/zip.c index 400e2ba37..7fbe00274 100644 --- a/JGE/src/unzip/zip.c +++ b/JGE/src/unzip/zip.c @@ -1,1219 +1,1219 @@ -/* zip.c -- IO on .zip files using zlib - Version 1.01e, February 12th, 2005 - - 27 Dec 2004 Rolf Kalbermatter - Modification to zipOpen2 to support globalComment retrieval. - - Copyright (C) 1998-2005 Gilles Vollant - - Read zip.h for more info -*/ - - -#include -#include -#include -#include -#include "zlib.h" -#include "zip.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - -#ifndef VERSIONMADEBY -# define VERSIONMADEBY (0x0) /* platform depedent */ -#endif - -#ifndef Z_BUFSIZE -#define Z_BUFSIZE (16384) -#endif - -#ifndef Z_MAXFILENAMEINZIP -#define Z_MAXFILENAMEINZIP (256) -#endif - -#ifndef ALLOC -# define ALLOC(size) (malloc(size)) -#endif -#ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} -#endif - -/* -#define SIZECENTRALDIRITEM (0x2e) -#define SIZEZIPLOCALHEADER (0x1e) -*/ - -/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ - -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif - -#ifndef SEEK_END -#define SEEK_END 2 -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif - -#ifndef DEF_MEM_LEVEL -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif -#endif -const char zip_copyright[] = - " zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; - - -#define SIZEDATA_INDATABLOCK (4096-(4*4)) - -#define LOCALHEADERMAGIC (0x04034b50) -#define CENTRALHEADERMAGIC (0x02014b50) -#define ENDHEADERMAGIC (0x06054b50) - -#define FLAG_LOCALHEADER_OFFSET (0x06) -#define CRC_LOCALHEADER_OFFSET (0x0e) - -#define SIZECENTRALHEADER (0x2e) /* 46 */ - -typedef struct linkedlist_datablock_internal_s -{ - struct linkedlist_datablock_internal_s* next_datablock; - uLong avail_in_this_block; - uLong filled_in_this_block; - uLong unused; /* for future use and alignement */ - unsigned char data[SIZEDATA_INDATABLOCK]; -} linkedlist_datablock_internal; - -typedef struct linkedlist_data_s -{ - linkedlist_datablock_internal* first_block; - linkedlist_datablock_internal* last_block; -} linkedlist_data; - - -typedef struct -{ - z_stream stream; /* zLib stream structure for inflate */ - int stream_initialised; /* 1 is stream is initialised */ - uInt pos_in_buffered_data; /* last written byte in buffered_data */ - - uLong pos_local_header; /* offset of the local header of the file - currenty writing */ - char* central_header; /* central header data for the current file */ - uLong size_centralheader; /* size of the central header for cur file */ - uLong flag; /* flag of the file currently writing */ - - int method; /* compression method of file currenty wr.*/ - int raw; /* 1 for directly writing raw data */ - Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ - uLong dosDate; - uLong crc32; - int encrypt; -#ifndef NOCRYPT - unsigned long keys[3]; /* keys defining the pseudo-random sequence */ - const unsigned long* pcrc_32_tab; - int crypt_header_size; -#endif -} curfile_info; - -typedef struct -{ - zlib_filefunc_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ - linkedlist_data central_dir;/* datablock with central dir in construction*/ - int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/ - curfile_info ci; /* info on the file curretly writing */ - - uLong begin_pos; /* position of the beginning of the zipfile */ - uLong add_position_when_writting_offset; - uLong number_entry; -#ifndef NO_ADDFILEINEXISTINGZIP - char *globalcomment; -#endif -} zip_internal; - - - -#ifndef NOCRYPT -#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED -#include "crypt.h" -#endif - -local linkedlist_datablock_internal* allocate_new_datablock() -{ - linkedlist_datablock_internal* ldi; - ldi = (linkedlist_datablock_internal*) - ALLOC(sizeof(linkedlist_datablock_internal)); - if (ldi!=NULL) - { - ldi->next_datablock = NULL ; - ldi->filled_in_this_block = 0 ; - ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ; - } - return ldi; -} - -local void free_datablock(ldi) - linkedlist_datablock_internal* ldi; -{ - while (ldi!=NULL) - { - linkedlist_datablock_internal* ldinext = ldi->next_datablock; - TRYFREE(ldi); - ldi = ldinext; - } -} - -local void init_linkedlist(ll) - linkedlist_data* ll; -{ - ll->first_block = ll->last_block = NULL; -} - -local void free_linkedlist(ll) - linkedlist_data* ll; -{ - free_datablock(ll->first_block); - ll->first_block = ll->last_block = NULL; -} - - -local int add_data_in_datablock(ll,buf,len) - linkedlist_data* ll; - const void* buf; - uLong len; -{ - linkedlist_datablock_internal* ldi; - const unsigned char* from_copy; - - if (ll==NULL) - return ZIP_INTERNALERROR; - - if (ll->last_block == NULL) - { - ll->first_block = ll->last_block = allocate_new_datablock(); - if (ll->first_block == NULL) - return ZIP_INTERNALERROR; - } - - ldi = ll->last_block; - from_copy = (unsigned char*)buf; - - while (len>0) - { - uInt copy_this; - uInt i; - unsigned char* to_copy; - - if (ldi->avail_in_this_block==0) - { - ldi->next_datablock = allocate_new_datablock(); - if (ldi->next_datablock == NULL) - return ZIP_INTERNALERROR; - ldi = ldi->next_datablock ; - ll->last_block = ldi; - } - - if (ldi->avail_in_this_block < len) - copy_this = (uInt)ldi->avail_in_this_block; - else - copy_this = (uInt)len; - - to_copy = &(ldi->data[ldi->filled_in_this_block]); - - for (i=0;ifilled_in_this_block += copy_this; - ldi->avail_in_this_block -= copy_this; - from_copy += copy_this ; - len -= copy_this; - } - return ZIP_OK; -} - - - -/****************************************************************************/ - -#ifndef NO_ADDFILEINEXISTINGZIP -/* =========================================================================== - Inputs a long in LSB order to the given file - nbByte == 1, 2 or 4 (byte, short or long) -*/ - -local int ziplocal_putValue OF((const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, uLong x, int nbByte)); -local int ziplocal_putValue (pzlib_filefunc_def, filestream, x, nbByte) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong x; - int nbByte; -{ - unsigned char buf[4]; - int n; - for (n = 0; n < nbByte; n++) - { - buf[n] = (unsigned char)(x & 0xff); - x >>= 8; - } - if (x != 0) - { /* data overflow - hack for ZIP64 (X Roche) */ - for (n = 0; n < nbByte; n++) - { - buf[n] = 0xff; - } - } - - if (ZWRITE(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) - return ZIP_ERRNO; - else - return ZIP_OK; -} - -local void ziplocal_putValue_inmemory OF((void* dest, uLong x, int nbByte)); -local void ziplocal_putValue_inmemory (dest, x, nbByte) - void* dest; - uLong x; - int nbByte; -{ - unsigned char* buf=(unsigned char*)dest; - int n; - for (n = 0; n < nbByte; n++) { - buf[n] = (unsigned char)(x & 0xff); - x >>= 8; - } - - if (x != 0) - { /* data overflow - hack for ZIP64 */ - for (n = 0; n < nbByte; n++) - { - buf[n] = 0xff; - } - } -} - -/****************************************************************************/ - - -local uLong ziplocal_TmzDateToDosDate(ptm,dosDate) - const tm_zip* ptm; - uLong dosDate; -{ - uLong year = (uLong)ptm->tm_year; - if (year>1980) - year-=1980; - else if (year>80) - year-=80; - return - (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | - ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); -} - - -/****************************************************************************/ - -local int ziplocal_getByte OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - int *pi)); - -local int ziplocal_getByte(pzlib_filefunc_def,filestream,pi) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - int *pi; -{ - unsigned char c; - int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); - if (err==1) - { - *pi = (int)c; - return ZIP_OK; - } - else - { - if (ZERROR(*pzlib_filefunc_def,filestream)) - return ZIP_ERRNO; - else - return ZIP_EOF; - } -} - - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets -*/ -local int ziplocal_getShort OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int ziplocal_getShort (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x ; - int i; - int err; - - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==ZIP_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int ziplocal_getLong OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int ziplocal_getLong (pzlib_filefunc_def,filestream,pX) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; - uLong *pX; -{ - uLong x ; - int i; - int err; - - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<8; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<16; - - if (err==ZIP_OK) - err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<24; - - if (err==ZIP_OK) - *pX = x; - else - *pX = 0; - return err; -} - -#ifndef BUFREADCOMMENT -#define BUFREADCOMMENT (0x400) -#endif -/* - Locate the Central directory of a zipfile (at the end, just before - the global comment) -*/ -local uLong ziplocal_SearchCentralDir OF(( - const zlib_filefunc_def* pzlib_filefunc_def, - voidpf filestream)); - -local uLong ziplocal_SearchCentralDir(pzlib_filefunc_def,filestream) - const zlib_filefunc_def* pzlib_filefunc_def; - voidpf filestream; -{ - unsigned char* buf; - uLong uSizeFile; - uLong uBackRead; - uLong uMaxBack=0xffff; /* maximum size of global comment */ - uLong uPosFound=0; - - if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); - if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - return uPosFound; -} -#endif /* !NO_ADDFILEINEXISTINGZIP*/ - -/************************************************************/ -extern zipFile ZEXPORT zipOpen2 (pathname, append, globalcomment, pzlib_filefunc_def) - const char *pathname; - int append; - zipcharpc* globalcomment; - zlib_filefunc_def* pzlib_filefunc_def; -{ - zip_internal ziinit; - zip_internal* zi; - int err=ZIP_OK; - - - if (pzlib_filefunc_def==NULL) - fill_fopen_filefunc(&ziinit.z_filefunc); - else - ziinit.z_filefunc = *pzlib_filefunc_def; - - ziinit.filestream = (*(ziinit.z_filefunc.zopen_file)) - (ziinit.z_filefunc.opaque, - pathname, - (append == APPEND_STATUS_CREATE) ? - (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) : - (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING)); - - if (ziinit.filestream == NULL) - return NULL; - ziinit.begin_pos = ZTELL(ziinit.z_filefunc,ziinit.filestream); - ziinit.in_opened_file_inzip = 0; - ziinit.ci.stream_initialised = 0; - ziinit.number_entry = 0; - ziinit.add_position_when_writting_offset = 0; - init_linkedlist(&(ziinit.central_dir)); - - - zi = (zip_internal*)ALLOC(sizeof(zip_internal)); - if (zi==NULL) - { - ZCLOSE(ziinit.z_filefunc,ziinit.filestream); - return NULL; - } - - /* now we add file in a zipfile */ -# ifndef NO_ADDFILEINEXISTINGZIP - ziinit.globalcomment = NULL; - if (append == APPEND_STATUS_ADDINZIP) - { - uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - - uLong size_central_dir; /* size of the central directory */ - uLong offset_central_dir; /* offset of start of central directory */ - uLong central_pos,uL; - - uLong number_disk; /* number of the current dist, used for - spaning ZIP, unsupported, always 0*/ - uLong number_disk_with_CD; /* number the the disk with central dir, used - for spaning ZIP, unsupported, always 0*/ - uLong number_entry; - uLong number_entry_CD; /* total number of entries in - the central dir - (same than number_entry on nospan) */ - uLong size_comment; - - central_pos = ziplocal_SearchCentralDir(&ziinit.z_filefunc,ziinit.filestream); - if (central_pos==0) - err=ZIP_ERRNO; - - if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=ZIP_ERRNO; - - /* the signature, already checked */ - if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&uL)!=ZIP_OK) - err=ZIP_ERRNO; - - /* number of this disk */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk)!=ZIP_OK) - err=ZIP_ERRNO; - - /* number of the disk with the start of the central directory */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk_with_CD)!=ZIP_OK) - err=ZIP_ERRNO; - - /* total number of entries in the central dir on this disk */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry)!=ZIP_OK) - err=ZIP_ERRNO; - - /* total number of entries in the central dir */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry_CD)!=ZIP_OK) - err=ZIP_ERRNO; - - if ((number_entry_CD!=number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=ZIP_BADZIPFILE; - - /* size of the central directory */ - if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&size_central_dir)!=ZIP_OK) - err=ZIP_ERRNO; - - /* offset of start of central directory with respect to the - starting disk number */ - if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&offset_central_dir)!=ZIP_OK) - err=ZIP_ERRNO; - - /* zipfile global comment length */ - if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&size_comment)!=ZIP_OK) - err=ZIP_ERRNO; - - if ((central_pos0) - { - ziinit.globalcomment = ALLOC(size_comment+1); - if (ziinit.globalcomment) - { - size_comment = ZREAD(ziinit.z_filefunc, ziinit.filestream,ziinit.globalcomment,size_comment); - ziinit.globalcomment[size_comment]=0; - } - } - - byte_before_the_zipfile = central_pos - - (offset_central_dir+size_central_dir); - ziinit.add_position_when_writting_offset = byte_before_the_zipfile; - - { - uLong size_central_dir_to_read = size_central_dir; - size_t buf_size = SIZEDATA_INDATABLOCK; - void* buf_read = (void*)ALLOC(buf_size); - if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, - offset_central_dir + byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET) != 0) - err=ZIP_ERRNO; - - while ((size_central_dir_to_read>0) && (err==ZIP_OK)) - { - uLong read_this = SIZEDATA_INDATABLOCK; - if (read_this > size_central_dir_to_read) - read_this = size_central_dir_to_read; - if (ZREAD(ziinit.z_filefunc, ziinit.filestream,buf_read,read_this) != read_this) - err=ZIP_ERRNO; - - if (err==ZIP_OK) - err = add_data_in_datablock(&ziinit.central_dir,buf_read, - (uLong)read_this); - size_central_dir_to_read-=read_this; - } - TRYFREE(buf_read); - } - ziinit.begin_pos = byte_before_the_zipfile; - ziinit.number_entry = number_entry_CD; - - if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, - offset_central_dir+byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=ZIP_ERRNO; - } - - if (globalcomment) - { - *globalcomment = ziinit.globalcomment; - } -# endif /* !NO_ADDFILEINEXISTINGZIP*/ - - if (err != ZIP_OK) - { -# ifndef NO_ADDFILEINEXISTINGZIP - TRYFREE(ziinit.globalcomment); -# endif /* !NO_ADDFILEINEXISTINGZIP*/ - TRYFREE(zi); - return NULL; - } - else - { - *zi = ziinit; - return (zipFile)zi; - } -} - -extern zipFile ZEXPORT zipOpen (pathname, append) - const char *pathname; - int append; -{ - return zipOpen2(pathname,append,NULL,NULL); -} - -extern int ZEXPORT zipOpenNewFileInZip3 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw, - windowBits, memLevel, strategy, - password, crcForCrypting) - zipFile file; - const char* filename; - const zip_fileinfo* zipfi; - const void* extrafield_local; - uInt size_extrafield_local; - const void* extrafield_global; - uInt size_extrafield_global; - const char* comment; - int method; - int level; - int raw; - int windowBits; - int memLevel; - int strategy; - const char* password; - uLong crcForCrypting; -{ - zip_internal* zi; - uInt size_filename; - uInt size_comment; - uInt i; - int err = ZIP_OK; - -# ifdef NOCRYPT - if (password != NULL) - return ZIP_PARAMERROR; -# endif - - if (file == NULL) - return ZIP_PARAMERROR; - if ((method!=0) && (method!=Z_DEFLATED)) - return ZIP_PARAMERROR; - - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 1) - { - err = zipCloseFileInZip (file); - if (err != ZIP_OK) - return err; - } - - - if (filename==NULL) - filename="-"; - - if (comment==NULL) - size_comment = 0; - else - size_comment = (uInt)strlen(comment); - - size_filename = (uInt)strlen(filename); - - if (zipfi == NULL) - zi->ci.dosDate = 0; - else - { - if (zipfi->dosDate != 0) - zi->ci.dosDate = zipfi->dosDate; - else zi->ci.dosDate = ziplocal_TmzDateToDosDate(&zipfi->tmz_date,zipfi->dosDate); - } - - zi->ci.flag = 0; - if ((level==8) || (level==9)) - zi->ci.flag |= 2; - if ((level==2)) - zi->ci.flag |= 4; - if ((level==1)) - zi->ci.flag |= 6; - if (password != NULL) - zi->ci.flag |= 1; - - zi->ci.crc32 = 0; - zi->ci.method = method; - zi->ci.encrypt = 0; - zi->ci.stream_initialised = 0; - zi->ci.pos_in_buffered_data = 0; - zi->ci.raw = raw; - zi->ci.pos_local_header = ZTELL(zi->z_filefunc,zi->filestream) ; - zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + - size_extrafield_global + size_comment; - zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader); - - ziplocal_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4); - /* version info */ - ziplocal_putValue_inmemory(zi->ci.central_header+4,(uLong)VERSIONMADEBY,2); - ziplocal_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2); - ziplocal_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2); - ziplocal_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2); - ziplocal_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4); - ziplocal_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/ - ziplocal_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/ - ziplocal_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/ - ziplocal_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2); - ziplocal_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2); - ziplocal_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2); - ziplocal_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/ - - if (zipfi==NULL) - ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2); - else - ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2); - - if (zipfi==NULL) - ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4); - else - ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4); - - ziplocal_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header- zi->add_position_when_writting_offset,4); - - for (i=0;ici.central_header+SIZECENTRALHEADER+i) = *(filename+i); - - for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+i) = - *(((const char*)extrafield_global)+i); - - for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+ - size_extrafield_global+i) = *(comment+i); - if (zi->ci.central_header == NULL) - return ZIP_INTERNALERROR; - - /* write the local header */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC,4); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)20,2);/* version needed to extract */ - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */ - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */ - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */ - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2); - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield_local,2); - - if ((err==ZIP_OK) && (size_filename>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename) - err = ZIP_ERRNO; - - if ((err==ZIP_OK) && (size_extrafield_local>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream,extrafield_local,size_extrafield_local) - !=size_extrafield_local) - err = ZIP_ERRNO; - - zi->ci.stream.avail_in = (uInt)0; - zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; - zi->ci.stream.next_out = zi->ci.buffered_data; - zi->ci.stream.total_in = 0; - zi->ci.stream.total_out = 0; - - if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - { - zi->ci.stream.zalloc = (alloc_func)0; - zi->ci.stream.zfree = (free_func)0; - zi->ci.stream.opaque = (voidpf)0; - - if (windowBits>0) - windowBits = -windowBits; - - err = deflateInit2(&zi->ci.stream, level, - Z_DEFLATED, windowBits, memLevel, strategy); - - if (err==Z_OK) - zi->ci.stream_initialised = 1; - } -# ifndef NOCRYPT - zi->ci.crypt_header_size = 0; - if ((err==Z_OK) && (password != NULL)) - { - unsigned char bufHead[RAND_HEAD_LEN]; - unsigned int sizeHead; - zi->ci.encrypt = 1; - zi->ci.pcrc_32_tab = get_crc_table(); - /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/ - - sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting); - zi->ci.crypt_header_size = sizeHead; - - if (ZWRITE(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead) - err = ZIP_ERRNO; - } -# endif - - if (err==Z_OK) - zi->in_opened_file_inzip = 1; - return err; -} - -extern int ZEXPORT zipOpenNewFileInZip2(file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw) - zipFile file; - const char* filename; - const zip_fileinfo* zipfi; - const void* extrafield_local; - uInt size_extrafield_local; - const void* extrafield_global; - uInt size_extrafield_global; - const char* comment; - int method; - int level; - int raw; -{ - return zipOpenNewFileInZip3 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, raw, - -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, - NULL, 0); -} - -extern int ZEXPORT zipOpenNewFileInZip (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level) - zipFile file; - const char* filename; - const zip_fileinfo* zipfi; - const void* extrafield_local; - uInt size_extrafield_local; - const void* extrafield_global; - uInt size_extrafield_global; - const char* comment; - int method; - int level; -{ - return zipOpenNewFileInZip2 (file, filename, zipfi, - extrafield_local, size_extrafield_local, - extrafield_global, size_extrafield_global, - comment, method, level, 0); -} - -local int zipFlushWriteBuffer(zi) - zip_internal* zi; -{ - int err=ZIP_OK; - - if (zi->ci.encrypt != 0) - { -#ifndef NOCRYPT - uInt i; - int t; - for (i=0;ici.pos_in_buffered_data;i++) - zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, - zi->ci.buffered_data[i],t); -#endif - } - if (ZWRITE(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) - !=zi->ci.pos_in_buffered_data) - err = ZIP_ERRNO; - zi->ci.pos_in_buffered_data = 0; - return err; -} - -extern int ZEXPORT zipWriteInFileInZip (file, buf, len) - zipFile file; - const void* buf; - unsigned len; -{ - zip_internal* zi; - int err=ZIP_OK; - - if (file == NULL) - return ZIP_PARAMERROR; - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 0) - return ZIP_PARAMERROR; - - zi->ci.stream.next_in = (void*)buf; - zi->ci.stream.avail_in = len; - zi->ci.crc32 = crc32(zi->ci.crc32,buf,len); - - while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) - { - if (zi->ci.stream.avail_out == 0) - { - if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) - err = ZIP_ERRNO; - zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; - zi->ci.stream.next_out = zi->ci.buffered_data; - } - - - if(err != ZIP_OK) - break; - - if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - { - uLong uTotalOutBefore = zi->ci.stream.total_out; - err=deflate(&zi->ci.stream, Z_NO_FLUSH); - zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; - - } - else - { - uInt copy_this,i; - if (zi->ci.stream.avail_in < zi->ci.stream.avail_out) - copy_this = zi->ci.stream.avail_in; - else - copy_this = zi->ci.stream.avail_out; - for (i=0;ici.stream.next_out)+i) = - *(((const char*)zi->ci.stream.next_in)+i); - { - zi->ci.stream.avail_in -= copy_this; - zi->ci.stream.avail_out-= copy_this; - zi->ci.stream.next_in+= copy_this; - zi->ci.stream.next_out+= copy_this; - zi->ci.stream.total_in+= copy_this; - zi->ci.stream.total_out+= copy_this; - zi->ci.pos_in_buffered_data += copy_this; - } - } - } - - return err; -} - -extern int ZEXPORT zipCloseFileInZipRaw (file, uncompressed_size, crc32) - zipFile file; - uLong uncompressed_size; - uLong crc32; -{ - zip_internal* zi; - uLong compressed_size; - int err=ZIP_OK; - - if (file == NULL) - return ZIP_PARAMERROR; - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 0) - return ZIP_PARAMERROR; - zi->ci.stream.avail_in = 0; - - if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - while (err==ZIP_OK) - { - uLong uTotalOutBefore; - if (zi->ci.stream.avail_out == 0) - { - if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) - err = ZIP_ERRNO; - zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; - zi->ci.stream.next_out = zi->ci.buffered_data; - } - uTotalOutBefore = zi->ci.stream.total_out; - err=deflate(&zi->ci.stream, Z_FINISH); - zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; - } - - if (err==Z_STREAM_END) - err=ZIP_OK; /* this is normal */ - - if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK)) - if (zipFlushWriteBuffer(zi)==ZIP_ERRNO) - err = ZIP_ERRNO; - - if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) - { - err=deflateEnd(&zi->ci.stream); - zi->ci.stream_initialised = 0; - } - - if (!zi->ci.raw) - { - crc32 = (uLong)zi->ci.crc32; - uncompressed_size = (uLong)zi->ci.stream.total_in; - } - compressed_size = (uLong)zi->ci.stream.total_out; -# ifndef NOCRYPT - compressed_size += zi->ci.crypt_header_size; -# endif - - ziplocal_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/ - ziplocal_putValue_inmemory(zi->ci.central_header+20, - compressed_size,4); /*compr size*/ - if (zi->ci.stream.data_type == Z_ASCII) - ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2); - ziplocal_putValue_inmemory(zi->ci.central_header+24, - uncompressed_size,4); /*uncompr size*/ - - if (err==ZIP_OK) - err = add_data_in_datablock(&zi->central_dir,zi->ci.central_header, - (uLong)zi->ci.size_centralheader); - free(zi->ci.central_header); - - if (err==ZIP_OK) - { - long cur_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); - if (ZSEEK(zi->z_filefunc,zi->filestream, - zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0) - err = ZIP_ERRNO; - - if (err==ZIP_OK) - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ - - if (err==ZIP_OK) /* compressed size, unknown */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4); - - if (err==ZIP_OK) /* uncompressed size, unknown */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4); - - if (ZSEEK(zi->z_filefunc,zi->filestream, - cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0) - err = ZIP_ERRNO; - } - - zi->number_entry ++; - zi->in_opened_file_inzip = 0; - - return err; -} - -extern int ZEXPORT zipCloseFileInZip (file) - zipFile file; -{ - return zipCloseFileInZipRaw (file,0,0); -} - -extern int ZEXPORT zipClose (file, global_comment) - zipFile file; - const char* global_comment; -{ - zip_internal* zi; - int err = 0; - uLong size_centraldir = 0; - uLong centraldir_pos_inzip; - uInt size_global_comment; - if (file == NULL) - return ZIP_PARAMERROR; - zi = (zip_internal*)file; - - if (zi->in_opened_file_inzip == 1) - { - err = zipCloseFileInZip (file); - } - -#ifndef NO_ADDFILEINEXISTINGZIP - if (global_comment==NULL) - global_comment = zi->globalcomment; -#endif - if (global_comment==NULL) - size_global_comment = 0; - else - size_global_comment = (uInt)strlen(global_comment); - - centraldir_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); - if (err==ZIP_OK) - { - linkedlist_datablock_internal* ldi = zi->central_dir.first_block ; - while (ldi!=NULL) - { - if ((err==ZIP_OK) && (ldi->filled_in_this_block>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream, - ldi->data,ldi->filled_in_this_block) - !=ldi->filled_in_this_block ) - err = ZIP_ERRNO; - - size_centraldir += ldi->filled_in_this_block; - ldi = ldi->next_datablock; - } - } - free_datablock(zi->central_dir.first_block); - - if (err==ZIP_OK) /* Magic End */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4); - - if (err==ZIP_OK) /* number of this disk */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); - - if (err==ZIP_OK) /* number of the disk with the start of the central directory */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); - - if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); - - if (err==ZIP_OK) /* total number of entries in the central dir */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); - - if (err==ZIP_OK) /* size of the central directory */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4); - - if (err==ZIP_OK) /* offset of start of central directory with respect to the - starting disk number */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream, - (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); - - if (err==ZIP_OK) /* zipfile comment length */ - err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2); - - if ((err==ZIP_OK) && (size_global_comment>0)) - if (ZWRITE(zi->z_filefunc,zi->filestream, - global_comment,size_global_comment) != size_global_comment) - err = ZIP_ERRNO; - - if (ZCLOSE(zi->z_filefunc,zi->filestream) != 0) - if (err == ZIP_OK) - err = ZIP_ERRNO; - -#ifndef NO_ADDFILEINEXISTINGZIP - TRYFREE(zi->globalcomment); -#endif - TRYFREE(zi); - - return err; -} +/* zip.c -- IO on .zip files using zlib + Version 1.01e, February 12th, 2005 + + 27 Dec 2004 Rolf Kalbermatter + Modification to zipOpen2 to support globalComment retrieval. + + Copyright (C) 1998-2005 Gilles Vollant + + Read zip.h for more info +*/ + + +#include +#include +#include +#include +#include "zlib.h" +#include "zip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +#ifndef VERSIONMADEBY +# define VERSIONMADEBY (0x0) /* platform depedent */ +#endif + +#ifndef Z_BUFSIZE +#define Z_BUFSIZE (16384) +#endif + +#ifndef Z_MAXFILENAMEINZIP +#define Z_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +/* +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) +*/ + +/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ + +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif + +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + +#ifndef DEF_MEM_LEVEL +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +#endif +const char zip_copyright[] = + " zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + + +#define SIZEDATA_INDATABLOCK (4096-(4*4)) + +#define LOCALHEADERMAGIC (0x04034b50) +#define CENTRALHEADERMAGIC (0x02014b50) +#define ENDHEADERMAGIC (0x06054b50) + +#define FLAG_LOCALHEADER_OFFSET (0x06) +#define CRC_LOCALHEADER_OFFSET (0x0e) + +#define SIZECENTRALHEADER (0x2e) /* 46 */ + +typedef struct linkedlist_datablock_internal_s +{ + struct linkedlist_datablock_internal_s* next_datablock; + uLong avail_in_this_block; + uLong filled_in_this_block; + uLong unused; /* for future use and alignement */ + unsigned char data[SIZEDATA_INDATABLOCK]; +} linkedlist_datablock_internal; + +typedef struct linkedlist_data_s +{ + linkedlist_datablock_internal* first_block; + linkedlist_datablock_internal* last_block; +} linkedlist_data; + + +typedef struct +{ + z_stream stream; /* zLib stream structure for inflate */ + int stream_initialised; /* 1 is stream is initialised */ + uInt pos_in_buffered_data; /* last written byte in buffered_data */ + + uLong pos_local_header; /* offset of the local header of the file + currenty writing */ + char* central_header; /* central header data for the current file */ + uLong size_centralheader; /* size of the central header for cur file */ + uLong flag; /* flag of the file currently writing */ + + int method; /* compression method of file currenty wr.*/ + int raw; /* 1 for directly writing raw data */ + Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ + uLong dosDate; + uLong crc32; + int encrypt; +#ifndef NOCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; + int crypt_header_size; +#endif +} curfile_info; + +typedef struct +{ + zlib_filefunc_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + linkedlist_data central_dir;/* datablock with central dir in construction*/ + int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/ + curfile_info ci; /* info on the file curretly writing */ + + uLong begin_pos; /* position of the beginning of the zipfile */ + uLong add_position_when_writting_offset; + uLong number_entry; +#ifndef NO_ADDFILEINEXISTINGZIP + char *globalcomment; +#endif +} zip_internal; + + + +#ifndef NOCRYPT +#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED +#include "crypt.h" +#endif + +local linkedlist_datablock_internal* allocate_new_datablock() +{ + linkedlist_datablock_internal* ldi; + ldi = (linkedlist_datablock_internal*) + ALLOC(sizeof(linkedlist_datablock_internal)); + if (ldi!=NULL) + { + ldi->next_datablock = NULL ; + ldi->filled_in_this_block = 0 ; + ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ; + } + return ldi; +} + +local void free_datablock(ldi) + linkedlist_datablock_internal* ldi; +{ + while (ldi!=NULL) + { + linkedlist_datablock_internal* ldinext = ldi->next_datablock; + TRYFREE(ldi); + ldi = ldinext; + } +} + +local void init_linkedlist(ll) + linkedlist_data* ll; +{ + ll->first_block = ll->last_block = NULL; +} + +local void free_linkedlist(ll) + linkedlist_data* ll; +{ + free_datablock(ll->first_block); + ll->first_block = ll->last_block = NULL; +} + + +local int add_data_in_datablock(ll,buf,len) + linkedlist_data* ll; + const void* buf; + uLong len; +{ + linkedlist_datablock_internal* ldi; + const unsigned char* from_copy; + + if (ll==NULL) + return ZIP_INTERNALERROR; + + if (ll->last_block == NULL) + { + ll->first_block = ll->last_block = allocate_new_datablock(); + if (ll->first_block == NULL) + return ZIP_INTERNALERROR; + } + + ldi = ll->last_block; + from_copy = (unsigned char*)buf; + + while (len>0) + { + uInt copy_this; + uInt i; + unsigned char* to_copy; + + if (ldi->avail_in_this_block==0) + { + ldi->next_datablock = allocate_new_datablock(); + if (ldi->next_datablock == NULL) + return ZIP_INTERNALERROR; + ldi = ldi->next_datablock ; + ll->last_block = ldi; + } + + if (ldi->avail_in_this_block < len) + copy_this = (uInt)ldi->avail_in_this_block; + else + copy_this = (uInt)len; + + to_copy = &(ldi->data[ldi->filled_in_this_block]); + + for (i=0;ifilled_in_this_block += copy_this; + ldi->avail_in_this_block -= copy_this; + from_copy += copy_this ; + len -= copy_this; + } + return ZIP_OK; +} + + + +/****************************************************************************/ + +#ifndef NO_ADDFILEINEXISTINGZIP +/* =========================================================================== + Inputs a long in LSB order to the given file + nbByte == 1, 2 or 4 (byte, short or long) +*/ + +local int ziplocal_putValue OF((const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, uLong x, int nbByte)); +local int ziplocal_putValue (pzlib_filefunc_def, filestream, x, nbByte) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong x; + int nbByte; +{ + unsigned char buf[4]; + int n; + for (n = 0; n < nbByte; n++) + { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + if (x != 0) + { /* data overflow - hack for ZIP64 (X Roche) */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } + + if (ZWRITE(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) + return ZIP_ERRNO; + else + return ZIP_OK; +} + +local void ziplocal_putValue_inmemory OF((void* dest, uLong x, int nbByte)); +local void ziplocal_putValue_inmemory (dest, x, nbByte) + void* dest; + uLong x; + int nbByte; +{ + unsigned char* buf=(unsigned char*)dest; + int n; + for (n = 0; n < nbByte; n++) { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + + if (x != 0) + { /* data overflow - hack for ZIP64 */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } +} + +/****************************************************************************/ + + +local uLong ziplocal_TmzDateToDosDate(ptm,dosDate) + const tm_zip* ptm; + uLong dosDate; +{ + uLong year = (uLong)ptm->tm_year; + if (year>1980) + year-=1980; + else if (year>80) + year-=80; + return + (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | + ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); +} + + +/****************************************************************************/ + +local int ziplocal_getByte OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + int *pi)); + +local int ziplocal_getByte(pzlib_filefunc_def,filestream,pi) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + int *pi; +{ + unsigned char c; + int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return ZIP_OK; + } + else + { + if (ZERROR(*pzlib_filefunc_def,filestream)) + return ZIP_ERRNO; + else + return ZIP_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int ziplocal_getShort OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int ziplocal_getShort (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int ziplocal_getLong OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int ziplocal_getLong (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<16; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local uLong ziplocal_SearchCentralDir OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream)); + +local uLong ziplocal_SearchCentralDir(pzlib_filefunc_def,filestream) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; +{ + unsigned char* buf; + uLong uSizeFile; + uLong uBackRead; + uLong uMaxBack=0xffff; /* maximum size of global comment */ + uLong uPosFound=0; + + if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); + if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} +#endif /* !NO_ADDFILEINEXISTINGZIP*/ + +/************************************************************/ +extern zipFile ZEXPORT zipOpen2 (pathname, append, globalcomment, pzlib_filefunc_def) + const char *pathname; + int append; + zipcharpc* globalcomment; + zlib_filefunc_def* pzlib_filefunc_def; +{ + zip_internal ziinit; + zip_internal* zi; + int err=ZIP_OK; + + + if (pzlib_filefunc_def==NULL) + fill_fopen_filefunc(&ziinit.z_filefunc); + else + ziinit.z_filefunc = *pzlib_filefunc_def; + + ziinit.filestream = (*(ziinit.z_filefunc.zopen_file)) + (ziinit.z_filefunc.opaque, + pathname, + (append == APPEND_STATUS_CREATE) ? + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) : + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING)); + + if (ziinit.filestream == NULL) + return NULL; + ziinit.begin_pos = ZTELL(ziinit.z_filefunc,ziinit.filestream); + ziinit.in_opened_file_inzip = 0; + ziinit.ci.stream_initialised = 0; + ziinit.number_entry = 0; + ziinit.add_position_when_writting_offset = 0; + init_linkedlist(&(ziinit.central_dir)); + + + zi = (zip_internal*)ALLOC(sizeof(zip_internal)); + if (zi==NULL) + { + ZCLOSE(ziinit.z_filefunc,ziinit.filestream); + return NULL; + } + + /* now we add file in a zipfile */ +# ifndef NO_ADDFILEINEXISTINGZIP + ziinit.globalcomment = NULL; + if (append == APPEND_STATUS_ADDINZIP) + { + uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + + uLong size_central_dir; /* size of the central directory */ + uLong offset_central_dir; /* offset of start of central directory */ + uLong central_pos,uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + uLong number_entry; + uLong number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + uLong size_comment; + + central_pos = ziplocal_SearchCentralDir(&ziinit.z_filefunc,ziinit.filestream); + if (central_pos==0) + err=ZIP_ERRNO; + + if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=ZIP_ERRNO; + + /* the signature, already checked */ + if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&uL)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of this disk */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of the disk with the start of the central directory */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk_with_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central dir */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + if ((number_entry_CD!=number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=ZIP_BADZIPFILE; + + /* size of the central directory */ + if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&size_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&offset_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + /* zipfile global comment length */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&size_comment)!=ZIP_OK) + err=ZIP_ERRNO; + + if ((central_pos0) + { + ziinit.globalcomment = ALLOC(size_comment+1); + if (ziinit.globalcomment) + { + size_comment = ZREAD(ziinit.z_filefunc, ziinit.filestream,ziinit.globalcomment,size_comment); + ziinit.globalcomment[size_comment]=0; + } + } + + byte_before_the_zipfile = central_pos - + (offset_central_dir+size_central_dir); + ziinit.add_position_when_writting_offset = byte_before_the_zipfile; + + { + uLong size_central_dir_to_read = size_central_dir; + size_t buf_size = SIZEDATA_INDATABLOCK; + void* buf_read = (void*)ALLOC(buf_size); + if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, + offset_central_dir + byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + while ((size_central_dir_to_read>0) && (err==ZIP_OK)) + { + uLong read_this = SIZEDATA_INDATABLOCK; + if (read_this > size_central_dir_to_read) + read_this = size_central_dir_to_read; + if (ZREAD(ziinit.z_filefunc, ziinit.filestream,buf_read,read_this) != read_this) + err=ZIP_ERRNO; + + if (err==ZIP_OK) + err = add_data_in_datablock(&ziinit.central_dir,buf_read, + (uLong)read_this); + size_central_dir_to_read-=read_this; + } + TRYFREE(buf_read); + } + ziinit.begin_pos = byte_before_the_zipfile; + ziinit.number_entry = number_entry_CD; + + if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, + offset_central_dir+byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=ZIP_ERRNO; + } + + if (globalcomment) + { + *globalcomment = ziinit.globalcomment; + } +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + + if (err != ZIP_OK) + { +# ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(ziinit.globalcomment); +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + TRYFREE(zi); + return NULL; + } + else + { + *zi = ziinit; + return (zipFile)zi; + } +} + +extern zipFile ZEXPORT zipOpen (pathname, append) + const char *pathname; + int append; +{ + return zipOpen2(pathname,append,NULL,NULL); +} + +extern int ZEXPORT zipOpenNewFileInZip3 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting) + zipFile file; + const char* filename; + const zip_fileinfo* zipfi; + const void* extrafield_local; + uInt size_extrafield_local; + const void* extrafield_global; + uInt size_extrafield_global; + const char* comment; + int method; + int level; + int raw; + int windowBits; + int memLevel; + int strategy; + const char* password; + uLong crcForCrypting; +{ + zip_internal* zi; + uInt size_filename; + uInt size_comment; + uInt i; + int err = ZIP_OK; + +# ifdef NOCRYPT + if (password != NULL) + return ZIP_PARAMERROR; +# endif + + if (file == NULL) + return ZIP_PARAMERROR; + if ((method!=0) && (method!=Z_DEFLATED)) + return ZIP_PARAMERROR; + + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + if (err != ZIP_OK) + return err; + } + + + if (filename==NULL) + filename="-"; + + if (comment==NULL) + size_comment = 0; + else + size_comment = (uInt)strlen(comment); + + size_filename = (uInt)strlen(filename); + + if (zipfi == NULL) + zi->ci.dosDate = 0; + else + { + if (zipfi->dosDate != 0) + zi->ci.dosDate = zipfi->dosDate; + else zi->ci.dosDate = ziplocal_TmzDateToDosDate(&zipfi->tmz_date,zipfi->dosDate); + } + + zi->ci.flag = 0; + if ((level==8) || (level==9)) + zi->ci.flag |= 2; + if ((level==2)) + zi->ci.flag |= 4; + if ((level==1)) + zi->ci.flag |= 6; + if (password != NULL) + zi->ci.flag |= 1; + + zi->ci.crc32 = 0; + zi->ci.method = method; + zi->ci.encrypt = 0; + zi->ci.stream_initialised = 0; + zi->ci.pos_in_buffered_data = 0; + zi->ci.raw = raw; + zi->ci.pos_local_header = ZTELL(zi->z_filefunc,zi->filestream) ; + zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + + size_extrafield_global + size_comment; + zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader); + + ziplocal_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4); + /* version info */ + ziplocal_putValue_inmemory(zi->ci.central_header+4,(uLong)VERSIONMADEBY,2); + ziplocal_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2); + ziplocal_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2); + ziplocal_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2); + ziplocal_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4); + ziplocal_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/ + ziplocal_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/ + ziplocal_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/ + ziplocal_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2); + ziplocal_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2); + ziplocal_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2); + ziplocal_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/ + + if (zipfi==NULL) + ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2); + else + ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2); + + if (zipfi==NULL) + ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4); + else + ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4); + + ziplocal_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header- zi->add_position_when_writting_offset,4); + + for (i=0;ici.central_header+SIZECENTRALHEADER+i) = *(filename+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+i) = + *(((const char*)extrafield_global)+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+ + size_extrafield_global+i) = *(comment+i); + if (zi->ci.central_header == NULL) + return ZIP_INTERNALERROR; + + /* write the local header */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC,4); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)20,2);/* version needed to extract */ + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */ + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */ + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */ + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield_local,2); + + if ((err==ZIP_OK) && (size_filename>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename) + err = ZIP_ERRNO; + + if ((err==ZIP_OK) && (size_extrafield_local>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream,extrafield_local,size_extrafield_local) + !=size_extrafield_local) + err = ZIP_ERRNO; + + zi->ci.stream.avail_in = (uInt)0; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + zi->ci.stream.total_in = 0; + zi->ci.stream.total_out = 0; + + if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + zi->ci.stream.zalloc = (alloc_func)0; + zi->ci.stream.zfree = (free_func)0; + zi->ci.stream.opaque = (voidpf)0; + + if (windowBits>0) + windowBits = -windowBits; + + err = deflateInit2(&zi->ci.stream, level, + Z_DEFLATED, windowBits, memLevel, strategy); + + if (err==Z_OK) + zi->ci.stream_initialised = 1; + } +# ifndef NOCRYPT + zi->ci.crypt_header_size = 0; + if ((err==Z_OK) && (password != NULL)) + { + unsigned char bufHead[RAND_HEAD_LEN]; + unsigned int sizeHead; + zi->ci.encrypt = 1; + zi->ci.pcrc_32_tab = get_crc_table(); + /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/ + + sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting); + zi->ci.crypt_header_size = sizeHead; + + if (ZWRITE(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead) + err = ZIP_ERRNO; + } +# endif + + if (err==Z_OK) + zi->in_opened_file_inzip = 1; + return err; +} + +extern int ZEXPORT zipOpenNewFileInZip2(file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw) + zipFile file; + const char* filename; + const zip_fileinfo* zipfi; + const void* extrafield_local; + uInt size_extrafield_local; + const void* extrafield_global; + uInt size_extrafield_global; + const char* comment; + int method; + int level; + int raw; +{ + return zipOpenNewFileInZip3 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level) + zipFile file; + const char* filename; + const zip_fileinfo* zipfi; + const void* extrafield_local; + uInt size_extrafield_local; + const void* extrafield_global; + uInt size_extrafield_global; + const char* comment; + int method; + int level; +{ + return zipOpenNewFileInZip2 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, 0); +} + +local int zipFlushWriteBuffer(zi) + zip_internal* zi; +{ + int err=ZIP_OK; + + if (zi->ci.encrypt != 0) + { +#ifndef NOCRYPT + uInt i; + int t; + for (i=0;ici.pos_in_buffered_data;i++) + zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, + zi->ci.buffered_data[i],t); +#endif + } + if (ZWRITE(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) + !=zi->ci.pos_in_buffered_data) + err = ZIP_ERRNO; + zi->ci.pos_in_buffered_data = 0; + return err; +} + +extern int ZEXPORT zipWriteInFileInZip (file, buf, len) + zipFile file; + const void* buf; + unsigned len; +{ + zip_internal* zi; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + + zi->ci.stream.next_in = (void*)buf; + zi->ci.stream.avail_in = len; + zi->ci.crc32 = crc32(zi->ci.crc32,buf,len); + + while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) + { + if (zi->ci.stream.avail_out == 0) + { + if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + + + if(err != ZIP_OK) + break; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + uLong uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_NO_FLUSH); + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + + } + else + { + uInt copy_this,i; + if (zi->ci.stream.avail_in < zi->ci.stream.avail_out) + copy_this = zi->ci.stream.avail_in; + else + copy_this = zi->ci.stream.avail_out; + for (i=0;ici.stream.next_out)+i) = + *(((const char*)zi->ci.stream.next_in)+i); + { + zi->ci.stream.avail_in -= copy_this; + zi->ci.stream.avail_out-= copy_this; + zi->ci.stream.next_in+= copy_this; + zi->ci.stream.next_out+= copy_this; + zi->ci.stream.total_in+= copy_this; + zi->ci.stream.total_out+= copy_this; + zi->ci.pos_in_buffered_data += copy_this; + } + } + } + + return err; +} + +extern int ZEXPORT zipCloseFileInZipRaw (file, uncompressed_size, crc32) + zipFile file; + uLong uncompressed_size; + uLong crc32; +{ + zip_internal* zi; + uLong compressed_size; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + zi->ci.stream.avail_in = 0; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + while (err==ZIP_OK) + { + uLong uTotalOutBefore; + if (zi->ci.stream.avail_out == 0) + { + if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_FINISH); + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + } + + if (err==Z_STREAM_END) + err=ZIP_OK; /* this is normal */ + + if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK)) + if (zipFlushWriteBuffer(zi)==ZIP_ERRNO) + err = ZIP_ERRNO; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + err=deflateEnd(&zi->ci.stream); + zi->ci.stream_initialised = 0; + } + + if (!zi->ci.raw) + { + crc32 = (uLong)zi->ci.crc32; + uncompressed_size = (uLong)zi->ci.stream.total_in; + } + compressed_size = (uLong)zi->ci.stream.total_out; +# ifndef NOCRYPT + compressed_size += zi->ci.crypt_header_size; +# endif + + ziplocal_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/ + ziplocal_putValue_inmemory(zi->ci.central_header+20, + compressed_size,4); /*compr size*/ + if (zi->ci.stream.data_type == Z_ASCII) + ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2); + ziplocal_putValue_inmemory(zi->ci.central_header+24, + uncompressed_size,4); /*uncompr size*/ + + if (err==ZIP_OK) + err = add_data_in_datablock(&zi->central_dir,zi->ci.central_header, + (uLong)zi->ci.size_centralheader); + free(zi->ci.central_header); + + if (err==ZIP_OK) + { + long cur_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); + if (ZSEEK(zi->z_filefunc,zi->filestream, + zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ + + if (err==ZIP_OK) /* compressed size, unknown */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4); + + if (err==ZIP_OK) /* uncompressed size, unknown */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4); + + if (ZSEEK(zi->z_filefunc,zi->filestream, + cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + } + + zi->number_entry ++; + zi->in_opened_file_inzip = 0; + + return err; +} + +extern int ZEXPORT zipCloseFileInZip (file) + zipFile file; +{ + return zipCloseFileInZipRaw (file,0,0); +} + +extern int ZEXPORT zipClose (file, global_comment) + zipFile file; + const char* global_comment; +{ + zip_internal* zi; + int err = 0; + uLong size_centraldir = 0; + uLong centraldir_pos_inzip; + uInt size_global_comment; + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + } + +#ifndef NO_ADDFILEINEXISTINGZIP + if (global_comment==NULL) + global_comment = zi->globalcomment; +#endif + if (global_comment==NULL) + size_global_comment = 0; + else + size_global_comment = (uInt)strlen(global_comment); + + centraldir_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); + if (err==ZIP_OK) + { + linkedlist_datablock_internal* ldi = zi->central_dir.first_block ; + while (ldi!=NULL) + { + if ((err==ZIP_OK) && (ldi->filled_in_this_block>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream, + ldi->data,ldi->filled_in_this_block) + !=ldi->filled_in_this_block ) + err = ZIP_ERRNO; + + size_centraldir += ldi->filled_in_this_block; + ldi = ldi->next_datablock; + } + } + free_datablock(zi->central_dir.first_block); + + if (err==ZIP_OK) /* Magic End */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4); + + if (err==ZIP_OK) /* number of this disk */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + + if (err==ZIP_OK) /* total number of entries in the central dir */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + + if (err==ZIP_OK) /* size of the central directory */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4); + + if (err==ZIP_OK) /* offset of start of central directory with respect to the + starting disk number */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream, + (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); + + if (err==ZIP_OK) /* zipfile comment length */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2); + + if ((err==ZIP_OK) && (size_global_comment>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream, + global_comment,size_global_comment) != size_global_comment) + err = ZIP_ERRNO; + + if (ZCLOSE(zi->z_filefunc,zi->filestream) != 0) + if (err == ZIP_OK) + err = ZIP_ERRNO; + +#ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(zi->globalcomment); +#endif + TRYFREE(zi); + + return err; +} diff --git a/JGE/src/unzip/zip.h b/JGE/src/unzip/zip.h index cd38b670f..acacce83b 100644 --- a/JGE/src/unzip/zip.h +++ b/JGE/src/unzip/zip.h @@ -1,235 +1,235 @@ -/* zip.h -- IO for compress .zip files using zlib - Version 1.01e, February 12th, 2005 - - Copyright (C) 1998-2005 Gilles Vollant - - This unzip package allow creates .ZIP file, compatible with PKZip 2.04g - WinZip, InfoZip tools and compatible. - Multi volume ZipFile (span) are not supported. - Encryption compatible with pkzip 2.04g only supported - Old compressions used by old PKZip 1.x are not supported - - For uncompress .zip file, look at unzip.h - - - I WAIT FEEDBACK at mail info@winimage.com - Visit also http://www.winimage.com/zLibDll/unzip.html for evolution - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - -*/ - -/* for more info about .ZIP format, see - http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip - http://www.info-zip.org/pub/infozip/doc/ - PkWare has also a specification at : - ftp://ftp.pkware.com/probdesc.zip -*/ - -#ifndef _zip_H -#define _zip_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagzipFile__ { int unused; } zipFile__; -typedef zipFile__ *zipFile; -#else -typedef voidp zipFile; -#endif - -#define ZIP_OK (0) -#define ZIP_EOF (0) -#define ZIP_ERRNO (Z_ERRNO) -#define ZIP_PARAMERROR (-102) -#define ZIP_BADZIPFILE (-103) -#define ZIP_INTERNALERROR (-104) - -#ifndef DEF_MEM_LEVEL -# if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -# else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -# endif -#endif -/* default memLevel */ - -/* tm_zip contain date/time info */ -typedef struct tm_zip_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_zip; - -typedef struct -{ - tm_zip tmz_date; /* date in understandable format */ - uLong dosDate; /* if dos_date == 0, tmu_date is used */ -/* uLong flag; */ /* general purpose bit flag 2 bytes */ - - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ -} zip_fileinfo; - -typedef const char* zipcharpc; - - -#define APPEND_STATUS_CREATE (0) -#define APPEND_STATUS_CREATEAFTER (1) -#define APPEND_STATUS_ADDINZIP (2) - -extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); -/* - Create a zipfile. - pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on - an Unix computer "zlib/zlib113.zip". - if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip - will be created at the end of the file. - (useful if the file contain a self extractor code) - if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will - add files in existing zip (be sure you don't add file that doesn't exist) - If the zipfile cannot be opened, the return value is NULL. - Else, the return value is a zipFile Handle, usable with other function - of this zip package. -*/ - -/* Note : there is no delete function into a zipfile. - If you want delete file into a zipfile, you must open a zipfile, and create another - Of couse, you can use RAW reading and writing to copy the file you did not want delte -*/ - -extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, - int append, - zipcharpc* globalcomment, - zlib_filefunc_def* pzlib_filefunc_def)); - -extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level)); -/* - Open a file in the ZIP for writing. - filename : the filename in zip (if NULL, '-' without quote will be used - *zipfi contain supplemental information - if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local - contains the extrafield data the the local header - if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global - contains the extrafield data the the local header - if comment != NULL, comment contain the comment string - method contain the compression method (0 for store, Z_DEFLATED for deflate) - level contain the level of compression (can be Z_DEFAULT_COMPRESSION) -*/ - - -extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw)); - -/* - Same than zipOpenNewFileInZip, except if raw=1, we write raw file - */ - -extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, - uInt size_extrafield_local, - const void* extrafield_global, - uInt size_extrafield_global, - const char* comment, - int method, - int level, - int raw, - int windowBits, - int memLevel, - int strategy, - const char* password, - uLong crcForCtypting)); - -/* - Same than zipOpenNewFileInZip2, except - windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 - password : crypting password (NULL for no crypting) - crcForCtypting : crc of file to compress (needed for crypting) - */ - - -extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, - const void* buf, - unsigned len)); -/* - Write data in the zipfile -*/ - -extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); -/* - Close the current file in the zipfile -*/ - -extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, - uLong uncompressed_size, - uLong crc32)); -/* - Close the current file in the zipfile, for fiel opened with - parameter raw=1 in zipOpenNewFileInZip2 - uncompressed_size and crc32 are value for the uncompressed size -*/ - -extern int ZEXPORT zipClose OF((zipFile file, - const char* global_comment)); -/* - Close the zipfile -*/ - -#ifdef __cplusplus -} -#endif - -#endif /* _zip_H */ +/* zip.h -- IO for compress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This unzip package allow creates .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + Multi volume ZipFile (span) are not supported. + Encryption compatible with pkzip 2.04g only supported + Old compressions used by old PKZip 1.x are not supported + + For uncompress .zip file, look at unzip.h + + + I WAIT FEEDBACK at mail info@winimage.com + Visit also http://www.winimage.com/zLibDll/unzip.html for evolution + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +*/ + +/* for more info about .ZIP format, see + http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip + http://www.info-zip.org/pub/infozip/doc/ + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip +*/ + +#ifndef _zip_H +#define _zip_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagzipFile__ { int unused; } zipFile__; +typedef zipFile__ *zipFile; +#else +typedef voidp zipFile; +#endif + +#define ZIP_OK (0) +#define ZIP_EOF (0) +#define ZIP_ERRNO (Z_ERRNO) +#define ZIP_PARAMERROR (-102) +#define ZIP_BADZIPFILE (-103) +#define ZIP_INTERNALERROR (-104) + +#ifndef DEF_MEM_LEVEL +# if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +# else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +# endif +#endif +/* default memLevel */ + +/* tm_zip contain date/time info */ +typedef struct tm_zip_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_zip; + +typedef struct +{ + tm_zip tmz_date; /* date in understandable format */ + uLong dosDate; /* if dos_date == 0, tmu_date is used */ +/* uLong flag; */ /* general purpose bit flag 2 bytes */ + + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ +} zip_fileinfo; + +typedef const char* zipcharpc; + + +#define APPEND_STATUS_CREATE (0) +#define APPEND_STATUS_CREATEAFTER (1) +#define APPEND_STATUS_ADDINZIP (2) + +extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); +/* + Create a zipfile. + pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on + an Unix computer "zlib/zlib113.zip". + if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip + will be created at the end of the file. + (useful if the file contain a self extractor code) + if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will + add files in existing zip (be sure you don't add file that doesn't exist) + If the zipfile cannot be opened, the return value is NULL. + Else, the return value is a zipFile Handle, usable with other function + of this zip package. +*/ + +/* Note : there is no delete function into a zipfile. + If you want delete file into a zipfile, you must open a zipfile, and create another + Of couse, you can use RAW reading and writing to copy the file you did not want delte +*/ + +extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc_def* pzlib_filefunc_def)); + +extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level)); +/* + Open a file in the ZIP for writing. + filename : the filename in zip (if NULL, '-' without quote will be used + *zipfi contain supplemental information + if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local + contains the extrafield data the the local header + if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global + contains the extrafield data the the local header + if comment != NULL, comment contain the comment string + method contain the compression method (0 for store, Z_DEFLATED for deflate) + level contain the level of compression (can be Z_DEFAULT_COMPRESSION) +*/ + + +extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw)); + +/* + Same than zipOpenNewFileInZip, except if raw=1, we write raw file + */ + +extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCtypting)); + +/* + Same than zipOpenNewFileInZip2, except + windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 + password : crypting password (NULL for no crypting) + crcForCtypting : crc of file to compress (needed for crypting) + */ + + +extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, + const void* buf, + unsigned len)); +/* + Write data in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); +/* + Close the current file in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, + uLong uncompressed_size, + uLong crc32)); +/* + Close the current file in the zipfile, for fiel opened with + parameter raw=1 in zipOpenNewFileInZip2 + uncompressed_size and crc32 are value for the uncompressed size +*/ + +extern int ZEXPORT zipClose OF((zipFile file, + const char* global_comment)); +/* + Close the zipfile +*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _zip_H */ diff --git a/JGE/src/vram.c b/JGE/src/vram.c index f90908eeb..2d8f3e104 100644 --- a/JGE/src/vram.c +++ b/JGE/src/vram.c @@ -1,275 +1,275 @@ -/* - * Helper for use with the PSP Software Development Kit - http://www.pspdev.org - * ----------------------------------------------------------------------- - * Licensed under GPL - * - * vram.c - Standard C high performance VRAM allocation routines. - * - * Copyright (c) 2007 Alexander Berl 'Raphael' - * http://wordpress.fx-world.org - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "vram.h" -#include - -// Configure the memory to be managed -#define __MEM_SIZE 0x00200000 -#define __MEM_START 0x04000000 - -// Configure the block size the memory gets subdivided into (page size) -// __MEM_SIZE/__BLOCK_SIZE may not exceed 2^15 = 32768 -// The block size also defines the alignment of allocations -// Larger block sizes perform better, because the blocktable is smaller and therefore fits better into cache -// however the overhead is also bigger and more memory is wasted -#define __BLOCK_SIZE 512 -#define __MEM_BLOCKS (__MEM_SIZE/__BLOCK_SIZE) -#define __BLOCKS(x) ((x+__BLOCK_SIZE-1)/__BLOCK_SIZE) -#define __BLOCKSIZE(x) ((x+__BLOCK_SIZE-1)&~(__BLOCK_SIZE-1)) - - -// A MEMORY BLOCK ENTRY IS MADE UP LIKE THAT: -// bit: 31 32 30 - 15 14-0 -// free block prev size -// -// bit 31: free bit, indicating if block is allocated or not -// bit 30: blocked bit, indicating if block is part of a larger block (0) - used for error resilience -// bit 30-15: block index of previous block -// bit 14- 0: size of current block -// -// This management can handle a max amount of 2^15 = 32768 blocks, which resolves to 32MB at blocksize of 1024 bytes -// -#define __BLOCK_GET_SIZE(x) ((x & 0x7FFF)) -#define __BLOCK_GET_PREV(x) ((x >> 15) & 0x7FFF) -#define __BLOCK_GET_FREE(x) ((x >> 31)) -#define __BLOCK_GET_BLOCK(x) ((x >> 30) & 0x1) -#define __BLOCK_SET_SIZE(x,y) x=((x & ~0x7FFF) | ((y) & 0x7FFF)) -#define __BLOCK_ADD_SIZE(x,y) x=((x & ~0x7FFF) | (((x & 0x7FFF)+((y) & 0x7FFF)) & 0x7FFF)) -#define __BLOCK_SET_PREV(x,y) x=((x & ~0x3FFF8000) | (((y) & 0x7FFF)<<15)) -#define __BLOCK_SET_FREE(x,y) x=((x & 0x7FFFFFFF) | (((y) & 0x1)<<31)) -#define __BLOCK_SET_BLOCK(x,y) x=((x & 0xBFFFFFFF) | (((y) & 0x1)<<30)) -#define __BLOCK_MAKE(s,p,f,n) (((f & 0x1)<<31) | ((n & 0x1)<<30) | (((p) & 0x7FFF)<<15) | ((s) & 0x7FFF)) -#define __BLOCK_GET_FREEBLOCK(x) ((x>>30) & 0x3) // returns 11b if block is a starting block and free, 10b if block is a starting block and allocated, 0xb if it is a non-starting block (don't change) -#define __BLOCK0 ((__MEM_BLOCKS) | (1<<31) | (1<<30)) - - -unsigned int __mem_blocks[__MEM_BLOCKS] = { 0 }; - - -static int __largest_update = 0; -static int __largest_block = __MEM_BLOCKS; -static int __mem_free = __MEM_BLOCKS; - - -inline void* vrelptr( void *ptr ) -{ - return (void*)((unsigned int)ptr & ~__MEM_START); -} - -inline void* vabsptr( void *ptr ) -{ - return (void*)((unsigned int)ptr | __MEM_START); -} - - -static void __find_largest_block() -{ - int i = 0; - __largest_block = 0; - while (i<__MEM_BLOCKS) - { - int csize = __BLOCK_GET_SIZE(__mem_blocks[i]); - if (__BLOCK_GET_FREEBLOCK(__mem_blocks[i])==3 && csize>__largest_block) - __largest_block = csize; - i += csize; - } - __largest_update = 0; -} - -#ifdef _DEBUG -void __memwalk() -{ - int i = 0; - if (__mem_blocks[0]==0) __mem_blocks[0] = __BLOCK0; - while (i<__MEM_BLOCKS) - { - printf("BLOCK %i:\n", i); - printf(" free: %i\n", __BLOCK_GET_FREEBLOCK(__mem_blocks[i])); - printf(" size: %i\n", __BLOCK_GET_SIZE(__mem_blocks[i])); - printf(" prev: %i\n", __BLOCK_GET_PREV(__mem_blocks[i])); - i+=__BLOCK_GET_SIZE(__mem_blocks[i]); - } -} -#endif - -void* valloc( size_t size ) -{ - // Initialize memory block, if not yet done - if (__mem_blocks[0]==0) __mem_blocks[0] = __BLOCK0; - - int i = 0; - int j = 0; - int bsize = __BLOCKS(size); - - if (__largest_update==0 && __largest_block=bsize) - { - if (csizebsize && next<__MEM_BLOCKS) - { - __mem_blocks[next] = __BLOCK_MAKE(csize-bsize,i,1,1); - int nextnext = i+csize; - if (nextnext<__MEM_BLOCKS) - { - __BLOCK_SET_PREV(__mem_blocks[nextnext], next); - } - } - - __mem_free -= bsize; - if (__largest_block==csize) // if we just allocated from one of the largest blocks - { - if ((csize-bsize)>(__mem_free/2)) - __largest_block = (csize-bsize); // there can't be another largest block - else - __largest_update = 1; - } - return ((void*)(__MEM_START + (i*__BLOCK_SIZE))); -} - - -void vfree( void* ptr ) -{ - if (ptr==0) return; - - int block = ((unsigned int)ptr - __MEM_START)/__BLOCK_SIZE; - if (block<0 || block>__MEM_BLOCKS) - { - #ifdef _DEBUG - printf("Block is out of range: %i (0x%x)\n", block, (int)ptr); - #endif - return; - } - int csize = __BLOCK_GET_SIZE(__mem_blocks[block]); - #ifdef _DEBUG - printf("freeing block %i (0x%x), size: %i\n", block, (int)ptr, csize); - #endif - - if (__BLOCK_GET_FREEBLOCK(__mem_blocks[block])!=1 || csize==0) - { - #ifdef _DEBUG - printf("Block was not allocated!\n"); - #endif - return; - } - - // Mark block as free - __BLOCK_SET_FREE(__mem_blocks[block],1); - __mem_free += csize; - - int next = block+csize; - // Merge with previous block if possible - int prev = __BLOCK_GET_PREV(__mem_blocks[block]); - if (prev + * http://wordpress.fx-world.org + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "vram.h" +#include + +// Configure the memory to be managed +#define __MEM_SIZE 0x00200000 +#define __MEM_START 0x04000000 + +// Configure the block size the memory gets subdivided into (page size) +// __MEM_SIZE/__BLOCK_SIZE may not exceed 2^15 = 32768 +// The block size also defines the alignment of allocations +// Larger block sizes perform better, because the blocktable is smaller and therefore fits better into cache +// however the overhead is also bigger and more memory is wasted +#define __BLOCK_SIZE 512 +#define __MEM_BLOCKS (__MEM_SIZE/__BLOCK_SIZE) +#define __BLOCKS(x) ((x+__BLOCK_SIZE-1)/__BLOCK_SIZE) +#define __BLOCKSIZE(x) ((x+__BLOCK_SIZE-1)&~(__BLOCK_SIZE-1)) + + +// A MEMORY BLOCK ENTRY IS MADE UP LIKE THAT: +// bit: 31 32 30 - 15 14-0 +// free block prev size +// +// bit 31: free bit, indicating if block is allocated or not +// bit 30: blocked bit, indicating if block is part of a larger block (0) - used for error resilience +// bit 30-15: block index of previous block +// bit 14- 0: size of current block +// +// This management can handle a max amount of 2^15 = 32768 blocks, which resolves to 32MB at blocksize of 1024 bytes +// +#define __BLOCK_GET_SIZE(x) ((x & 0x7FFF)) +#define __BLOCK_GET_PREV(x) ((x >> 15) & 0x7FFF) +#define __BLOCK_GET_FREE(x) ((x >> 31)) +#define __BLOCK_GET_BLOCK(x) ((x >> 30) & 0x1) +#define __BLOCK_SET_SIZE(x,y) x=((x & ~0x7FFF) | ((y) & 0x7FFF)) +#define __BLOCK_ADD_SIZE(x,y) x=((x & ~0x7FFF) | (((x & 0x7FFF)+((y) & 0x7FFF)) & 0x7FFF)) +#define __BLOCK_SET_PREV(x,y) x=((x & ~0x3FFF8000) | (((y) & 0x7FFF)<<15)) +#define __BLOCK_SET_FREE(x,y) x=((x & 0x7FFFFFFF) | (((y) & 0x1)<<31)) +#define __BLOCK_SET_BLOCK(x,y) x=((x & 0xBFFFFFFF) | (((y) & 0x1)<<30)) +#define __BLOCK_MAKE(s,p,f,n) (((f & 0x1)<<31) | ((n & 0x1)<<30) | (((p) & 0x7FFF)<<15) | ((s) & 0x7FFF)) +#define __BLOCK_GET_FREEBLOCK(x) ((x>>30) & 0x3) // returns 11b if block is a starting block and free, 10b if block is a starting block and allocated, 0xb if it is a non-starting block (don't change) +#define __BLOCK0 ((__MEM_BLOCKS) | (1<<31) | (1<<30)) + + +unsigned int __mem_blocks[__MEM_BLOCKS] = { 0 }; + + +static int __largest_update = 0; +static int __largest_block = __MEM_BLOCKS; +static int __mem_free = __MEM_BLOCKS; + + +inline void* vrelptr( void *ptr ) +{ + return (void*)((unsigned int)ptr & ~__MEM_START); +} + +inline void* vabsptr( void *ptr ) +{ + return (void*)((unsigned int)ptr | __MEM_START); +} + + +static void __find_largest_block() +{ + int i = 0; + __largest_block = 0; + while (i<__MEM_BLOCKS) + { + int csize = __BLOCK_GET_SIZE(__mem_blocks[i]); + if (__BLOCK_GET_FREEBLOCK(__mem_blocks[i])==3 && csize>__largest_block) + __largest_block = csize; + i += csize; + } + __largest_update = 0; +} + +#ifdef _DEBUG +void __memwalk() +{ + int i = 0; + if (__mem_blocks[0]==0) __mem_blocks[0] = __BLOCK0; + while (i<__MEM_BLOCKS) + { + printf("BLOCK %i:\n", i); + printf(" free: %i\n", __BLOCK_GET_FREEBLOCK(__mem_blocks[i])); + printf(" size: %i\n", __BLOCK_GET_SIZE(__mem_blocks[i])); + printf(" prev: %i\n", __BLOCK_GET_PREV(__mem_blocks[i])); + i+=__BLOCK_GET_SIZE(__mem_blocks[i]); + } +} +#endif + +void* valloc( size_t size ) +{ + // Initialize memory block, if not yet done + if (__mem_blocks[0]==0) __mem_blocks[0] = __BLOCK0; + + int i = 0; + int j = 0; + int bsize = __BLOCKS(size); + + if (__largest_update==0 && __largest_block=bsize) + { + if (csizebsize && next<__MEM_BLOCKS) + { + __mem_blocks[next] = __BLOCK_MAKE(csize-bsize,i,1,1); + int nextnext = i+csize; + if (nextnext<__MEM_BLOCKS) + { + __BLOCK_SET_PREV(__mem_blocks[nextnext], next); + } + } + + __mem_free -= bsize; + if (__largest_block==csize) // if we just allocated from one of the largest blocks + { + if ((csize-bsize)>(__mem_free/2)) + __largest_block = (csize-bsize); // there can't be another largest block + else + __largest_update = 1; + } + return ((void*)(__MEM_START + (i*__BLOCK_SIZE))); +} + + +void vfree( void* ptr ) +{ + if (ptr==0) return; + + int block = ((unsigned int)ptr - __MEM_START)/__BLOCK_SIZE; + if (block<0 || block>__MEM_BLOCKS) + { + #ifdef _DEBUG + printf("Block is out of range: %i (0x%x)\n", block, (int)ptr); + #endif + return; + } + int csize = __BLOCK_GET_SIZE(__mem_blocks[block]); + #ifdef _DEBUG + printf("freeing block %i (0x%x), size: %i\n", block, (int)ptr, csize); + #endif + + if (__BLOCK_GET_FREEBLOCK(__mem_blocks[block])!=1 || csize==0) + { + #ifdef _DEBUG + printf("Block was not allocated!\n"); + #endif + return; + } + + // Mark block as free + __BLOCK_SET_FREE(__mem_blocks[block],1); + __mem_free += csize; + + int next = block+csize; + // Merge with previous block if possible + int prev = __BLOCK_GET_PREV(__mem_blocks[block]); + if (prev